From c337c8e0aabce580bf64c1f39d8b853d17e501ea Mon Sep 17 00:00:00 2001 From: Monica Auriemma Date: Wed, 5 Mar 2025 17:18:29 -0500 Subject: [PATCH 1/8] updated openapi generator for PHP --- sdks/php/.php-cs-fixer.dist.php | 94 +- sdks/php/README.md | 4 +- sdks/php/VERSION | 2 +- sdks/php/openapi-config.yaml | 2 +- sdks/php/run-build | 2 +- sdks/php/src/Api/AccountApi.php | 561 ++-- sdks/php/src/Api/ApiAppApi.php | 658 +++-- sdks/php/src/Api/BulkSendJobApi.php | 342 ++- sdks/php/src/Api/EmbeddedApi.php | 326 ++- sdks/php/src/Api/FaxApi.php | 650 +++-- sdks/php/src/Api/FaxLineApi.php | 936 +++--- sdks/php/src/Api/OAuthApi.php | 375 +-- sdks/php/src/Api/ReportApi.php | 193 +- sdks/php/src/Api/SignatureRequestApi.php | 2530 +++++++++-------- sdks/php/src/Api/TeamApi.php | 1246 ++++---- sdks/php/src/Api/TemplateApi.php | 1450 +++++----- sdks/php/src/Api/UnclaimedDraftApi.php | 566 ++-- sdks/php/src/ApiException.php | 30 +- sdks/php/src/Configuration.php | 111 +- sdks/php/src/EventCallbackHelper.php | 11 +- sdks/php/src/HeaderSelector.php | 88 +- sdks/php/src/Model/AccountCreateRequest.php | 170 +- sdks/php/src/Model/AccountCreateResponse.php | 166 +- sdks/php/src/Model/AccountGetResponse.php | 162 +- sdks/php/src/Model/AccountResponse.php | 214 +- sdks/php/src/Model/AccountResponseQuotas.php | 189 +- sdks/php/src/Model/AccountResponseUsage.php | 159 +- sdks/php/src/Model/AccountUpdateRequest.php | 170 +- sdks/php/src/Model/AccountVerifyRequest.php | 158 +- sdks/php/src/Model/AccountVerifyResponse.php | 166 +- .../Model/AccountVerifyResponseAccount.php | 162 +- sdks/php/src/Model/ApiAppCreateRequest.php | 203 +- sdks/php/src/Model/ApiAppGetResponse.php | 162 +- sdks/php/src/Model/ApiAppListResponse.php | 168 +- sdks/php/src/Model/ApiAppResponse.php | 196 +- sdks/php/src/Model/ApiAppResponseOAuth.php | 180 +- sdks/php/src/Model/ApiAppResponseOptions.php | 160 +- .../src/Model/ApiAppResponseOwnerAccount.php | 164 +- .../ApiAppResponseWhiteLabelingOptions.php | 212 +- sdks/php/src/Model/ApiAppUpdateRequest.php | 195 +- sdks/php/src/Model/BulkSendJobGetResponse.php | 172 +- ...ulkSendJobGetResponseSignatureRequests.php | 294 +- .../php/src/Model/BulkSendJobListResponse.php | 168 +- sdks/php/src/Model/BulkSendJobResponse.php | 180 +- .../php/src/Model/BulkSendJobSendResponse.php | 162 +- sdks/php/src/Model/EmbeddedEditUrlRequest.php | 206 +- .../php/src/Model/EmbeddedEditUrlResponse.php | 162 +- .../Model/EmbeddedEditUrlResponseEmbedded.php | 168 +- .../php/src/Model/EmbeddedSignUrlResponse.php | 162 +- .../Model/EmbeddedSignUrlResponseEmbedded.php | 168 +- sdks/php/src/Model/ErrorResponse.php | 156 +- sdks/php/src/Model/ErrorResponseError.php | 170 +- sdks/php/src/Model/EventCallbackRequest.php | 168 +- .../src/Model/EventCallbackRequestEvent.php | 175 +- .../EventCallbackRequestEventMetadata.php | 177 +- sdks/php/src/Model/FaxGetResponse.php | 162 +- sdks/php/src/Model/FaxLineAddUserRequest.php | 164 +- .../Model/FaxLineAreaCodeGetCountryEnum.php | 16 +- .../Model/FaxLineAreaCodeGetProvinceEnum.php | 16 +- .../src/Model/FaxLineAreaCodeGetResponse.php | 156 +- .../src/Model/FaxLineAreaCodeGetStateEnum.php | 16 +- sdks/php/src/Model/FaxLineCreateRequest.php | 169 +- sdks/php/src/Model/FaxLineDeleteRequest.php | 156 +- sdks/php/src/Model/FaxLineListResponse.php | 164 +- .../src/Model/FaxLineRemoveUserRequest.php | 164 +- sdks/php/src/Model/FaxLineResponse.php | 160 +- sdks/php/src/Model/FaxLineResponseFaxLine.php | 172 +- sdks/php/src/Model/FaxListResponse.php | 160 +- sdks/php/src/Model/FaxResponse.php | 196 +- .../php/src/Model/FaxResponseTransmission.php | 165 +- sdks/php/src/Model/FaxSendRequest.php | 195 +- sdks/php/src/Model/FileResponse.php | 164 +- sdks/php/src/Model/FileResponseDataUri.php | 158 +- sdks/php/src/Model/ListInfoResponse.php | 180 +- sdks/php/src/Model/ModelInterface.php | 16 +- .../src/Model/OAuthTokenGenerateRequest.php | 182 +- .../src/Model/OAuthTokenRefreshRequest.php | 172 +- sdks/php/src/Model/OAuthTokenResponse.php | 176 +- sdks/php/src/Model/ReportCreateRequest.php | 181 +- sdks/php/src/Model/ReportCreateResponse.php | 162 +- sdks/php/src/Model/ReportResponse.php | 177 +- ...tBulkCreateEmbeddedWithTemplateRequest.php | 232 +- ...tureRequestBulkSendWithTemplateRequest.php | 232 +- .../SignatureRequestCreateEmbeddedRequest.php | 276 +- ...questCreateEmbeddedWithTemplateRequest.php | 240 +- .../SignatureRequestEditEmbeddedRequest.php | 276 +- ...RequestEditEmbeddedWithTemplateRequest.php | 240 +- .../src/Model/SignatureRequestEditRequest.php | 282 +- ...ignatureRequestEditWithTemplateRequest.php | 248 +- .../src/Model/SignatureRequestGetResponse.php | 162 +- .../Model/SignatureRequestListResponse.php | 168 +- .../Model/SignatureRequestRemindRequest.php | 162 +- .../src/Model/SignatureRequestResponse.php | 294 +- .../SignatureRequestResponseAttachment.php | 188 +- ...ignatureRequestResponseCustomFieldBase.php | 168 +- ...tureRequestResponseCustomFieldCheckbox.php | 157 +- ...ignatureRequestResponseCustomFieldText.php | 157 +- ...tureRequestResponseCustomFieldTypeEnum.php | 16 +- .../SignatureRequestResponseDataBase.php | 172 +- .../SignatureRequestResponseDataTypeEnum.php | 16 +- ...natureRequestResponseDataValueCheckbox.php | 163 +- ...eRequestResponseDataValueCheckboxMerge.php | 163 +- ...tureRequestResponseDataValueDateSigned.php | 163 +- ...natureRequestResponseDataValueDropdown.php | 163 +- ...natureRequestResponseDataValueInitials.php | 169 +- ...SignatureRequestResponseDataValueRadio.php | 163 +- ...atureRequestResponseDataValueSignature.php | 169 +- .../SignatureRequestResponseDataValueText.php | 163 +- ...atureRequestResponseDataValueTextMerge.php | 163 +- .../SignatureRequestResponseSignatures.php | 266 +- .../src/Model/SignatureRequestSendRequest.php | 286 +- ...ignatureRequestSendWithTemplateRequest.php | 252 +- .../Model/SignatureRequestUpdateRequest.php | 170 +- sdks/php/src/Model/SubAttachment.php | 174 +- sdks/php/src/Model/SubBulkSignerList.php | 166 +- .../Model/SubBulkSignerListCustomField.php | 162 +- sdks/php/src/Model/SubCC.php | 162 +- sdks/php/src/Model/SubCustomField.php | 170 +- sdks/php/src/Model/SubEditorOptions.php | 164 +- sdks/php/src/Model/SubFieldOptions.php | 159 +- sdks/php/src/Model/SubFormFieldGroup.php | 164 +- sdks/php/src/Model/SubFormFieldRule.php | 189 +- sdks/php/src/Model/SubFormFieldRuleAction.php | 179 +- .../php/src/Model/SubFormFieldRuleTrigger.php | 169 +- .../Model/SubFormFieldsPerDocumentBase.php | 200 +- .../SubFormFieldsPerDocumentCheckbox.php | 165 +- .../SubFormFieldsPerDocumentCheckboxMerge.php | 153 +- .../SubFormFieldsPerDocumentDateSigned.php | 164 +- .../SubFormFieldsPerDocumentDropdown.php | 181 +- .../SubFormFieldsPerDocumentFontEnum.php | 16 +- .../SubFormFieldsPerDocumentHyperlink.php | 176 +- .../SubFormFieldsPerDocumentInitials.php | 153 +- .../Model/SubFormFieldsPerDocumentRadio.php | 163 +- .../SubFormFieldsPerDocumentSignature.php | 153 +- .../Model/SubFormFieldsPerDocumentText.php | 200 +- .../SubFormFieldsPerDocumentTextMerge.php | 164 +- .../SubFormFieldsPerDocumentTypeEnum.php | 16 +- sdks/php/src/Model/SubMergeField.php | 163 +- sdks/php/src/Model/SubOAuth.php | 165 +- sdks/php/src/Model/SubOptions.php | 162 +- .../SubSignatureRequestGroupedSigners.php | 166 +- .../src/Model/SubSignatureRequestSigner.php | 193 +- .../SubSignatureRequestTemplateSigner.php | 191 +- sdks/php/src/Model/SubSigningOptions.php | 173 +- sdks/php/src/Model/SubTeamResponse.php | 164 +- sdks/php/src/Model/SubTemplateRole.php | 168 +- .../php/src/Model/SubUnclaimedDraftSigner.php | 170 +- .../Model/SubUnclaimedDraftTemplateSigner.php | 170 +- .../php/src/Model/SubWhiteLabelingOptions.php | 213 +- sdks/php/src/Model/TeamAddMemberRequest.php | 165 +- sdks/php/src/Model/TeamCreateRequest.php | 162 +- sdks/php/src/Model/TeamGetInfoResponse.php | 162 +- sdks/php/src/Model/TeamGetResponse.php | 162 +- sdks/php/src/Model/TeamInfoResponse.php | 176 +- sdks/php/src/Model/TeamInviteResponse.php | 192 +- sdks/php/src/Model/TeamInvitesResponse.php | 162 +- sdks/php/src/Model/TeamMemberResponse.php | 174 +- sdks/php/src/Model/TeamMembersResponse.php | 166 +- sdks/php/src/Model/TeamParentResponse.php | 164 +- .../php/src/Model/TeamRemoveMemberRequest.php | 175 +- sdks/php/src/Model/TeamResponse.php | 174 +- sdks/php/src/Model/TeamSubTeamsResponse.php | 166 +- sdks/php/src/Model/TeamUpdateRequest.php | 162 +- sdks/php/src/Model/TemplateAddUserRequest.php | 168 +- .../TemplateCreateEmbeddedDraftRequest.php | 286 +- .../TemplateCreateEmbeddedDraftResponse.php | 162 +- ...ateCreateEmbeddedDraftResponseTemplate.php | 180 +- sdks/php/src/Model/TemplateCreateRequest.php | 250 +- sdks/php/src/Model/TemplateCreateResponse.php | 162 +- .../Model/TemplateCreateResponseTemplate.php | 162 +- sdks/php/src/Model/TemplateEditResponse.php | 158 +- sdks/php/src/Model/TemplateGetResponse.php | 162 +- sdks/php/src/Model/TemplateListResponse.php | 168 +- .../src/Model/TemplateRemoveUserRequest.php | 164 +- sdks/php/src/Model/TemplateResponse.php | 238 +- .../php/src/Model/TemplateResponseAccount.php | 190 +- .../Model/TemplateResponseAccountQuota.php | 180 +- sdks/php/src/Model/TemplateResponseCCRole.php | 162 +- .../src/Model/TemplateResponseDocument.php | 190 +- ...emplateResponseDocumentCustomFieldBase.php | 194 +- ...ateResponseDocumentCustomFieldCheckbox.php | 153 +- ...emplateResponseDocumentCustomFieldText.php | 175 +- .../TemplateResponseDocumentFieldGroup.php | 166 +- ...TemplateResponseDocumentFieldGroupRule.php | 164 +- .../TemplateResponseDocumentFormFieldBase.php | 192 +- ...plateResponseDocumentFormFieldCheckbox.php | 157 +- ...ateResponseDocumentFormFieldDateSigned.php | 157 +- ...plateResponseDocumentFormFieldDropdown.php | 157 +- ...lateResponseDocumentFormFieldHyperlink.php | 179 +- ...plateResponseDocumentFormFieldInitials.php | 157 +- ...TemplateResponseDocumentFormFieldRadio.php | 157 +- ...lateResponseDocumentFormFieldSignature.php | 157 +- .../TemplateResponseDocumentFormFieldText.php | 184 +- ...emplateResponseDocumentStaticFieldBase.php | 196 +- ...ateResponseDocumentStaticFieldCheckbox.php | 153 +- ...eResponseDocumentStaticFieldDateSigned.php | 153 +- ...ateResponseDocumentStaticFieldDropdown.php | 153 +- ...teResponseDocumentStaticFieldHyperlink.php | 153 +- ...ateResponseDocumentStaticFieldInitials.php | 153 +- ...mplateResponseDocumentStaticFieldRadio.php | 153 +- ...teResponseDocumentStaticFieldSignature.php | 153 +- ...emplateResponseDocumentStaticFieldText.php | 153 +- .../TemplateResponseFieldAvgTextLength.php | 168 +- .../src/Model/TemplateResponseSignerRole.php | 168 +- .../src/Model/TemplateUpdateFilesRequest.php | 195 +- .../src/Model/TemplateUpdateFilesResponse.php | 156 +- .../TemplateUpdateFilesResponseTemplate.php | 168 +- .../UnclaimedDraftCreateEmbeddedRequest.php | 337 +-- ...DraftCreateEmbeddedWithTemplateRequest.php | 314 +- .../src/Model/UnclaimedDraftCreateRequest.php | 279 +- .../Model/UnclaimedDraftCreateResponse.php | 162 +- .../UnclaimedDraftEditAndResendRequest.php | 192 +- sdks/php/src/Model/UnclaimedDraftResponse.php | 188 +- sdks/php/src/Model/WarningResponse.php | 160 +- sdks/php/src/ObjectSerializer.php | 304 +- sdks/php/templates/.php-cs-fixer.dist.php | 94 +- sdks/php/templates/Configuration.mustache | 2 +- sdks/php/templates/HeaderSelector.mustache | 30 +- sdks/php/templates/ObjectSerializer.mustache | 10 +- sdks/php/templates/api.mustache | 59 +- .../libraries/psr-18/ApiException.mustache | 8 +- .../templates/libraries/psr-18/api.mustache | 28 +- sdks/php/templates/model_enum.mustache | 9 +- sdks/php/templates/model_generic.mustache | 9 +- 224 files changed, 24503 insertions(+), 19669 deletions(-) diff --git a/sdks/php/.php-cs-fixer.dist.php b/sdks/php/.php-cs-fixer.dist.php index a8ff32efd..7a9234f44 100644 --- a/sdks/php/.php-cs-fixer.dist.php +++ b/sdks/php/.php-cs-fixer.dist.php @@ -17,89 +17,19 @@ ; $config = new PhpCsFixer\Config(); -$config->setParallelConfig( - PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect() -); return $config->setRules([ - '@PhpCsFixer' => true, - '@Symfony' => true, - '@DoctrineAnnotation' => true, - 'binary_operator_spaces' => [ - 'operators' => [ - '=>' => null, - ], - ], - 'blank_line_before_statement' => [ - 'statements' => [], - ], - 'blank_line_after_opening_tag' => false, - 'cast_spaces' => [ - 'space' => 'none', - ], - 'class_definition' => [ - 'inline_constructor_arguments' => false, - 'space_before_parenthesis' => true, - ], - 'concat_space' => [ - 'spacing' => 'one', - ], - 'nullable_type_declaration_for_default_null_value' => false, - 'declare_parentheses' => true, - 'echo_tag_syntax' => [ - 'format' => 'short', - 'shorten_simple_statements_only' => true, - ], - 'fully_qualified_strict_types' => true, - 'global_namespace_import' => true, - 'general_phpdoc_annotation_remove' => [ - 'annotations' => [ - 'author', 'package', 'subpackage', 'version', - ], - ], - 'increment_style' => false, - 'multiline_whitespace_before_semicolons' => [ - 'strategy' => 'no_multi_line', - ], - 'ordered_imports' => [ - 'imports_order' => [ - 'class', 'function', 'const', - ], - 'sort_algorithm' => 'alpha', - ], - 'no_superfluous_phpdoc_tags' => [ - 'allow_mixed' => true, - 'allow_unused_params' => true, - 'remove_inheritdoc' => true, - ], - 'phpdoc_align' => [ - 'tags' => [ - 'method', 'param', 'property', 'return', 'type', 'var', - ], - ], - 'phpdoc_line_span' => [ - 'property' => 'single', - ], - 'phpdoc_separation' => false, - 'phpdoc_summary' => false, - 'phpdoc_to_comment' => false, - 'phpdoc_to_param_type' => [ - 'scalar_types' => true, - 'union_types' => false, - ], - 'php_unit_internal_class' => false, - 'php_unit_test_class_requires_covers' => false, - 'single_line_throw' => false, - 'statement_indentation' => [ - 'stick_comment_to_next_continuous_control_statement' => false, - ], - 'visibility_required' => [ - 'elements' => ['method', 'property'], - ], - 'yoda_style' => false, - 'trailing_comma_in_multiline' => [ - 'after_heredoc' => true, - ], -]) + '@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) ->setRiskyAllowed(true) ; diff --git a/sdks/php/README.md b/sdks/php/README.md index 26a9ce8b7..26b63859c 100644 --- a/sdks/php/README.md +++ b/sdks/php/README.md @@ -447,6 +447,6 @@ apisupport@hellosign.com This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: `3.0.0` - - Package version: `1.8-dev` - - Generator version: `7.8.0` + - Package version: `1.8.1-dev` + - Generator version: `7.12.0` - Build package: `org.openapitools.codegen.languages.PhpClientCodegen` diff --git a/sdks/php/VERSION b/sdks/php/VERSION index d82db9132..00f91b858 100644 --- a/sdks/php/VERSION +++ b/sdks/php/VERSION @@ -1 +1 @@ -1.8-dev +1.8.1-dev diff --git a/sdks/php/openapi-config.yaml b/sdks/php/openapi-config.yaml index 1b3f81534..f761f58f7 100644 --- a/sdks/php/openapi-config.yaml +++ b/sdks/php/openapi-config.yaml @@ -2,7 +2,7 @@ generatorName: php additionalProperties: packageName: dropbox/sign packageVersion: "^1.8.0" - artifactVersion: 1.8-dev + artifactVersion: 1.8.1-dev invokerPackage: "Dropbox\\Sign" sortModelPropertiesByRequiredFlag: true srcBasePath: src diff --git a/sdks/php/run-build b/sdks/php/run-build index ec27ffff1..e52a919bf 100755 --- a/sdks/php/run-build +++ b/sdks/php/run-build @@ -19,7 +19,7 @@ rm -f "${DIR}/src/Model/"*.php docker run --rm \ -v "${DIR}/:/local" \ -v "${DIR}/openapi-sdk.yaml:/local/openapi-sdk.yaml" \ - openapitools/openapi-generator-cli:v7.8.0 generate \ + openapitools/openapi-generator-cli:v7.12.0 generate \ -i "/local/openapi-sdk.yaml" \ -c "/local/openapi-config.yaml" \ -t "/local/templates" \ diff --git a/sdks/php/src/Api/AccountApi.php b/sdks/php/src/Api/AccountApi.php index cfdc96f11..e6a1a1c0e 100644 --- a/sdks/php/src/Api/AccountApi.php +++ b/sdks/php/src/Api/AccountApi.php @@ -1,10 +1,13 @@ [ 'application/json', @@ -85,12 +93,15 @@ class AccountApi protected $response; /** - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param Configuration $config + * @param ClientInterface $client + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - Configuration $config = null, - ClientInterface $client = null, - HeaderSelector $selector = null, + ?Configuration $config = null, + ?ClientInterface $client = null, + ?HeaderSelector $selector = null, int $hostIndex = 0 ) { $this->client = $client ?: new Client(); @@ -105,7 +116,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex(int $hostIndex): void + public function setHostIndex($hostIndex): void { $this->hostIndex = $hostIndex; } @@ -142,13 +153,13 @@ public function getResponse() * * Create Account * - * @param Model\AccountCreateRequest $account_create_request account_create_request (required) + * @param Model\AccountCreateRequest $account_create_request account_create_request (required) * - * @return Model\AccountCreateResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\AccountCreateResponse */ - public function accountCreate(Model\AccountCreateRequest $account_create_request) + public function accountCreate($account_create_request) { list($response) = $this->accountCreateWithHttpInfo($account_create_request); return $response; @@ -159,15 +170,15 @@ public function accountCreate(Model\AccountCreateRequest $account_create_request * * Create Account * - * @param Model\AccountCreateRequest $account_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation + * @param Model\AccountCreateRequest $account_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation * - * @return array of Model\AccountCreateResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\AccountCreateResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::accountCreate. This method will eventually become unavailable */ - public function accountCreateWithHttpInfo(Model\AccountCreateRequest $account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) + public function accountCreateWithHttpInfo($account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) { $request = $this->accountCreateRequest($account_create_request, $contentType); @@ -179,14 +190,14 @@ public function accountCreateWithHttpInfo(Model\AccountCreateRequest $account_cr } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -194,18 +205,6 @@ public function accountCreateWithHttpInfo(Model\AccountCreateRequest $account_cr $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -216,16 +215,17 @@ public function accountCreateWithHttpInfo(Model\AccountCreateRequest $account_cr return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\AccountCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\AccountCreateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -242,19 +242,33 @@ public function accountCreateWithHttpInfo(Model\AccountCreateRequest $account_cr return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\AccountCreateResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\AccountCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -271,9 +285,11 @@ public function accountCreateWithHttpInfo(Model\AccountCreateRequest $account_cr return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -286,6 +302,7 @@ public function accountCreateWithHttpInfo(Model\AccountCreateRequest $account_cr ); $e->setResponseObject($data); break; + } throw $e; } @@ -296,14 +313,14 @@ public function accountCreateWithHttpInfo(Model\AccountCreateRequest $account_cr * * Create Account * - * @param Model\AccountCreateRequest $account_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation + * @param Model\AccountCreateRequest $account_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::accountCreate. This method will eventually become unavailable */ - public function accountCreateAsync(Model\AccountCreateRequest $account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) + public function accountCreateAsync($account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) { return $this->accountCreateAsyncWithHttpInfo($account_create_request, $contentType) ->then( @@ -318,14 +335,14 @@ function ($response) { * * Create Account * - * @param Model\AccountCreateRequest $account_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation + * @param Model\AccountCreateRequest $account_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::accountCreate. This method will eventually become unavailable */ - public function accountCreateAsyncWithHttpInfo(Model\AccountCreateRequest $account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) + public function accountCreateAsyncWithHttpInfo($account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) { $returnType = '\Dropbox\Sign\Model\AccountCreateResponse'; $request = $this->accountCreateRequest($account_create_request, $contentType); @@ -335,9 +352,9 @@ public function accountCreateAsyncWithHttpInfo(Model\AccountCreateRequest $accou ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -346,7 +363,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -360,7 +377,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -369,22 +386,24 @@ function ($exception) { /** * Create request for operation 'accountCreate' * - * @param Model\AccountCreateRequest $account_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation + * @param Model\AccountCreateRequest $account_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::accountCreate. This method will eventually become unavailable */ - public function accountCreateRequest(Model\AccountCreateRequest $account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) + public function accountCreateRequest($account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) { + // verify the required parameter 'account_create_request' is set if ($account_create_request === null || (is_array($account_create_request) && count($account_create_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $account_create_request when calling accountCreate' ); } + $resourcePath = '/account/create'; $formParams = []; $queryParams = []; @@ -398,8 +417,11 @@ public function accountCreateRequest(Model\AccountCreateRequest $account_create_ $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -407,7 +429,7 @@ public function accountCreateRequest(Model\AccountCreateRequest $account_create_ // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($account_create_request)); } else { $httpBody = $account_create_request; @@ -420,7 +442,7 @@ public function accountCreateRequest(Model\AccountCreateRequest $account_create_ foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -437,8 +459,9 @@ public function accountCreateRequest(Model\AccountCreateRequest $account_create_ $payloadHook('multipart', $multipartContents, $account_create_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -481,14 +504,14 @@ public function accountCreateRequest(Model\AccountCreateRequest $account_create_ * * Get Account * - * @param string $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) - * @param string $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) + * @param string|null $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) + * @param string|null $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) * - * @return Model\AccountGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\AccountGetResponse */ - public function accountGet(string $account_id = null, string $email_address = null) + public function accountGet($account_id = null, $email_address = null) { list($response) = $this->accountGetWithHttpInfo($account_id, $email_address); return $response; @@ -499,16 +522,16 @@ public function accountGet(string $account_id = null, string $email_address = nu * * Get Account * - * @param string $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) - * @param string $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation + * @param string|null $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) + * @param string|null $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation * - * @return array of Model\AccountGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\AccountGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::accountGet. This method will eventually become unavailable */ - public function accountGetWithHttpInfo(string $account_id = null, string $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) + public function accountGetWithHttpInfo($account_id = null, $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) { $request = $this->accountGetRequest($account_id, $email_address, $contentType); @@ -520,14 +543,14 @@ public function accountGetWithHttpInfo(string $account_id = null, string $email_ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -535,18 +558,6 @@ public function accountGetWithHttpInfo(string $account_id = null, string $email_ $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -557,16 +568,17 @@ public function accountGetWithHttpInfo(string $account_id = null, string $email_ return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\AccountGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\AccountGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -583,19 +595,33 @@ public function accountGetWithHttpInfo(string $account_id = null, string $email_ return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\AccountGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\AccountGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -612,9 +638,11 @@ public function accountGetWithHttpInfo(string $account_id = null, string $email_ return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -627,6 +655,7 @@ public function accountGetWithHttpInfo(string $account_id = null, string $email_ ); $e->setResponseObject($data); break; + } throw $e; } @@ -637,15 +666,15 @@ public function accountGetWithHttpInfo(string $account_id = null, string $email_ * * Get Account * - * @param string $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) - * @param string $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation + * @param string|null $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) + * @param string|null $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::accountGet. This method will eventually become unavailable */ - public function accountGetAsync(string $account_id = null, string $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) + public function accountGetAsync($account_id = null, $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) { return $this->accountGetAsyncWithHttpInfo($account_id, $email_address, $contentType) ->then( @@ -660,15 +689,15 @@ function ($response) { * * Get Account * - * @param string $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) - * @param string $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation + * @param string|null $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) + * @param string|null $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::accountGet. This method will eventually become unavailable */ - public function accountGetAsyncWithHttpInfo(string $account_id = null, string $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) + public function accountGetAsyncWithHttpInfo($account_id = null, $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) { $returnType = '\Dropbox\Sign\Model\AccountGetResponse'; $request = $this->accountGetRequest($account_id, $email_address, $contentType); @@ -678,9 +707,9 @@ public function accountGetAsyncWithHttpInfo(string $account_id = null, string $e ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -689,7 +718,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -703,7 +732,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -712,16 +741,20 @@ function ($exception) { /** * Create request for operation 'accountGet' * - * @param string $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) - * @param string $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation + * @param string|null $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) + * @param string|null $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::accountGet. This method will eventually become unavailable */ - public function accountGetRequest(string $account_id = null, string $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) + public function accountGetRequest($account_id = null, $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) { + + + + $resourcePath = '/account'; $formParams = []; $queryParams = []; @@ -748,8 +781,11 @@ public function accountGetRequest(string $account_id = null, string $email_addre false // required ) ?? []); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -763,7 +799,7 @@ public function accountGetRequest(string $account_id = null, string $email_addre foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -777,8 +813,9 @@ public function accountGetRequest(string $account_id = null, string $email_addre } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -821,13 +858,13 @@ public function accountGetRequest(string $account_id = null, string $email_addre * * Update Account * - * @param Model\AccountUpdateRequest $account_update_request account_update_request (required) + * @param Model\AccountUpdateRequest $account_update_request account_update_request (required) * - * @return Model\AccountGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\AccountGetResponse */ - public function accountUpdate(Model\AccountUpdateRequest $account_update_request) + public function accountUpdate($account_update_request) { list($response) = $this->accountUpdateWithHttpInfo($account_update_request); return $response; @@ -838,15 +875,15 @@ public function accountUpdate(Model\AccountUpdateRequest $account_update_request * * Update Account * - * @param Model\AccountUpdateRequest $account_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation + * @param Model\AccountUpdateRequest $account_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation * - * @return array of Model\AccountGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\AccountGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::accountUpdate. This method will eventually become unavailable */ - public function accountUpdateWithHttpInfo(Model\AccountUpdateRequest $account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) + public function accountUpdateWithHttpInfo($account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) { $request = $this->accountUpdateRequest($account_update_request, $contentType); @@ -858,14 +895,14 @@ public function accountUpdateWithHttpInfo(Model\AccountUpdateRequest $account_up } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -873,18 +910,6 @@ public function accountUpdateWithHttpInfo(Model\AccountUpdateRequest $account_up $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -895,16 +920,17 @@ public function accountUpdateWithHttpInfo(Model\AccountUpdateRequest $account_up return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\AccountGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\AccountGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -921,19 +947,33 @@ public function accountUpdateWithHttpInfo(Model\AccountUpdateRequest $account_up return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\AccountGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\AccountGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -950,9 +990,11 @@ public function accountUpdateWithHttpInfo(Model\AccountUpdateRequest $account_up return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -965,6 +1007,7 @@ public function accountUpdateWithHttpInfo(Model\AccountUpdateRequest $account_up ); $e->setResponseObject($data); break; + } throw $e; } @@ -975,14 +1018,14 @@ public function accountUpdateWithHttpInfo(Model\AccountUpdateRequest $account_up * * Update Account * - * @param Model\AccountUpdateRequest $account_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation + * @param Model\AccountUpdateRequest $account_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::accountUpdate. This method will eventually become unavailable */ - public function accountUpdateAsync(Model\AccountUpdateRequest $account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) + public function accountUpdateAsync($account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) { return $this->accountUpdateAsyncWithHttpInfo($account_update_request, $contentType) ->then( @@ -997,14 +1040,14 @@ function ($response) { * * Update Account * - * @param Model\AccountUpdateRequest $account_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation + * @param Model\AccountUpdateRequest $account_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::accountUpdate. This method will eventually become unavailable */ - public function accountUpdateAsyncWithHttpInfo(Model\AccountUpdateRequest $account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) + public function accountUpdateAsyncWithHttpInfo($account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) { $returnType = '\Dropbox\Sign\Model\AccountGetResponse'; $request = $this->accountUpdateRequest($account_update_request, $contentType); @@ -1014,9 +1057,9 @@ public function accountUpdateAsyncWithHttpInfo(Model\AccountUpdateRequest $accou ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1025,7 +1068,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -1039,7 +1082,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1048,22 +1091,24 @@ function ($exception) { /** * Create request for operation 'accountUpdate' * - * @param Model\AccountUpdateRequest $account_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation + * @param Model\AccountUpdateRequest $account_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::accountUpdate. This method will eventually become unavailable */ - public function accountUpdateRequest(Model\AccountUpdateRequest $account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) + public function accountUpdateRequest($account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) { + // verify the required parameter 'account_update_request' is set if ($account_update_request === null || (is_array($account_update_request) && count($account_update_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $account_update_request when calling accountUpdate' ); } + $resourcePath = '/account'; $formParams = []; $queryParams = []; @@ -1077,8 +1122,11 @@ public function accountUpdateRequest(Model\AccountUpdateRequest $account_update_ $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1086,7 +1134,7 @@ public function accountUpdateRequest(Model\AccountUpdateRequest $account_update_ // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($account_update_request)); } else { $httpBody = $account_update_request; @@ -1099,7 +1147,7 @@ public function accountUpdateRequest(Model\AccountUpdateRequest $account_update_ foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1116,8 +1164,9 @@ public function accountUpdateRequest(Model\AccountUpdateRequest $account_update_ $payloadHook('multipart', $multipartContents, $account_update_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1160,13 +1209,13 @@ public function accountUpdateRequest(Model\AccountUpdateRequest $account_update_ * * Verify Account * - * @param Model\AccountVerifyRequest $account_verify_request account_verify_request (required) + * @param Model\AccountVerifyRequest $account_verify_request account_verify_request (required) * - * @return Model\AccountVerifyResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\AccountVerifyResponse */ - public function accountVerify(Model\AccountVerifyRequest $account_verify_request) + public function accountVerify($account_verify_request) { list($response) = $this->accountVerifyWithHttpInfo($account_verify_request); return $response; @@ -1177,15 +1226,15 @@ public function accountVerify(Model\AccountVerifyRequest $account_verify_request * * Verify Account * - * @param Model\AccountVerifyRequest $account_verify_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation + * @param Model\AccountVerifyRequest $account_verify_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation * - * @return array of Model\AccountVerifyResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\AccountVerifyResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::accountVerify. This method will eventually become unavailable */ - public function accountVerifyWithHttpInfo(Model\AccountVerifyRequest $account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) + public function accountVerifyWithHttpInfo($account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) { $request = $this->accountVerifyRequest($account_verify_request, $contentType); @@ -1197,14 +1246,14 @@ public function accountVerifyWithHttpInfo(Model\AccountVerifyRequest $account_ve } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -1212,18 +1261,6 @@ public function accountVerifyWithHttpInfo(Model\AccountVerifyRequest $account_ve $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -1234,16 +1271,17 @@ public function accountVerifyWithHttpInfo(Model\AccountVerifyRequest $account_ve return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\AccountVerifyResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\AccountVerifyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1260,19 +1298,33 @@ public function accountVerifyWithHttpInfo(Model\AccountVerifyRequest $account_ve return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\AccountVerifyResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\AccountVerifyResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1289,9 +1341,11 @@ public function accountVerifyWithHttpInfo(Model\AccountVerifyRequest $account_ve return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1304,6 +1358,7 @@ public function accountVerifyWithHttpInfo(Model\AccountVerifyRequest $account_ve ); $e->setResponseObject($data); break; + } throw $e; } @@ -1314,14 +1369,14 @@ public function accountVerifyWithHttpInfo(Model\AccountVerifyRequest $account_ve * * Verify Account * - * @param Model\AccountVerifyRequest $account_verify_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation + * @param Model\AccountVerifyRequest $account_verify_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::accountVerify. This method will eventually become unavailable */ - public function accountVerifyAsync(Model\AccountVerifyRequest $account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) + public function accountVerifyAsync($account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) { return $this->accountVerifyAsyncWithHttpInfo($account_verify_request, $contentType) ->then( @@ -1336,14 +1391,14 @@ function ($response) { * * Verify Account * - * @param Model\AccountVerifyRequest $account_verify_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation + * @param Model\AccountVerifyRequest $account_verify_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::accountVerify. This method will eventually become unavailable */ - public function accountVerifyAsyncWithHttpInfo(Model\AccountVerifyRequest $account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) + public function accountVerifyAsyncWithHttpInfo($account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) { $returnType = '\Dropbox\Sign\Model\AccountVerifyResponse'; $request = $this->accountVerifyRequest($account_verify_request, $contentType); @@ -1353,9 +1408,9 @@ public function accountVerifyAsyncWithHttpInfo(Model\AccountVerifyRequest $accou ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1364,7 +1419,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -1378,7 +1433,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1387,22 +1442,24 @@ function ($exception) { /** * Create request for operation 'accountVerify' * - * @param Model\AccountVerifyRequest $account_verify_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation + * @param Model\AccountVerifyRequest $account_verify_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::accountVerify. This method will eventually become unavailable */ - public function accountVerifyRequest(Model\AccountVerifyRequest $account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) + public function accountVerifyRequest($account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) { + // verify the required parameter 'account_verify_request' is set if ($account_verify_request === null || (is_array($account_verify_request) && count($account_verify_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $account_verify_request when calling accountVerify' ); } + $resourcePath = '/account/verify'; $formParams = []; $queryParams = []; @@ -1416,8 +1473,11 @@ public function accountVerifyRequest(Model\AccountVerifyRequest $account_verify_ $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1425,7 +1485,7 @@ public function accountVerifyRequest(Model\AccountVerifyRequest $account_verify_ // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($account_verify_request)); } else { $httpBody = $account_verify_request; @@ -1438,7 +1498,7 @@ public function accountVerifyRequest(Model\AccountVerifyRequest $account_verify_ foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1455,8 +1515,9 @@ public function accountVerifyRequest(Model\AccountVerifyRequest $account_verify_ $payloadHook('multipart', $multipartContents, $account_verify_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1497,8 +1558,8 @@ public function accountVerifyRequest(Model\AccountVerifyRequest $account_verify_ /** * Create http client option * + * @throws \RuntimeException on file opening failure * @return array of http client options - * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -1506,7 +1567,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -1522,8 +1583,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -1533,9 +1594,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); } return [ @@ -1554,8 +1615,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/ApiAppApi.php b/sdks/php/src/Api/ApiAppApi.php index 07dd3db63..d7817f60a 100644 --- a/sdks/php/src/Api/ApiAppApi.php +++ b/sdks/php/src/Api/ApiAppApi.php @@ -1,10 +1,13 @@ [ 'application/json', @@ -90,12 +98,15 @@ class ApiAppApi protected $response; /** - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param Configuration $config + * @param ClientInterface $client + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - Configuration $config = null, - ClientInterface $client = null, - HeaderSelector $selector = null, + ?Configuration $config = null, + ?ClientInterface $client = null, + ?HeaderSelector $selector = null, int $hostIndex = 0 ) { $this->client = $client ?: new Client(); @@ -110,7 +121,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex(int $hostIndex): void + public function setHostIndex($hostIndex): void { $this->hostIndex = $hostIndex; } @@ -147,13 +158,13 @@ public function getResponse() * * Create API App * - * @param Model\ApiAppCreateRequest $api_app_create_request api_app_create_request (required) + * @param Model\ApiAppCreateRequest $api_app_create_request api_app_create_request (required) * - * @return Model\ApiAppGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\ApiAppGetResponse */ - public function apiAppCreate(Model\ApiAppCreateRequest $api_app_create_request) + public function apiAppCreate($api_app_create_request) { list($response) = $this->apiAppCreateWithHttpInfo($api_app_create_request); return $response; @@ -164,15 +175,15 @@ public function apiAppCreate(Model\ApiAppCreateRequest $api_app_create_request) * * Create API App * - * @param Model\ApiAppCreateRequest $api_app_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation + * @param Model\ApiAppCreateRequest $api_app_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation * - * @return array of Model\ApiAppGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\ApiAppGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::apiAppCreate. This method will eventually become unavailable */ - public function apiAppCreateWithHttpInfo(Model\ApiAppCreateRequest $api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) + public function apiAppCreateWithHttpInfo($api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) { $request = $this->apiAppCreateRequest($api_app_create_request, $contentType); @@ -184,14 +195,14 @@ public function apiAppCreateWithHttpInfo(Model\ApiAppCreateRequest $api_app_crea } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -199,18 +210,6 @@ public function apiAppCreateWithHttpInfo(Model\ApiAppCreateRequest $api_app_crea $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -221,16 +220,17 @@ public function apiAppCreateWithHttpInfo(Model\ApiAppCreateRequest $api_app_crea return $result; } + switch ($statusCode) { case 201: if ('\Dropbox\Sign\Model\ApiAppGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\ApiAppGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -247,19 +247,33 @@ public function apiAppCreateWithHttpInfo(Model\ApiAppCreateRequest $api_app_crea return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ApiAppGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\ApiAppGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -276,9 +290,11 @@ public function apiAppCreateWithHttpInfo(Model\ApiAppCreateRequest $api_app_crea return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -291,6 +307,7 @@ public function apiAppCreateWithHttpInfo(Model\ApiAppCreateRequest $api_app_crea ); $e->setResponseObject($data); break; + } throw $e; } @@ -301,14 +318,14 @@ public function apiAppCreateWithHttpInfo(Model\ApiAppCreateRequest $api_app_crea * * Create API App * - * @param Model\ApiAppCreateRequest $api_app_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation + * @param Model\ApiAppCreateRequest $api_app_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppCreate. This method will eventually become unavailable */ - public function apiAppCreateAsync(Model\ApiAppCreateRequest $api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) + public function apiAppCreateAsync($api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) { return $this->apiAppCreateAsyncWithHttpInfo($api_app_create_request, $contentType) ->then( @@ -323,14 +340,14 @@ function ($response) { * * Create API App * - * @param Model\ApiAppCreateRequest $api_app_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation + * @param Model\ApiAppCreateRequest $api_app_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppCreate. This method will eventually become unavailable */ - public function apiAppCreateAsyncWithHttpInfo(Model\ApiAppCreateRequest $api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) + public function apiAppCreateAsyncWithHttpInfo($api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) { $returnType = '\Dropbox\Sign\Model\ApiAppGetResponse'; $request = $this->apiAppCreateRequest($api_app_create_request, $contentType); @@ -340,9 +357,9 @@ public function apiAppCreateAsyncWithHttpInfo(Model\ApiAppCreateRequest $api_app ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -351,7 +368,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -365,7 +382,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -374,22 +391,24 @@ function ($exception) { /** * Create request for operation 'apiAppCreate' * - * @param Model\ApiAppCreateRequest $api_app_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation + * @param Model\ApiAppCreateRequest $api_app_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::apiAppCreate. This method will eventually become unavailable */ - public function apiAppCreateRequest(Model\ApiAppCreateRequest $api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) + public function apiAppCreateRequest($api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) { + // verify the required parameter 'api_app_create_request' is set if ($api_app_create_request === null || (is_array($api_app_create_request) && count($api_app_create_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $api_app_create_request when calling apiAppCreate' ); } + $resourcePath = '/api_app'; $formParams = []; $queryParams = []; @@ -403,8 +422,11 @@ public function apiAppCreateRequest(Model\ApiAppCreateRequest $api_app_create_re $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -412,7 +434,7 @@ public function apiAppCreateRequest(Model\ApiAppCreateRequest $api_app_create_re // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($api_app_create_request)); } else { $httpBody = $api_app_create_request; @@ -425,7 +447,7 @@ public function apiAppCreateRequest(Model\ApiAppCreateRequest $api_app_create_re foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -442,8 +464,9 @@ public function apiAppCreateRequest(Model\ApiAppCreateRequest $api_app_create_re $payloadHook('multipart', $multipartContents, $api_app_create_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -486,12 +509,13 @@ public function apiAppCreateRequest(Model\ApiAppCreateRequest $api_app_create_re * * Delete API App * - * @param string $client_id The client id of the API App to delete. (required) + * @param string $client_id The client id of the API App to delete. (required) * * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return void */ - public function apiAppDelete(string $client_id) + public function apiAppDelete($client_id) { $this->apiAppDeleteWithHttpInfo($client_id); } @@ -501,15 +525,15 @@ public function apiAppDelete(string $client_id) * * Delete API App * - * @param string $client_id The client id of the API App to delete. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation + * @param string $client_id The client id of the API App to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation * - * @return array of null, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::apiAppDelete. This method will eventually become unavailable */ - public function apiAppDeleteWithHttpInfo(string $client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) + public function apiAppDeleteWithHttpInfo($client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) { $request = $this->apiAppDeleteRequest($client_id, $contentType); @@ -521,14 +545,14 @@ public function apiAppDeleteWithHttpInfo(string $client_id, string $contentType } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -536,25 +560,16 @@ public function apiAppDeleteWithHttpInfo(string $client_id, string $contentType $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() - ); - } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } switch ($e->getCode()) { + } throw $e; } @@ -565,14 +580,14 @@ public function apiAppDeleteWithHttpInfo(string $client_id, string $contentType * * Delete API App * - * @param string $client_id The client id of the API App to delete. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation + * @param string $client_id The client id of the API App to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppDelete. This method will eventually become unavailable */ - public function apiAppDeleteAsync(string $client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) + public function apiAppDeleteAsync($client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) { return $this->apiAppDeleteAsyncWithHttpInfo($client_id, $contentType) ->then( @@ -587,14 +602,14 @@ function ($response) { * * Delete API App * - * @param string $client_id The client id of the API App to delete. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation + * @param string $client_id The client id of the API App to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppDelete. This method will eventually become unavailable */ - public function apiAppDeleteAsyncWithHttpInfo(string $client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) + public function apiAppDeleteAsyncWithHttpInfo($client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) { $returnType = ''; $request = $this->apiAppDeleteRequest($client_id, $contentType); @@ -602,7 +617,7 @@ public function apiAppDeleteAsyncWithHttpInfo(string $client_id, string $content return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( - function ($response) { + function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { @@ -616,7 +631,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -625,22 +640,24 @@ function ($exception) { /** * Create request for operation 'apiAppDelete' * - * @param string $client_id The client id of the API App to delete. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation + * @param string $client_id The client id of the API App to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::apiAppDelete. This method will eventually become unavailable */ - public function apiAppDeleteRequest(string $client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) + public function apiAppDeleteRequest($client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) { + // verify the required parameter 'client_id' is set if ($client_id === null || (is_array($client_id) && count($client_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $client_id when calling apiAppDelete' ); } + $resourcePath = '/api_app/{client_id}'; $formParams = []; $queryParams = []; @@ -648,17 +665,20 @@ public function apiAppDeleteRequest(string $client_id, string $contentType = sel $httpBody = ''; $multipart = false; + + // path params if ($client_id !== null) { $resourcePath = str_replace( - '{client_id}', + '{' . 'client_id' . '}', ObjectSerializer::toPathValue($client_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -672,7 +692,7 @@ public function apiAppDeleteRequest(string $client_id, string $contentType = sel foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -686,8 +706,9 @@ public function apiAppDeleteRequest(string $client_id, string $contentType = sel } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -730,13 +751,13 @@ public function apiAppDeleteRequest(string $client_id, string $contentType = sel * * Get API App * - * @param string $client_id The client id of the API App to retrieve. (required) + * @param string $client_id The client id of the API App to retrieve. (required) * - * @return Model\ApiAppGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\ApiAppGetResponse */ - public function apiAppGet(string $client_id) + public function apiAppGet($client_id) { list($response) = $this->apiAppGetWithHttpInfo($client_id); return $response; @@ -747,15 +768,15 @@ public function apiAppGet(string $client_id) * * Get API App * - * @param string $client_id The client id of the API App to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation + * @param string $client_id The client id of the API App to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation * - * @return array of Model\ApiAppGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\ApiAppGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::apiAppGet. This method will eventually become unavailable */ - public function apiAppGetWithHttpInfo(string $client_id, string $contentType = self::contentTypes['apiAppGet'][0]) + public function apiAppGetWithHttpInfo($client_id, string $contentType = self::contentTypes['apiAppGet'][0]) { $request = $this->apiAppGetRequest($client_id, $contentType); @@ -767,14 +788,14 @@ public function apiAppGetWithHttpInfo(string $client_id, string $contentType = s } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -782,18 +803,6 @@ public function apiAppGetWithHttpInfo(string $client_id, string $contentType = s $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -804,16 +813,17 @@ public function apiAppGetWithHttpInfo(string $client_id, string $contentType = s return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\ApiAppGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\ApiAppGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -830,19 +840,33 @@ public function apiAppGetWithHttpInfo(string $client_id, string $contentType = s return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ApiAppGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\ApiAppGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -859,9 +883,11 @@ public function apiAppGetWithHttpInfo(string $client_id, string $contentType = s return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -874,6 +900,7 @@ public function apiAppGetWithHttpInfo(string $client_id, string $contentType = s ); $e->setResponseObject($data); break; + } throw $e; } @@ -884,14 +911,14 @@ public function apiAppGetWithHttpInfo(string $client_id, string $contentType = s * * Get API App * - * @param string $client_id The client id of the API App to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation + * @param string $client_id The client id of the API App to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppGet. This method will eventually become unavailable */ - public function apiAppGetAsync(string $client_id, string $contentType = self::contentTypes['apiAppGet'][0]) + public function apiAppGetAsync($client_id, string $contentType = self::contentTypes['apiAppGet'][0]) { return $this->apiAppGetAsyncWithHttpInfo($client_id, $contentType) ->then( @@ -906,14 +933,14 @@ function ($response) { * * Get API App * - * @param string $client_id The client id of the API App to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation + * @param string $client_id The client id of the API App to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppGet. This method will eventually become unavailable */ - public function apiAppGetAsyncWithHttpInfo(string $client_id, string $contentType = self::contentTypes['apiAppGet'][0]) + public function apiAppGetAsyncWithHttpInfo($client_id, string $contentType = self::contentTypes['apiAppGet'][0]) { $returnType = '\Dropbox\Sign\Model\ApiAppGetResponse'; $request = $this->apiAppGetRequest($client_id, $contentType); @@ -923,9 +950,9 @@ public function apiAppGetAsyncWithHttpInfo(string $client_id, string $contentTyp ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -934,7 +961,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -948,7 +975,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -957,22 +984,24 @@ function ($exception) { /** * Create request for operation 'apiAppGet' * - * @param string $client_id The client id of the API App to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation + * @param string $client_id The client id of the API App to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::apiAppGet. This method will eventually become unavailable */ - public function apiAppGetRequest(string $client_id, string $contentType = self::contentTypes['apiAppGet'][0]) + public function apiAppGetRequest($client_id, string $contentType = self::contentTypes['apiAppGet'][0]) { + // verify the required parameter 'client_id' is set if ($client_id === null || (is_array($client_id) && count($client_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $client_id when calling apiAppGet' ); } + $resourcePath = '/api_app/{client_id}'; $formParams = []; $queryParams = []; @@ -980,17 +1009,20 @@ public function apiAppGetRequest(string $client_id, string $contentType = self:: $httpBody = ''; $multipart = false; + + // path params if ($client_id !== null) { $resourcePath = str_replace( - '{client_id}', + '{' . 'client_id' . '}', ObjectSerializer::toPathValue($client_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1004,7 +1036,7 @@ public function apiAppGetRequest(string $client_id, string $contentType = self:: foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1018,8 +1050,9 @@ public function apiAppGetRequest(string $client_id, string $contentType = self:: } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1062,14 +1095,14 @@ public function apiAppGetRequest(string $client_id, string $contentType = self:: * * List API Apps * - * @param int $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param int|null $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) * - * @return Model\ApiAppListResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\ApiAppListResponse */ - public function apiAppList(int $page = 1, int $page_size = 20) + public function apiAppList($page = 1, $page_size = 20) { list($response) = $this->apiAppListWithHttpInfo($page, $page_size); return $response; @@ -1080,16 +1113,16 @@ public function apiAppList(int $page = 1, int $page_size = 20) * * List API Apps * - * @param int $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation + * @param int|null $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation * - * @return array of Model\ApiAppListResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\ApiAppListResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::apiAppList. This method will eventually become unavailable */ - public function apiAppListWithHttpInfo(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) + public function apiAppListWithHttpInfo($page = 1, $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) { $request = $this->apiAppListRequest($page, $page_size, $contentType); @@ -1101,14 +1134,14 @@ public function apiAppListWithHttpInfo(int $page = 1, int $page_size = 20, strin } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -1116,18 +1149,6 @@ public function apiAppListWithHttpInfo(int $page = 1, int $page_size = 20, strin $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -1138,16 +1159,17 @@ public function apiAppListWithHttpInfo(int $page = 1, int $page_size = 20, strin return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\ApiAppListResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\ApiAppListResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1164,19 +1186,33 @@ public function apiAppListWithHttpInfo(int $page = 1, int $page_size = 20, strin return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ApiAppListResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\ApiAppListResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1193,9 +1229,11 @@ public function apiAppListWithHttpInfo(int $page = 1, int $page_size = 20, strin return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1208,6 +1246,7 @@ public function apiAppListWithHttpInfo(int $page = 1, int $page_size = 20, strin ); $e->setResponseObject($data); break; + } throw $e; } @@ -1218,15 +1257,15 @@ public function apiAppListWithHttpInfo(int $page = 1, int $page_size = 20, strin * * List API Apps * - * @param int $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation + * @param int|null $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppList. This method will eventually become unavailable */ - public function apiAppListAsync(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) + public function apiAppListAsync($page = 1, $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) { return $this->apiAppListAsyncWithHttpInfo($page, $page_size, $contentType) ->then( @@ -1241,15 +1280,15 @@ function ($response) { * * List API Apps * - * @param int $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation + * @param int|null $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppList. This method will eventually become unavailable */ - public function apiAppListAsyncWithHttpInfo(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) + public function apiAppListAsyncWithHttpInfo($page = 1, $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) { $returnType = '\Dropbox\Sign\Model\ApiAppListResponse'; $request = $this->apiAppListRequest($page, $page_size, $contentType); @@ -1259,9 +1298,9 @@ public function apiAppListAsyncWithHttpInfo(int $page = 1, int $page_size = 20, ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1270,7 +1309,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -1284,7 +1323,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1293,16 +1332,20 @@ function ($exception) { /** * Create request for operation 'apiAppList' * - * @param int $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation + * @param int|null $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::apiAppList. This method will eventually become unavailable */ - public function apiAppListRequest(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) + public function apiAppListRequest($page = 1, $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) { + + + + $resourcePath = '/api_app/list'; $formParams = []; $queryParams = []; @@ -1329,8 +1372,11 @@ public function apiAppListRequest(int $page = 1, int $page_size = 20, string $co false // required ) ?? []); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1344,7 +1390,7 @@ public function apiAppListRequest(int $page = 1, int $page_size = 20, string $co foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1358,8 +1404,9 @@ public function apiAppListRequest(int $page = 1, int $page_size = 20, string $co } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1402,14 +1449,14 @@ public function apiAppListRequest(int $page = 1, int $page_size = 20, string $co * * Update API App * - * @param string $client_id The client id of the API App to update. (required) - * @param Model\ApiAppUpdateRequest $api_app_update_request api_app_update_request (required) + * @param string $client_id The client id of the API App to update. (required) + * @param Model\ApiAppUpdateRequest $api_app_update_request api_app_update_request (required) * - * @return Model\ApiAppGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\ApiAppGetResponse */ - public function apiAppUpdate(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request) + public function apiAppUpdate($client_id, $api_app_update_request) { list($response) = $this->apiAppUpdateWithHttpInfo($client_id, $api_app_update_request); return $response; @@ -1420,16 +1467,16 @@ public function apiAppUpdate(string $client_id, Model\ApiAppUpdateRequest $api_a * * Update API App * - * @param string $client_id The client id of the API App to update. (required) - * @param Model\ApiAppUpdateRequest $api_app_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation + * @param string $client_id The client id of the API App to update. (required) + * @param Model\ApiAppUpdateRequest $api_app_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation * - * @return array of Model\ApiAppGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\ApiAppGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::apiAppUpdate. This method will eventually become unavailable */ - public function apiAppUpdateWithHttpInfo(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) + public function apiAppUpdateWithHttpInfo($client_id, $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) { $request = $this->apiAppUpdateRequest($client_id, $api_app_update_request, $contentType); @@ -1441,14 +1488,14 @@ public function apiAppUpdateWithHttpInfo(string $client_id, Model\ApiAppUpdateRe } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -1456,18 +1503,6 @@ public function apiAppUpdateWithHttpInfo(string $client_id, Model\ApiAppUpdateRe $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -1478,16 +1513,17 @@ public function apiAppUpdateWithHttpInfo(string $client_id, Model\ApiAppUpdateRe return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\ApiAppGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\ApiAppGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1504,19 +1540,33 @@ public function apiAppUpdateWithHttpInfo(string $client_id, Model\ApiAppUpdateRe return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ApiAppGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\ApiAppGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1533,9 +1583,11 @@ public function apiAppUpdateWithHttpInfo(string $client_id, Model\ApiAppUpdateRe return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1548,6 +1600,7 @@ public function apiAppUpdateWithHttpInfo(string $client_id, Model\ApiAppUpdateRe ); $e->setResponseObject($data); break; + } throw $e; } @@ -1558,15 +1611,15 @@ public function apiAppUpdateWithHttpInfo(string $client_id, Model\ApiAppUpdateRe * * Update API App * - * @param string $client_id The client id of the API App to update. (required) - * @param Model\ApiAppUpdateRequest $api_app_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation + * @param string $client_id The client id of the API App to update. (required) + * @param Model\ApiAppUpdateRequest $api_app_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppUpdate. This method will eventually become unavailable */ - public function apiAppUpdateAsync(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) + public function apiAppUpdateAsync($client_id, $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) { return $this->apiAppUpdateAsyncWithHttpInfo($client_id, $api_app_update_request, $contentType) ->then( @@ -1581,15 +1634,15 @@ function ($response) { * * Update API App * - * @param string $client_id The client id of the API App to update. (required) - * @param Model\ApiAppUpdateRequest $api_app_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation + * @param string $client_id The client id of the API App to update. (required) + * @param Model\ApiAppUpdateRequest $api_app_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppUpdate. This method will eventually become unavailable */ - public function apiAppUpdateAsyncWithHttpInfo(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) + public function apiAppUpdateAsyncWithHttpInfo($client_id, $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) { $returnType = '\Dropbox\Sign\Model\ApiAppGetResponse'; $request = $this->apiAppUpdateRequest($client_id, $api_app_update_request, $contentType); @@ -1599,9 +1652,9 @@ public function apiAppUpdateAsyncWithHttpInfo(string $client_id, Model\ApiAppUpd ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1610,7 +1663,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -1624,7 +1677,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1633,30 +1686,32 @@ function ($exception) { /** * Create request for operation 'apiAppUpdate' * - * @param string $client_id The client id of the API App to update. (required) - * @param Model\ApiAppUpdateRequest $api_app_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation + * @param string $client_id The client id of the API App to update. (required) + * @param Model\ApiAppUpdateRequest $api_app_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::apiAppUpdate. This method will eventually become unavailable */ - public function apiAppUpdateRequest(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) + public function apiAppUpdateRequest($client_id, $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) { + // verify the required parameter 'client_id' is set if ($client_id === null || (is_array($client_id) && count($client_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $client_id when calling apiAppUpdate' ); } // verify the required parameter 'api_app_update_request' is set if ($api_app_update_request === null || (is_array($api_app_update_request) && count($api_app_update_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $api_app_update_request when calling apiAppUpdate' ); } + $resourcePath = '/api_app/{client_id}'; $formParams = []; $queryParams = []; @@ -1670,17 +1725,19 @@ public function apiAppUpdateRequest(string $client_id, Model\ApiAppUpdateRequest $multipart = !empty($formParams); + // path params if ($client_id !== null) { $resourcePath = str_replace( - '{client_id}', + '{' . 'client_id' . '}', ObjectSerializer::toPathValue($client_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1688,7 +1745,7 @@ public function apiAppUpdateRequest(string $client_id, Model\ApiAppUpdateRequest // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($api_app_update_request)); } else { $httpBody = $api_app_update_request; @@ -1701,7 +1758,7 @@ public function apiAppUpdateRequest(string $client_id, Model\ApiAppUpdateRequest foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1718,8 +1775,9 @@ public function apiAppUpdateRequest(string $client_id, Model\ApiAppUpdateRequest $payloadHook('multipart', $multipartContents, $api_app_update_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1760,8 +1818,8 @@ public function apiAppUpdateRequest(string $client_id, Model\ApiAppUpdateRequest /** * Create http client option * + * @throws \RuntimeException on file opening failure * @return array of http client options - * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -1769,7 +1827,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -1785,8 +1843,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -1796,9 +1854,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); } return [ @@ -1817,8 +1875,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/BulkSendJobApi.php b/sdks/php/src/Api/BulkSendJobApi.php index 77ad055c7..24cd0689c 100644 --- a/sdks/php/src/Api/BulkSendJobApi.php +++ b/sdks/php/src/Api/BulkSendJobApi.php @@ -1,10 +1,13 @@ [ 'application/json', @@ -79,12 +87,15 @@ class BulkSendJobApi protected $response; /** - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param Configuration $config + * @param ClientInterface $client + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - Configuration $config = null, - ClientInterface $client = null, - HeaderSelector $selector = null, + ?Configuration $config = null, + ?ClientInterface $client = null, + ?HeaderSelector $selector = null, int $hostIndex = 0 ) { $this->client = $client ?: new Client(); @@ -99,7 +110,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex(int $hostIndex): void + public function setHostIndex($hostIndex): void { $this->hostIndex = $hostIndex; } @@ -136,15 +147,15 @@ public function getResponse() * * Get Bulk Send Job * - * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) - * @param int $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) + * @param int|null $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) * - * @return Model\BulkSendJobGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\BulkSendJobGetResponse */ - public function bulkSendJobGet(string $bulk_send_job_id, int $page = 1, int $page_size = 20) + public function bulkSendJobGet($bulk_send_job_id, $page = 1, $page_size = 20) { list($response) = $this->bulkSendJobGetWithHttpInfo($bulk_send_job_id, $page, $page_size); return $response; @@ -155,17 +166,17 @@ public function bulkSendJobGet(string $bulk_send_job_id, int $page = 1, int $pag * * Get Bulk Send Job * - * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) - * @param int $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation + * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) + * @param int|null $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation * - * @return array of Model\BulkSendJobGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\BulkSendJobGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::bulkSendJobGet. This method will eventually become unavailable */ - public function bulkSendJobGetWithHttpInfo(string $bulk_send_job_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) + public function bulkSendJobGetWithHttpInfo($bulk_send_job_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) { $request = $this->bulkSendJobGetRequest($bulk_send_job_id, $page, $page_size, $contentType); @@ -177,14 +188,14 @@ public function bulkSendJobGetWithHttpInfo(string $bulk_send_job_id, int $page = } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -192,18 +203,6 @@ public function bulkSendJobGetWithHttpInfo(string $bulk_send_job_id, int $page = $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -214,16 +213,17 @@ public function bulkSendJobGetWithHttpInfo(string $bulk_send_job_id, int $page = return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\BulkSendJobGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\BulkSendJobGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -240,19 +240,33 @@ public function bulkSendJobGetWithHttpInfo(string $bulk_send_job_id, int $page = return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\BulkSendJobGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\BulkSendJobGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -269,9 +283,11 @@ public function bulkSendJobGetWithHttpInfo(string $bulk_send_job_id, int $page = return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -284,6 +300,7 @@ public function bulkSendJobGetWithHttpInfo(string $bulk_send_job_id, int $page = ); $e->setResponseObject($data); break; + } throw $e; } @@ -294,16 +311,16 @@ public function bulkSendJobGetWithHttpInfo(string $bulk_send_job_id, int $page = * * Get Bulk Send Job * - * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) - * @param int $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation + * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) + * @param int|null $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::bulkSendJobGet. This method will eventually become unavailable */ - public function bulkSendJobGetAsync(string $bulk_send_job_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) + public function bulkSendJobGetAsync($bulk_send_job_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) { return $this->bulkSendJobGetAsyncWithHttpInfo($bulk_send_job_id, $page, $page_size, $contentType) ->then( @@ -318,16 +335,16 @@ function ($response) { * * Get Bulk Send Job * - * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) - * @param int $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation + * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) + * @param int|null $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::bulkSendJobGet. This method will eventually become unavailable */ - public function bulkSendJobGetAsyncWithHttpInfo(string $bulk_send_job_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) + public function bulkSendJobGetAsyncWithHttpInfo($bulk_send_job_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) { $returnType = '\Dropbox\Sign\Model\BulkSendJobGetResponse'; $request = $this->bulkSendJobGetRequest($bulk_send_job_id, $page, $page_size, $contentType); @@ -337,9 +354,9 @@ public function bulkSendJobGetAsyncWithHttpInfo(string $bulk_send_job_id, int $p ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -348,7 +365,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -362,7 +379,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -371,24 +388,28 @@ function ($exception) { /** * Create request for operation 'bulkSendJobGet' * - * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) - * @param int $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation + * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) + * @param int|null $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::bulkSendJobGet. This method will eventually become unavailable */ - public function bulkSendJobGetRequest(string $bulk_send_job_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) + public function bulkSendJobGetRequest($bulk_send_job_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) { + // verify the required parameter 'bulk_send_job_id' is set if ($bulk_send_job_id === null || (is_array($bulk_send_job_id) && count($bulk_send_job_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $bulk_send_job_id when calling bulkSendJobGet' ); } + + + $resourcePath = '/bulk_send_job/{bulk_send_job_id}'; $formParams = []; $queryParams = []; @@ -415,17 +436,19 @@ public function bulkSendJobGetRequest(string $bulk_send_job_id, int $page = 1, i false // required ) ?? []); + // path params if ($bulk_send_job_id !== null) { $resourcePath = str_replace( - '{bulk_send_job_id}', + '{' . 'bulk_send_job_id' . '}', ObjectSerializer::toPathValue($bulk_send_job_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -439,7 +462,7 @@ public function bulkSendJobGetRequest(string $bulk_send_job_id, int $page = 1, i foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -453,8 +476,9 @@ public function bulkSendJobGetRequest(string $bulk_send_job_id, int $page = 1, i } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -497,14 +521,14 @@ public function bulkSendJobGetRequest(string $bulk_send_job_id, int $page = 1, i * * List Bulk Send Jobs * - * @param int $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param int|null $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) * - * @return Model\BulkSendJobListResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\BulkSendJobListResponse */ - public function bulkSendJobList(int $page = 1, int $page_size = 20) + public function bulkSendJobList($page = 1, $page_size = 20) { list($response) = $this->bulkSendJobListWithHttpInfo($page, $page_size); return $response; @@ -515,16 +539,16 @@ public function bulkSendJobList(int $page = 1, int $page_size = 20) * * List Bulk Send Jobs * - * @param int $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation + * @param int|null $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation * - * @return array of Model\BulkSendJobListResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\BulkSendJobListResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::bulkSendJobList. This method will eventually become unavailable */ - public function bulkSendJobListWithHttpInfo(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) + public function bulkSendJobListWithHttpInfo($page = 1, $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) { $request = $this->bulkSendJobListRequest($page, $page_size, $contentType); @@ -536,14 +560,14 @@ public function bulkSendJobListWithHttpInfo(int $page = 1, int $page_size = 20, } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -551,18 +575,6 @@ public function bulkSendJobListWithHttpInfo(int $page = 1, int $page_size = 20, $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -573,16 +585,17 @@ public function bulkSendJobListWithHttpInfo(int $page = 1, int $page_size = 20, return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\BulkSendJobListResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\BulkSendJobListResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -599,19 +612,33 @@ public function bulkSendJobListWithHttpInfo(int $page = 1, int $page_size = 20, return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\BulkSendJobListResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\BulkSendJobListResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -628,9 +655,11 @@ public function bulkSendJobListWithHttpInfo(int $page = 1, int $page_size = 20, return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -643,6 +672,7 @@ public function bulkSendJobListWithHttpInfo(int $page = 1, int $page_size = 20, ); $e->setResponseObject($data); break; + } throw $e; } @@ -653,15 +683,15 @@ public function bulkSendJobListWithHttpInfo(int $page = 1, int $page_size = 20, * * List Bulk Send Jobs * - * @param int $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation + * @param int|null $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::bulkSendJobList. This method will eventually become unavailable */ - public function bulkSendJobListAsync(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) + public function bulkSendJobListAsync($page = 1, $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) { return $this->bulkSendJobListAsyncWithHttpInfo($page, $page_size, $contentType) ->then( @@ -676,15 +706,15 @@ function ($response) { * * List Bulk Send Jobs * - * @param int $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation + * @param int|null $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::bulkSendJobList. This method will eventually become unavailable */ - public function bulkSendJobListAsyncWithHttpInfo(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) + public function bulkSendJobListAsyncWithHttpInfo($page = 1, $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) { $returnType = '\Dropbox\Sign\Model\BulkSendJobListResponse'; $request = $this->bulkSendJobListRequest($page, $page_size, $contentType); @@ -694,9 +724,9 @@ public function bulkSendJobListAsyncWithHttpInfo(int $page = 1, int $page_size = ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -705,7 +735,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -719,7 +749,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -728,16 +758,20 @@ function ($exception) { /** * Create request for operation 'bulkSendJobList' * - * @param int $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation + * @param int|null $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::bulkSendJobList. This method will eventually become unavailable */ - public function bulkSendJobListRequest(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) + public function bulkSendJobListRequest($page = 1, $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) { + + + + $resourcePath = '/bulk_send_job/list'; $formParams = []; $queryParams = []; @@ -764,8 +798,11 @@ public function bulkSendJobListRequest(int $page = 1, int $page_size = 20, strin false // required ) ?? []); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -779,7 +816,7 @@ public function bulkSendJobListRequest(int $page = 1, int $page_size = 20, strin foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -793,8 +830,9 @@ public function bulkSendJobListRequest(int $page = 1, int $page_size = 20, strin } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -835,8 +873,8 @@ public function bulkSendJobListRequest(int $page = 1, int $page_size = 20, strin /** * Create http client option * + * @throws \RuntimeException on file opening failure * @return array of http client options - * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -844,7 +882,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -860,8 +898,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -871,9 +909,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); } return [ @@ -892,8 +930,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/EmbeddedApi.php b/sdks/php/src/Api/EmbeddedApi.php index 364e5f7e7..94cf2ee3f 100644 --- a/sdks/php/src/Api/EmbeddedApi.php +++ b/sdks/php/src/Api/EmbeddedApi.php @@ -1,10 +1,13 @@ [ 'application/json', @@ -79,12 +87,15 @@ class EmbeddedApi protected $response; /** - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param Configuration $config + * @param ClientInterface $client + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - Configuration $config = null, - ClientInterface $client = null, - HeaderSelector $selector = null, + ?Configuration $config = null, + ?ClientInterface $client = null, + ?HeaderSelector $selector = null, int $hostIndex = 0 ) { $this->client = $client ?: new Client(); @@ -99,7 +110,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex(int $hostIndex): void + public function setHostIndex($hostIndex): void { $this->hostIndex = $hostIndex; } @@ -136,14 +147,14 @@ public function getResponse() * * Get Embedded Template Edit URL * - * @param string $template_id The id of the template to edit. (required) - * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request embedded_edit_url_request (required) + * @param string $template_id The id of the template to edit. (required) + * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request embedded_edit_url_request (required) * - * @return Model\EmbeddedEditUrlResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\EmbeddedEditUrlResponse */ - public function embeddedEditUrl(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request) + public function embeddedEditUrl($template_id, $embedded_edit_url_request) { list($response) = $this->embeddedEditUrlWithHttpInfo($template_id, $embedded_edit_url_request); return $response; @@ -154,16 +165,16 @@ public function embeddedEditUrl(string $template_id, Model\EmbeddedEditUrlReques * * Get Embedded Template Edit URL * - * @param string $template_id The id of the template to edit. (required) - * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation + * @param string $template_id The id of the template to edit. (required) + * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation * - * @return array of Model\EmbeddedEditUrlResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\EmbeddedEditUrlResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::embeddedEditUrl. This method will eventually become unavailable */ - public function embeddedEditUrlWithHttpInfo(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) + public function embeddedEditUrlWithHttpInfo($template_id, $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) { $request = $this->embeddedEditUrlRequest($template_id, $embedded_edit_url_request, $contentType); @@ -175,14 +186,14 @@ public function embeddedEditUrlWithHttpInfo(string $template_id, Model\EmbeddedE } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -190,18 +201,6 @@ public function embeddedEditUrlWithHttpInfo(string $template_id, Model\EmbeddedE $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -212,16 +211,17 @@ public function embeddedEditUrlWithHttpInfo(string $template_id, Model\EmbeddedE return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\EmbeddedEditUrlResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\EmbeddedEditUrlResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -238,19 +238,33 @@ public function embeddedEditUrlWithHttpInfo(string $template_id, Model\EmbeddedE return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\EmbeddedEditUrlResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\EmbeddedEditUrlResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -267,9 +281,11 @@ public function embeddedEditUrlWithHttpInfo(string $template_id, Model\EmbeddedE return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -282,6 +298,7 @@ public function embeddedEditUrlWithHttpInfo(string $template_id, Model\EmbeddedE ); $e->setResponseObject($data); break; + } throw $e; } @@ -292,15 +309,15 @@ public function embeddedEditUrlWithHttpInfo(string $template_id, Model\EmbeddedE * * Get Embedded Template Edit URL * - * @param string $template_id The id of the template to edit. (required) - * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation + * @param string $template_id The id of the template to edit. (required) + * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::embeddedEditUrl. This method will eventually become unavailable */ - public function embeddedEditUrlAsync(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) + public function embeddedEditUrlAsync($template_id, $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) { return $this->embeddedEditUrlAsyncWithHttpInfo($template_id, $embedded_edit_url_request, $contentType) ->then( @@ -315,15 +332,15 @@ function ($response) { * * Get Embedded Template Edit URL * - * @param string $template_id The id of the template to edit. (required) - * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation + * @param string $template_id The id of the template to edit. (required) + * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::embeddedEditUrl. This method will eventually become unavailable */ - public function embeddedEditUrlAsyncWithHttpInfo(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) + public function embeddedEditUrlAsyncWithHttpInfo($template_id, $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) { $returnType = '\Dropbox\Sign\Model\EmbeddedEditUrlResponse'; $request = $this->embeddedEditUrlRequest($template_id, $embedded_edit_url_request, $contentType); @@ -333,9 +350,9 @@ public function embeddedEditUrlAsyncWithHttpInfo(string $template_id, Model\Embe ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -344,7 +361,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -358,7 +375,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -367,30 +384,32 @@ function ($exception) { /** * Create request for operation 'embeddedEditUrl' * - * @param string $template_id The id of the template to edit. (required) - * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation + * @param string $template_id The id of the template to edit. (required) + * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::embeddedEditUrl. This method will eventually become unavailable */ - public function embeddedEditUrlRequest(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) + public function embeddedEditUrlRequest($template_id, $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) { + // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $template_id when calling embeddedEditUrl' ); } // verify the required parameter 'embedded_edit_url_request' is set if ($embedded_edit_url_request === null || (is_array($embedded_edit_url_request) && count($embedded_edit_url_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $embedded_edit_url_request when calling embeddedEditUrl' ); } + $resourcePath = '/embedded/edit_url/{template_id}'; $formParams = []; $queryParams = []; @@ -404,17 +423,19 @@ public function embeddedEditUrlRequest(string $template_id, Model\EmbeddedEditUr $multipart = !empty($formParams); + // path params if ($template_id !== null) { $resourcePath = str_replace( - '{template_id}', + '{' . 'template_id' . '}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -422,7 +443,7 @@ public function embeddedEditUrlRequest(string $template_id, Model\EmbeddedEditUr // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($embedded_edit_url_request)); } else { $httpBody = $embedded_edit_url_request; @@ -435,7 +456,7 @@ public function embeddedEditUrlRequest(string $template_id, Model\EmbeddedEditUr foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -452,8 +473,9 @@ public function embeddedEditUrlRequest(string $template_id, Model\EmbeddedEditUr $payloadHook('multipart', $multipartContents, $embedded_edit_url_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -496,13 +518,13 @@ public function embeddedEditUrlRequest(string $template_id, Model\EmbeddedEditUr * * Get Embedded Sign URL * - * @param string $signature_id The id of the signature to get a signature url for. (required) + * @param string $signature_id The id of the signature to get a signature url for. (required) * - * @return Model\EmbeddedSignUrlResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\EmbeddedSignUrlResponse */ - public function embeddedSignUrl(string $signature_id) + public function embeddedSignUrl($signature_id) { list($response) = $this->embeddedSignUrlWithHttpInfo($signature_id); return $response; @@ -513,15 +535,15 @@ public function embeddedSignUrl(string $signature_id) * * Get Embedded Sign URL * - * @param string $signature_id The id of the signature to get a signature url for. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation + * @param string $signature_id The id of the signature to get a signature url for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation * - * @return array of Model\EmbeddedSignUrlResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\EmbeddedSignUrlResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::embeddedSignUrl. This method will eventually become unavailable */ - public function embeddedSignUrlWithHttpInfo(string $signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) + public function embeddedSignUrlWithHttpInfo($signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) { $request = $this->embeddedSignUrlRequest($signature_id, $contentType); @@ -533,14 +555,14 @@ public function embeddedSignUrlWithHttpInfo(string $signature_id, string $conten } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -548,18 +570,6 @@ public function embeddedSignUrlWithHttpInfo(string $signature_id, string $conten $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -570,16 +580,17 @@ public function embeddedSignUrlWithHttpInfo(string $signature_id, string $conten return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\EmbeddedSignUrlResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\EmbeddedSignUrlResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -596,19 +607,33 @@ public function embeddedSignUrlWithHttpInfo(string $signature_id, string $conten return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\EmbeddedSignUrlResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\EmbeddedSignUrlResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -625,9 +650,11 @@ public function embeddedSignUrlWithHttpInfo(string $signature_id, string $conten return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -640,6 +667,7 @@ public function embeddedSignUrlWithHttpInfo(string $signature_id, string $conten ); $e->setResponseObject($data); break; + } throw $e; } @@ -650,14 +678,14 @@ public function embeddedSignUrlWithHttpInfo(string $signature_id, string $conten * * Get Embedded Sign URL * - * @param string $signature_id The id of the signature to get a signature url for. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation + * @param string $signature_id The id of the signature to get a signature url for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::embeddedSignUrl. This method will eventually become unavailable */ - public function embeddedSignUrlAsync(string $signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) + public function embeddedSignUrlAsync($signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) { return $this->embeddedSignUrlAsyncWithHttpInfo($signature_id, $contentType) ->then( @@ -672,14 +700,14 @@ function ($response) { * * Get Embedded Sign URL * - * @param string $signature_id The id of the signature to get a signature url for. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation + * @param string $signature_id The id of the signature to get a signature url for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::embeddedSignUrl. This method will eventually become unavailable */ - public function embeddedSignUrlAsyncWithHttpInfo(string $signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) + public function embeddedSignUrlAsyncWithHttpInfo($signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) { $returnType = '\Dropbox\Sign\Model\EmbeddedSignUrlResponse'; $request = $this->embeddedSignUrlRequest($signature_id, $contentType); @@ -689,9 +717,9 @@ public function embeddedSignUrlAsyncWithHttpInfo(string $signature_id, string $c ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -700,7 +728,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -714,7 +742,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -723,22 +751,24 @@ function ($exception) { /** * Create request for operation 'embeddedSignUrl' * - * @param string $signature_id The id of the signature to get a signature url for. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation + * @param string $signature_id The id of the signature to get a signature url for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::embeddedSignUrl. This method will eventually become unavailable */ - public function embeddedSignUrlRequest(string $signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) + public function embeddedSignUrlRequest($signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) { + // verify the required parameter 'signature_id' is set if ($signature_id === null || (is_array($signature_id) && count($signature_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_id when calling embeddedSignUrl' ); } + $resourcePath = '/embedded/sign_url/{signature_id}'; $formParams = []; $queryParams = []; @@ -746,17 +776,20 @@ public function embeddedSignUrlRequest(string $signature_id, string $contentType $httpBody = ''; $multipart = false; + + // path params if ($signature_id !== null) { $resourcePath = str_replace( - '{signature_id}', + '{' . 'signature_id' . '}', ObjectSerializer::toPathValue($signature_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -770,7 +803,7 @@ public function embeddedSignUrlRequest(string $signature_id, string $contentType foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -784,8 +817,9 @@ public function embeddedSignUrlRequest(string $signature_id, string $contentType } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -826,8 +860,8 @@ public function embeddedSignUrlRequest(string $signature_id, string $contentType /** * Create http client option * + * @throws \RuntimeException on file opening failure * @return array of http client options - * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -835,7 +869,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -851,8 +885,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -862,9 +896,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); } return [ @@ -883,8 +917,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/FaxApi.php b/sdks/php/src/Api/FaxApi.php index 2669fedbc..1b3c6f718 100644 --- a/sdks/php/src/Api/FaxApi.php +++ b/sdks/php/src/Api/FaxApi.php @@ -1,10 +1,13 @@ [ 'application/json', @@ -90,12 +97,15 @@ class FaxApi protected $response; /** - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param Configuration $config + * @param ClientInterface $client + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - Configuration $config = null, - ClientInterface $client = null, - HeaderSelector $selector = null, + ?Configuration $config = null, + ?ClientInterface $client = null, + ?HeaderSelector $selector = null, int $hostIndex = 0 ) { $this->client = $client ?: new Client(); @@ -110,7 +120,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex(int $hostIndex): void + public function setHostIndex($hostIndex): void { $this->hostIndex = $hostIndex; } @@ -147,12 +157,13 @@ public function getResponse() * * Delete Fax * - * @param string $fax_id Fax ID (required) + * @param string $fax_id Fax ID (required) * * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return void */ - public function faxDelete(string $fax_id) + public function faxDelete($fax_id) { $this->faxDeleteWithHttpInfo($fax_id); } @@ -162,15 +173,15 @@ public function faxDelete(string $fax_id) * * Delete Fax * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] to see the possible values for this operation * - * @return array of null, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::faxDelete. This method will eventually become unavailable */ - public function faxDeleteWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxDelete'][0]) + public function faxDeleteWithHttpInfo($fax_id, string $contentType = self::contentTypes['faxDelete'][0]) { $request = $this->faxDeleteRequest($fax_id, $contentType); @@ -182,14 +193,14 @@ public function faxDeleteWithHttpInfo(string $fax_id, string $contentType = self } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -197,25 +208,16 @@ public function faxDeleteWithHttpInfo(string $fax_id, string $contentType = self $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() - ); - } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } switch ($e->getCode()) { + } throw $e; } @@ -226,14 +228,14 @@ public function faxDeleteWithHttpInfo(string $fax_id, string $contentType = self * * Delete Fax * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxDelete. This method will eventually become unavailable */ - public function faxDeleteAsync(string $fax_id, string $contentType = self::contentTypes['faxDelete'][0]) + public function faxDeleteAsync($fax_id, string $contentType = self::contentTypes['faxDelete'][0]) { return $this->faxDeleteAsyncWithHttpInfo($fax_id, $contentType) ->then( @@ -248,14 +250,14 @@ function ($response) { * * Delete Fax * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxDelete. This method will eventually become unavailable */ - public function faxDeleteAsyncWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxDelete'][0]) + public function faxDeleteAsyncWithHttpInfo($fax_id, string $contentType = self::contentTypes['faxDelete'][0]) { $returnType = ''; $request = $this->faxDeleteRequest($fax_id, $contentType); @@ -263,7 +265,7 @@ public function faxDeleteAsyncWithHttpInfo(string $fax_id, string $contentType = return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( - function ($response) { + function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { @@ -277,7 +279,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -286,22 +288,24 @@ function ($exception) { /** * Create request for operation 'faxDelete' * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::faxDelete. This method will eventually become unavailable */ - public function faxDeleteRequest(string $fax_id, string $contentType = self::contentTypes['faxDelete'][0]) + public function faxDeleteRequest($fax_id, string $contentType = self::contentTypes['faxDelete'][0]) { + // verify the required parameter 'fax_id' is set if ($fax_id === null || (is_array($fax_id) && count($fax_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $fax_id when calling faxDelete' ); } + $resourcePath = '/fax/{fax_id}'; $formParams = []; $queryParams = []; @@ -309,17 +313,20 @@ public function faxDeleteRequest(string $fax_id, string $contentType = self::con $httpBody = ''; $multipart = false; + + // path params if ($fax_id !== null) { $resourcePath = str_replace( - '{fax_id}', + '{' . 'fax_id' . '}', ObjectSerializer::toPathValue($fax_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -333,7 +340,7 @@ public function faxDeleteRequest(string $fax_id, string $contentType = self::con foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -347,8 +354,9 @@ public function faxDeleteRequest(string $fax_id, string $contentType = self::con } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -387,13 +395,13 @@ public function faxDeleteRequest(string $fax_id, string $contentType = self::con * * Download Fax Files * - * @param string $fax_id Fax ID (required) + * @param string $fax_id Fax ID (required) * - * @return SplFileObject * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \SplFileObject|\Dropbox\Sign\Model\ErrorResponse */ - public function faxFiles(string $fax_id) + public function faxFiles($fax_id) { list($response) = $this->faxFilesWithHttpInfo($fax_id); return $response; @@ -404,15 +412,15 @@ public function faxFiles(string $fax_id) * * Download Fax Files * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] to see the possible values for this operation * - * @return array of \SplFileObject|\Dropbox\Sign\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of \SplFileObject|\Dropbox\Sign\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::faxFiles. This method will eventually become unavailable */ - public function faxFilesWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxFiles'][0]) + public function faxFilesWithHttpInfo($fax_id, string $contentType = self::contentTypes['faxFiles'][0]) { $request = $this->faxFilesRequest($fax_id, $contentType); @@ -424,14 +432,14 @@ public function faxFilesWithHttpInfo(string $fax_id, string $contentType = self: } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -439,18 +447,6 @@ public function faxFilesWithHttpInfo(string $fax_id, string $contentType = self: $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -461,16 +457,17 @@ public function faxFilesWithHttpInfo(string $fax_id, string $contentType = self: return $result; } + switch ($statusCode) { case 200: if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\SplFileObject' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -487,19 +484,33 @@ public function faxFilesWithHttpInfo(string $fax_id, string $contentType = self: return [ ObjectSerializer::deserialize($content, '\SplFileObject', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\SplFileObject'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -516,9 +527,11 @@ public function faxFilesWithHttpInfo(string $fax_id, string $contentType = self: return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -531,6 +544,7 @@ public function faxFilesWithHttpInfo(string $fax_id, string $contentType = self: ); $e->setResponseObject($data); break; + } throw $e; } @@ -541,14 +555,14 @@ public function faxFilesWithHttpInfo(string $fax_id, string $contentType = self: * * Download Fax Files * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxFiles. This method will eventually become unavailable */ - public function faxFilesAsync(string $fax_id, string $contentType = self::contentTypes['faxFiles'][0]) + public function faxFilesAsync($fax_id, string $contentType = self::contentTypes['faxFiles'][0]) { return $this->faxFilesAsyncWithHttpInfo($fax_id, $contentType) ->then( @@ -563,14 +577,14 @@ function ($response) { * * Download Fax Files * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxFiles. This method will eventually become unavailable */ - public function faxFilesAsyncWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxFiles'][0]) + public function faxFilesAsyncWithHttpInfo($fax_id, string $contentType = self::contentTypes['faxFiles'][0]) { $returnType = '\SplFileObject'; $request = $this->faxFilesRequest($fax_id, $contentType); @@ -580,9 +594,9 @@ public function faxFilesAsyncWithHttpInfo(string $fax_id, string $contentType = ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -591,7 +605,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -605,7 +619,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -614,22 +628,24 @@ function ($exception) { /** * Create request for operation 'faxFiles' * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::faxFiles. This method will eventually become unavailable */ - public function faxFilesRequest(string $fax_id, string $contentType = self::contentTypes['faxFiles'][0]) + public function faxFilesRequest($fax_id, string $contentType = self::contentTypes['faxFiles'][0]) { + // verify the required parameter 'fax_id' is set if ($fax_id === null || (is_array($fax_id) && count($fax_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $fax_id when calling faxFiles' ); } + $resourcePath = '/fax/files/{fax_id}'; $formParams = []; $queryParams = []; @@ -637,17 +653,20 @@ public function faxFilesRequest(string $fax_id, string $contentType = self::cont $httpBody = ''; $multipart = false; + + // path params if ($fax_id !== null) { $resourcePath = str_replace( - '{fax_id}', + '{' . 'fax_id' . '}', ObjectSerializer::toPathValue($fax_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/pdf', 'application/json'], + $multipart ? ['multipart/form-data'] : ['application/pdf', 'application/json', ], $contentType, $multipart ); @@ -661,7 +680,7 @@ public function faxFilesRequest(string $fax_id, string $contentType = self::cont foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -675,8 +694,9 @@ public function faxFilesRequest(string $fax_id, string $contentType = self::cont } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -715,13 +735,13 @@ public function faxFilesRequest(string $fax_id, string $contentType = self::cont * * Get Fax * - * @param string $fax_id Fax ID (required) + * @param string $fax_id Fax ID (required) * - * @return Model\FaxGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\FaxGetResponse */ - public function faxGet(string $fax_id) + public function faxGet($fax_id) { list($response) = $this->faxGetWithHttpInfo($fax_id); return $response; @@ -732,15 +752,15 @@ public function faxGet(string $fax_id) * * Get Fax * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] to see the possible values for this operation * - * @return array of Model\FaxGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\FaxGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::faxGet. This method will eventually become unavailable */ - public function faxGetWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxGet'][0]) + public function faxGetWithHttpInfo($fax_id, string $contentType = self::contentTypes['faxGet'][0]) { $request = $this->faxGetRequest($fax_id, $contentType); @@ -752,14 +772,14 @@ public function faxGetWithHttpInfo(string $fax_id, string $contentType = self::c } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -767,18 +787,6 @@ public function faxGetWithHttpInfo(string $fax_id, string $contentType = self::c $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -789,16 +797,17 @@ public function faxGetWithHttpInfo(string $fax_id, string $contentType = self::c return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FaxGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\FaxGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -815,19 +824,33 @@ public function faxGetWithHttpInfo(string $fax_id, string $contentType = self::c return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\FaxGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -844,9 +867,11 @@ public function faxGetWithHttpInfo(string $fax_id, string $contentType = self::c return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -859,6 +884,7 @@ public function faxGetWithHttpInfo(string $fax_id, string $contentType = self::c ); $e->setResponseObject($data); break; + } throw $e; } @@ -869,14 +895,14 @@ public function faxGetWithHttpInfo(string $fax_id, string $contentType = self::c * * Get Fax * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxGet. This method will eventually become unavailable */ - public function faxGetAsync(string $fax_id, string $contentType = self::contentTypes['faxGet'][0]) + public function faxGetAsync($fax_id, string $contentType = self::contentTypes['faxGet'][0]) { return $this->faxGetAsyncWithHttpInfo($fax_id, $contentType) ->then( @@ -891,14 +917,14 @@ function ($response) { * * Get Fax * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxGet. This method will eventually become unavailable */ - public function faxGetAsyncWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxGet'][0]) + public function faxGetAsyncWithHttpInfo($fax_id, string $contentType = self::contentTypes['faxGet'][0]) { $returnType = '\Dropbox\Sign\Model\FaxGetResponse'; $request = $this->faxGetRequest($fax_id, $contentType); @@ -908,9 +934,9 @@ public function faxGetAsyncWithHttpInfo(string $fax_id, string $contentType = se ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -919,7 +945,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -933,7 +959,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -942,22 +968,24 @@ function ($exception) { /** * Create request for operation 'faxGet' * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::faxGet. This method will eventually become unavailable */ - public function faxGetRequest(string $fax_id, string $contentType = self::contentTypes['faxGet'][0]) + public function faxGetRequest($fax_id, string $contentType = self::contentTypes['faxGet'][0]) { + // verify the required parameter 'fax_id' is set if ($fax_id === null || (is_array($fax_id) && count($fax_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $fax_id when calling faxGet' ); } + $resourcePath = '/fax/{fax_id}'; $formParams = []; $queryParams = []; @@ -965,17 +993,20 @@ public function faxGetRequest(string $fax_id, string $contentType = self::conten $httpBody = ''; $multipart = false; + + // path params if ($fax_id !== null) { $resourcePath = str_replace( - '{fax_id}', + '{' . 'fax_id' . '}', ObjectSerializer::toPathValue($fax_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -989,7 +1020,7 @@ public function faxGetRequest(string $fax_id, string $contentType = self::conten foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1003,8 +1034,9 @@ public function faxGetRequest(string $fax_id, string $contentType = self::conten } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1043,14 +1075,14 @@ public function faxGetRequest(string $fax_id, string $contentType = self::conten * * Lists Faxes * - * @param int $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param int|null $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) * - * @return Model\FaxListResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\FaxListResponse */ - public function faxList(int $page = 1, int $page_size = 20) + public function faxList($page = 1, $page_size = 20) { list($response) = $this->faxListWithHttpInfo($page, $page_size); return $response; @@ -1061,16 +1093,16 @@ public function faxList(int $page = 1, int $page_size = 20) * * Lists Faxes * - * @param int $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] to see the possible values for this operation + * @param int|null $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] to see the possible values for this operation * - * @return array of Model\FaxListResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\FaxListResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::faxList. This method will eventually become unavailable */ - public function faxListWithHttpInfo(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) + public function faxListWithHttpInfo($page = 1, $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) { $request = $this->faxListRequest($page, $page_size, $contentType); @@ -1082,14 +1114,14 @@ public function faxListWithHttpInfo(int $page = 1, int $page_size = 20, string $ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -1097,18 +1129,6 @@ public function faxListWithHttpInfo(int $page = 1, int $page_size = 20, string $ $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -1119,16 +1139,17 @@ public function faxListWithHttpInfo(int $page = 1, int $page_size = 20, string $ return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FaxListResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\FaxListResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1145,19 +1166,33 @@ public function faxListWithHttpInfo(int $page = 1, int $page_size = 20, string $ return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxListResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\FaxListResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1174,9 +1209,11 @@ public function faxListWithHttpInfo(int $page = 1, int $page_size = 20, string $ return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1189,6 +1226,7 @@ public function faxListWithHttpInfo(int $page = 1, int $page_size = 20, string $ ); $e->setResponseObject($data); break; + } throw $e; } @@ -1199,15 +1237,15 @@ public function faxListWithHttpInfo(int $page = 1, int $page_size = 20, string $ * * Lists Faxes * - * @param int $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] to see the possible values for this operation + * @param int|null $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxList. This method will eventually become unavailable */ - public function faxListAsync(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) + public function faxListAsync($page = 1, $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) { return $this->faxListAsyncWithHttpInfo($page, $page_size, $contentType) ->then( @@ -1222,15 +1260,15 @@ function ($response) { * * Lists Faxes * - * @param int $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] to see the possible values for this operation + * @param int|null $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxList. This method will eventually become unavailable */ - public function faxListAsyncWithHttpInfo(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) + public function faxListAsyncWithHttpInfo($page = 1, $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) { $returnType = '\Dropbox\Sign\Model\FaxListResponse'; $request = $this->faxListRequest($page, $page_size, $contentType); @@ -1240,9 +1278,9 @@ public function faxListAsyncWithHttpInfo(int $page = 1, int $page_size = 20, str ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1251,7 +1289,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -1265,7 +1303,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1274,27 +1312,29 @@ function ($exception) { /** * Create request for operation 'faxList' * - * @param int $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] to see the possible values for this operation + * @param int|null $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::faxList. This method will eventually become unavailable */ - public function faxListRequest(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) + public function faxListRequest($page = 1, $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) { + if ($page !== null && $page < 1) { - throw new InvalidArgumentException('invalid value for "$page" when calling FaxApi.faxList, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$page" when calling FaxApi.faxList, must be bigger than or equal to 1.'); } if ($page_size !== null && $page_size > 100) { - throw new InvalidArgumentException('invalid value for "$page_size" when calling FaxApi.faxList, must be smaller than or equal to 100.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling FaxApi.faxList, must be smaller than or equal to 100.'); } if ($page_size !== null && $page_size < 1) { - throw new InvalidArgumentException('invalid value for "$page_size" when calling FaxApi.faxList, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling FaxApi.faxList, must be bigger than or equal to 1.'); } + $resourcePath = '/fax/list'; $formParams = []; $queryParams = []; @@ -1321,8 +1361,11 @@ public function faxListRequest(int $page = 1, int $page_size = 20, string $conte false // required ) ?? []); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1336,7 +1379,7 @@ public function faxListRequest(int $page = 1, int $page_size = 20, string $conte foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1350,8 +1393,9 @@ public function faxListRequest(int $page = 1, int $page_size = 20, string $conte } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1390,13 +1434,13 @@ public function faxListRequest(int $page = 1, int $page_size = 20, string $conte * * Send Fax * - * @param Model\FaxSendRequest $fax_send_request fax_send_request (required) + * @param Model\FaxSendRequest $fax_send_request fax_send_request (required) * - * @return Model\FaxGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\FaxGetResponse */ - public function faxSend(Model\FaxSendRequest $fax_send_request) + public function faxSend($fax_send_request) { list($response) = $this->faxSendWithHttpInfo($fax_send_request); return $response; @@ -1407,15 +1451,15 @@ public function faxSend(Model\FaxSendRequest $fax_send_request) * * Send Fax * - * @param Model\FaxSendRequest $fax_send_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] to see the possible values for this operation + * @param Model\FaxSendRequest $fax_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] to see the possible values for this operation * - * @return array of Model\FaxGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\FaxGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::faxSend. This method will eventually become unavailable */ - public function faxSendWithHttpInfo(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) + public function faxSendWithHttpInfo($fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) { $request = $this->faxSendRequest($fax_send_request, $contentType); @@ -1427,14 +1471,14 @@ public function faxSendWithHttpInfo(Model\FaxSendRequest $fax_send_request, stri } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -1442,18 +1486,6 @@ public function faxSendWithHttpInfo(Model\FaxSendRequest $fax_send_request, stri $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -1464,16 +1496,17 @@ public function faxSendWithHttpInfo(Model\FaxSendRequest $fax_send_request, stri return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FaxGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\FaxGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1490,19 +1523,33 @@ public function faxSendWithHttpInfo(Model\FaxSendRequest $fax_send_request, stri return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\FaxGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1519,9 +1566,11 @@ public function faxSendWithHttpInfo(Model\FaxSendRequest $fax_send_request, stri return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1534,6 +1583,7 @@ public function faxSendWithHttpInfo(Model\FaxSendRequest $fax_send_request, stri ); $e->setResponseObject($data); break; + } throw $e; } @@ -1544,14 +1594,14 @@ public function faxSendWithHttpInfo(Model\FaxSendRequest $fax_send_request, stri * * Send Fax * - * @param Model\FaxSendRequest $fax_send_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] to see the possible values for this operation + * @param Model\FaxSendRequest $fax_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxSend. This method will eventually become unavailable */ - public function faxSendAsync(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) + public function faxSendAsync($fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) { return $this->faxSendAsyncWithHttpInfo($fax_send_request, $contentType) ->then( @@ -1566,14 +1616,14 @@ function ($response) { * * Send Fax * - * @param Model\FaxSendRequest $fax_send_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] to see the possible values for this operation + * @param Model\FaxSendRequest $fax_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxSend. This method will eventually become unavailable */ - public function faxSendAsyncWithHttpInfo(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) + public function faxSendAsyncWithHttpInfo($fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) { $returnType = '\Dropbox\Sign\Model\FaxGetResponse'; $request = $this->faxSendRequest($fax_send_request, $contentType); @@ -1583,9 +1633,9 @@ public function faxSendAsyncWithHttpInfo(Model\FaxSendRequest $fax_send_request, ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1594,7 +1644,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -1608,7 +1658,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1617,22 +1667,24 @@ function ($exception) { /** * Create request for operation 'faxSend' * - * @param Model\FaxSendRequest $fax_send_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] to see the possible values for this operation + * @param Model\FaxSendRequest $fax_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::faxSend. This method will eventually become unavailable */ - public function faxSendRequest(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) + public function faxSendRequest($fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) { + // verify the required parameter 'fax_send_request' is set if ($fax_send_request === null || (is_array($fax_send_request) && count($fax_send_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $fax_send_request when calling faxSend' ); } + $resourcePath = '/fax/send'; $formParams = []; $queryParams = []; @@ -1646,8 +1698,11 @@ public function faxSendRequest(Model\FaxSendRequest $fax_send_request, string $c $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1655,7 +1710,7 @@ public function faxSendRequest(Model\FaxSendRequest $fax_send_request, string $c // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($fax_send_request)); } else { $httpBody = $fax_send_request; @@ -1668,7 +1723,7 @@ public function faxSendRequest(Model\FaxSendRequest $fax_send_request, string $c foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1685,8 +1740,9 @@ public function faxSendRequest(Model\FaxSendRequest $fax_send_request, string $c $payloadHook('multipart', $multipartContents, $fax_send_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1723,8 +1779,8 @@ public function faxSendRequest(Model\FaxSendRequest $fax_send_request, string $c /** * Create http client option * + * @throws \RuntimeException on file opening failure * @return array of http client options - * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -1732,7 +1788,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -1748,8 +1804,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -1759,9 +1815,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); } return [ @@ -1780,8 +1836,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/FaxLineApi.php b/sdks/php/src/Api/FaxLineApi.php index baeb810b1..416eb0989 100644 --- a/sdks/php/src/Api/FaxLineApi.php +++ b/sdks/php/src/Api/FaxLineApi.php @@ -1,10 +1,13 @@ [ 'application/json', @@ -94,12 +102,15 @@ class FaxLineApi protected $response; /** - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param Configuration $config + * @param ClientInterface $client + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - Configuration $config = null, - ClientInterface $client = null, - HeaderSelector $selector = null, + ?Configuration $config = null, + ?ClientInterface $client = null, + ?HeaderSelector $selector = null, int $hostIndex = 0 ) { $this->client = $client ?: new Client(); @@ -114,7 +125,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex(int $hostIndex): void + public function setHostIndex($hostIndex): void { $this->hostIndex = $hostIndex; } @@ -151,13 +162,13 @@ public function getResponse() * * Add Fax Line User * - * @param Model\FaxLineAddUserRequest $fax_line_add_user_request fax_line_add_user_request (required) + * @param Model\FaxLineAddUserRequest $fax_line_add_user_request fax_line_add_user_request (required) * - * @return Model\FaxLineResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\FaxLineResponse */ - public function faxLineAddUser(Model\FaxLineAddUserRequest $fax_line_add_user_request) + public function faxLineAddUser($fax_line_add_user_request) { list($response) = $this->faxLineAddUserWithHttpInfo($fax_line_add_user_request); return $response; @@ -168,15 +179,15 @@ public function faxLineAddUser(Model\FaxLineAddUserRequest $fax_line_add_user_re * * Add Fax Line User * - * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation + * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation * - * @return array of Model\FaxLineResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\FaxLineResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::faxLineAddUser. This method will eventually become unavailable */ - public function faxLineAddUserWithHttpInfo(Model\FaxLineAddUserRequest $fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) + public function faxLineAddUserWithHttpInfo($fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) { $request = $this->faxLineAddUserRequest($fax_line_add_user_request, $contentType); @@ -188,14 +199,14 @@ public function faxLineAddUserWithHttpInfo(Model\FaxLineAddUserRequest $fax_line } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -203,18 +214,6 @@ public function faxLineAddUserWithHttpInfo(Model\FaxLineAddUserRequest $fax_line $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -225,16 +224,17 @@ public function faxLineAddUserWithHttpInfo(Model\FaxLineAddUserRequest $fax_line return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FaxLineResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\FaxLineResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -251,19 +251,33 @@ public function faxLineAddUserWithHttpInfo(Model\FaxLineAddUserRequest $fax_line return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxLineResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -280,9 +294,11 @@ public function faxLineAddUserWithHttpInfo(Model\FaxLineAddUserRequest $fax_line return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -295,6 +311,7 @@ public function faxLineAddUserWithHttpInfo(Model\FaxLineAddUserRequest $fax_line ); $e->setResponseObject($data); break; + } throw $e; } @@ -305,14 +322,14 @@ public function faxLineAddUserWithHttpInfo(Model\FaxLineAddUserRequest $fax_line * * Add Fax Line User * - * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation + * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineAddUser. This method will eventually become unavailable */ - public function faxLineAddUserAsync(Model\FaxLineAddUserRequest $fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) + public function faxLineAddUserAsync($fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) { return $this->faxLineAddUserAsyncWithHttpInfo($fax_line_add_user_request, $contentType) ->then( @@ -327,14 +344,14 @@ function ($response) { * * Add Fax Line User * - * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation + * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineAddUser. This method will eventually become unavailable */ - public function faxLineAddUserAsyncWithHttpInfo(Model\FaxLineAddUserRequest $fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) + public function faxLineAddUserAsyncWithHttpInfo($fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) { $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; $request = $this->faxLineAddUserRequest($fax_line_add_user_request, $contentType); @@ -344,9 +361,9 @@ public function faxLineAddUserAsyncWithHttpInfo(Model\FaxLineAddUserRequest $fax ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -355,7 +372,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -369,7 +386,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -378,22 +395,24 @@ function ($exception) { /** * Create request for operation 'faxLineAddUser' * - * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation + * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::faxLineAddUser. This method will eventually become unavailable */ - public function faxLineAddUserRequest(Model\FaxLineAddUserRequest $fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) + public function faxLineAddUserRequest($fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) { + // verify the required parameter 'fax_line_add_user_request' is set if ($fax_line_add_user_request === null || (is_array($fax_line_add_user_request) && count($fax_line_add_user_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $fax_line_add_user_request when calling faxLineAddUser' ); } + $resourcePath = '/fax_line/add_user'; $formParams = []; $queryParams = []; @@ -407,8 +426,11 @@ public function faxLineAddUserRequest(Model\FaxLineAddUserRequest $fax_line_add_ $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -416,7 +438,7 @@ public function faxLineAddUserRequest(Model\FaxLineAddUserRequest $fax_line_add_ // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($fax_line_add_user_request)); } else { $httpBody = $fax_line_add_user_request; @@ -429,7 +451,7 @@ public function faxLineAddUserRequest(Model\FaxLineAddUserRequest $fax_line_add_ foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -446,8 +468,9 @@ public function faxLineAddUserRequest(Model\FaxLineAddUserRequest $fax_line_add_ $payloadHook('multipart', $multipartContents, $fax_line_add_user_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -486,16 +509,16 @@ public function faxLineAddUserRequest(Model\FaxLineAddUserRequest $fax_line_add_ * * Get Available Fax Line Area Codes * - * @param string $country Filter area codes by country (required) - * @param string $state Filter area codes by state (optional) - * @param string $province Filter area codes by province (optional) - * @param string $city Filter area codes by city (optional) + * @param string $country Filter area codes by country (required) + * @param string|null $state Filter area codes by state (optional) + * @param string|null $province Filter area codes by province (optional) + * @param string|null $city Filter area codes by city (optional) * - * @return Model\FaxLineAreaCodeGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\FaxLineAreaCodeGetResponse */ - public function faxLineAreaCodeGet(string $country, string $state = null, string $province = null, string $city = null) + public function faxLineAreaCodeGet($country, $state = null, $province = null, $city = null) { list($response) = $this->faxLineAreaCodeGetWithHttpInfo($country, $state, $province, $city); return $response; @@ -506,18 +529,18 @@ public function faxLineAreaCodeGet(string $country, string $state = null, string * * Get Available Fax Line Area Codes * - * @param string $country Filter area codes by country (required) - * @param string $state Filter area codes by state (optional) - * @param string $province Filter area codes by province (optional) - * @param string $city Filter area codes by city (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation + * @param string $country Filter area codes by country (required) + * @param string|null $state Filter area codes by state (optional) + * @param string|null $province Filter area codes by province (optional) + * @param string|null $city Filter area codes by city (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation * - * @return array of Model\FaxLineAreaCodeGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\FaxLineAreaCodeGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::faxLineAreaCodeGet. This method will eventually become unavailable */ - public function faxLineAreaCodeGetWithHttpInfo(string $country, string $state = null, string $province = null, string $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) + public function faxLineAreaCodeGetWithHttpInfo($country, $state = null, $province = null, $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) { $request = $this->faxLineAreaCodeGetRequest($country, $state, $province, $city, $contentType); @@ -529,14 +552,14 @@ public function faxLineAreaCodeGetWithHttpInfo(string $country, string $state = } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -544,18 +567,6 @@ public function faxLineAreaCodeGetWithHttpInfo(string $country, string $state = $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -566,16 +577,17 @@ public function faxLineAreaCodeGetWithHttpInfo(string $country, string $state = return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FaxLineAreaCodeGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\FaxLineAreaCodeGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -592,19 +604,33 @@ public function faxLineAreaCodeGetWithHttpInfo(string $country, string $state = return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxLineAreaCodeGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\FaxLineAreaCodeGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -621,9 +647,11 @@ public function faxLineAreaCodeGetWithHttpInfo(string $country, string $state = return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -636,6 +664,7 @@ public function faxLineAreaCodeGetWithHttpInfo(string $country, string $state = ); $e->setResponseObject($data); break; + } throw $e; } @@ -646,17 +675,17 @@ public function faxLineAreaCodeGetWithHttpInfo(string $country, string $state = * * Get Available Fax Line Area Codes * - * @param string $country Filter area codes by country (required) - * @param string $state Filter area codes by state (optional) - * @param string $province Filter area codes by province (optional) - * @param string $city Filter area codes by city (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation + * @param string $country Filter area codes by country (required) + * @param string|null $state Filter area codes by state (optional) + * @param string|null $province Filter area codes by province (optional) + * @param string|null $city Filter area codes by city (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineAreaCodeGet. This method will eventually become unavailable */ - public function faxLineAreaCodeGetAsync(string $country, string $state = null, string $province = null, string $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) + public function faxLineAreaCodeGetAsync($country, $state = null, $province = null, $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) { return $this->faxLineAreaCodeGetAsyncWithHttpInfo($country, $state, $province, $city, $contentType) ->then( @@ -671,17 +700,17 @@ function ($response) { * * Get Available Fax Line Area Codes * - * @param string $country Filter area codes by country (required) - * @param string $state Filter area codes by state (optional) - * @param string $province Filter area codes by province (optional) - * @param string $city Filter area codes by city (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation + * @param string $country Filter area codes by country (required) + * @param string|null $state Filter area codes by state (optional) + * @param string|null $province Filter area codes by province (optional) + * @param string|null $city Filter area codes by city (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineAreaCodeGet. This method will eventually become unavailable */ - public function faxLineAreaCodeGetAsyncWithHttpInfo(string $country, string $state = null, string $province = null, string $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) + public function faxLineAreaCodeGetAsyncWithHttpInfo($country, $state = null, $province = null, $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) { $returnType = '\Dropbox\Sign\Model\FaxLineAreaCodeGetResponse'; $request = $this->faxLineAreaCodeGetRequest($country, $state, $province, $city, $contentType); @@ -691,9 +720,9 @@ public function faxLineAreaCodeGetAsyncWithHttpInfo(string $country, string $sta ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -702,7 +731,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -716,7 +745,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -725,25 +754,30 @@ function ($exception) { /** * Create request for operation 'faxLineAreaCodeGet' * - * @param string $country Filter area codes by country (required) - * @param string $state Filter area codes by state (optional) - * @param string $province Filter area codes by province (optional) - * @param string $city Filter area codes by city (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation + * @param string $country Filter area codes by country (required) + * @param string|null $state Filter area codes by state (optional) + * @param string|null $province Filter area codes by province (optional) + * @param string|null $city Filter area codes by city (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::faxLineAreaCodeGet. This method will eventually become unavailable */ - public function faxLineAreaCodeGetRequest(string $country, string $state = null, string $province = null, string $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) + public function faxLineAreaCodeGetRequest($country, $state = null, $province = null, $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) { + // verify the required parameter 'country' is set if ($country === null || (is_array($country) && count($country) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $country when calling faxLineAreaCodeGet' ); } + + + + $resourcePath = '/fax_line/area_codes'; $formParams = []; $queryParams = []; @@ -788,8 +822,11 @@ public function faxLineAreaCodeGetRequest(string $country, string $state = null, false // required ) ?? []); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -803,7 +840,7 @@ public function faxLineAreaCodeGetRequest(string $country, string $state = null, foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -817,8 +854,9 @@ public function faxLineAreaCodeGetRequest(string $country, string $state = null, } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -857,13 +895,13 @@ public function faxLineAreaCodeGetRequest(string $country, string $state = null, * * Purchase Fax Line * - * @param Model\FaxLineCreateRequest $fax_line_create_request fax_line_create_request (required) + * @param Model\FaxLineCreateRequest $fax_line_create_request fax_line_create_request (required) * - * @return Model\FaxLineResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\FaxLineResponse */ - public function faxLineCreate(Model\FaxLineCreateRequest $fax_line_create_request) + public function faxLineCreate($fax_line_create_request) { list($response) = $this->faxLineCreateWithHttpInfo($fax_line_create_request); return $response; @@ -874,15 +912,15 @@ public function faxLineCreate(Model\FaxLineCreateRequest $fax_line_create_reques * * Purchase Fax Line * - * @param Model\FaxLineCreateRequest $fax_line_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation + * @param Model\FaxLineCreateRequest $fax_line_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation * - * @return array of Model\FaxLineResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\FaxLineResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::faxLineCreate. This method will eventually become unavailable */ - public function faxLineCreateWithHttpInfo(Model\FaxLineCreateRequest $fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) + public function faxLineCreateWithHttpInfo($fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) { $request = $this->faxLineCreateRequest($fax_line_create_request, $contentType); @@ -894,14 +932,14 @@ public function faxLineCreateWithHttpInfo(Model\FaxLineCreateRequest $fax_line_c } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -909,18 +947,6 @@ public function faxLineCreateWithHttpInfo(Model\FaxLineCreateRequest $fax_line_c $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -931,16 +957,17 @@ public function faxLineCreateWithHttpInfo(Model\FaxLineCreateRequest $fax_line_c return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FaxLineResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\FaxLineResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -957,19 +984,33 @@ public function faxLineCreateWithHttpInfo(Model\FaxLineCreateRequest $fax_line_c return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxLineResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -986,9 +1027,11 @@ public function faxLineCreateWithHttpInfo(Model\FaxLineCreateRequest $fax_line_c return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1001,6 +1044,7 @@ public function faxLineCreateWithHttpInfo(Model\FaxLineCreateRequest $fax_line_c ); $e->setResponseObject($data); break; + } throw $e; } @@ -1011,14 +1055,14 @@ public function faxLineCreateWithHttpInfo(Model\FaxLineCreateRequest $fax_line_c * * Purchase Fax Line * - * @param Model\FaxLineCreateRequest $fax_line_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation + * @param Model\FaxLineCreateRequest $fax_line_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineCreate. This method will eventually become unavailable */ - public function faxLineCreateAsync(Model\FaxLineCreateRequest $fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) + public function faxLineCreateAsync($fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) { return $this->faxLineCreateAsyncWithHttpInfo($fax_line_create_request, $contentType) ->then( @@ -1033,14 +1077,14 @@ function ($response) { * * Purchase Fax Line * - * @param Model\FaxLineCreateRequest $fax_line_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation + * @param Model\FaxLineCreateRequest $fax_line_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineCreate. This method will eventually become unavailable */ - public function faxLineCreateAsyncWithHttpInfo(Model\FaxLineCreateRequest $fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) + public function faxLineCreateAsyncWithHttpInfo($fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) { $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; $request = $this->faxLineCreateRequest($fax_line_create_request, $contentType); @@ -1050,9 +1094,9 @@ public function faxLineCreateAsyncWithHttpInfo(Model\FaxLineCreateRequest $fax_l ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1061,7 +1105,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -1075,7 +1119,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1084,22 +1128,24 @@ function ($exception) { /** * Create request for operation 'faxLineCreate' * - * @param Model\FaxLineCreateRequest $fax_line_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation + * @param Model\FaxLineCreateRequest $fax_line_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::faxLineCreate. This method will eventually become unavailable */ - public function faxLineCreateRequest(Model\FaxLineCreateRequest $fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) + public function faxLineCreateRequest($fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) { + // verify the required parameter 'fax_line_create_request' is set if ($fax_line_create_request === null || (is_array($fax_line_create_request) && count($fax_line_create_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $fax_line_create_request when calling faxLineCreate' ); } + $resourcePath = '/fax_line/create'; $formParams = []; $queryParams = []; @@ -1113,8 +1159,11 @@ public function faxLineCreateRequest(Model\FaxLineCreateRequest $fax_line_create $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1122,7 +1171,7 @@ public function faxLineCreateRequest(Model\FaxLineCreateRequest $fax_line_create // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($fax_line_create_request)); } else { $httpBody = $fax_line_create_request; @@ -1135,7 +1184,7 @@ public function faxLineCreateRequest(Model\FaxLineCreateRequest $fax_line_create foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1152,8 +1201,9 @@ public function faxLineCreateRequest(Model\FaxLineCreateRequest $fax_line_create $payloadHook('multipart', $multipartContents, $fax_line_create_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1192,12 +1242,13 @@ public function faxLineCreateRequest(Model\FaxLineCreateRequest $fax_line_create * * Delete Fax Line * - * @param Model\FaxLineDeleteRequest $fax_line_delete_request fax_line_delete_request (required) + * @param Model\FaxLineDeleteRequest $fax_line_delete_request fax_line_delete_request (required) * * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return void */ - public function faxLineDelete(Model\FaxLineDeleteRequest $fax_line_delete_request) + public function faxLineDelete($fax_line_delete_request) { $this->faxLineDeleteWithHttpInfo($fax_line_delete_request); } @@ -1207,15 +1258,15 @@ public function faxLineDelete(Model\FaxLineDeleteRequest $fax_line_delete_reques * * Delete Fax Line * - * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation + * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation * - * @return array of null, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::faxLineDelete. This method will eventually become unavailable */ - public function faxLineDeleteWithHttpInfo(Model\FaxLineDeleteRequest $fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) + public function faxLineDeleteWithHttpInfo($fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) { $request = $this->faxLineDeleteRequest($fax_line_delete_request, $contentType); @@ -1227,14 +1278,14 @@ public function faxLineDeleteWithHttpInfo(Model\FaxLineDeleteRequest $fax_line_d } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -1242,25 +1293,16 @@ public function faxLineDeleteWithHttpInfo(Model\FaxLineDeleteRequest $fax_line_d $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() - ); - } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } switch ($e->getCode()) { + } throw $e; } @@ -1271,14 +1313,14 @@ public function faxLineDeleteWithHttpInfo(Model\FaxLineDeleteRequest $fax_line_d * * Delete Fax Line * - * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation + * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineDelete. This method will eventually become unavailable */ - public function faxLineDeleteAsync(Model\FaxLineDeleteRequest $fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) + public function faxLineDeleteAsync($fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) { return $this->faxLineDeleteAsyncWithHttpInfo($fax_line_delete_request, $contentType) ->then( @@ -1293,14 +1335,14 @@ function ($response) { * * Delete Fax Line * - * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation + * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineDelete. This method will eventually become unavailable */ - public function faxLineDeleteAsyncWithHttpInfo(Model\FaxLineDeleteRequest $fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) + public function faxLineDeleteAsyncWithHttpInfo($fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) { $returnType = ''; $request = $this->faxLineDeleteRequest($fax_line_delete_request, $contentType); @@ -1308,7 +1350,7 @@ public function faxLineDeleteAsyncWithHttpInfo(Model\FaxLineDeleteRequest $fax_l return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( - function ($response) { + function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { @@ -1322,7 +1364,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1331,22 +1373,24 @@ function ($exception) { /** * Create request for operation 'faxLineDelete' * - * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation + * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::faxLineDelete. This method will eventually become unavailable */ - public function faxLineDeleteRequest(Model\FaxLineDeleteRequest $fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) + public function faxLineDeleteRequest($fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) { + // verify the required parameter 'fax_line_delete_request' is set if ($fax_line_delete_request === null || (is_array($fax_line_delete_request) && count($fax_line_delete_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $fax_line_delete_request when calling faxLineDelete' ); } + $resourcePath = '/fax_line'; $formParams = []; $queryParams = []; @@ -1360,8 +1404,11 @@ public function faxLineDeleteRequest(Model\FaxLineDeleteRequest $fax_line_delete $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1369,7 +1416,7 @@ public function faxLineDeleteRequest(Model\FaxLineDeleteRequest $fax_line_delete // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($fax_line_delete_request)); } else { $httpBody = $fax_line_delete_request; @@ -1382,7 +1429,7 @@ public function faxLineDeleteRequest(Model\FaxLineDeleteRequest $fax_line_delete foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1399,8 +1446,9 @@ public function faxLineDeleteRequest(Model\FaxLineDeleteRequest $fax_line_delete $payloadHook('multipart', $multipartContents, $fax_line_delete_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1439,13 +1487,13 @@ public function faxLineDeleteRequest(Model\FaxLineDeleteRequest $fax_line_delete * * Get Fax Line * - * @param string $number The Fax Line number (required) + * @param string $number The Fax Line number (required) * - * @return Model\FaxLineResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\FaxLineResponse */ - public function faxLineGet(string $number) + public function faxLineGet($number) { list($response) = $this->faxLineGetWithHttpInfo($number); return $response; @@ -1456,15 +1504,15 @@ public function faxLineGet(string $number) * * Get Fax Line * - * @param string $number The Fax Line number (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation + * @param string $number The Fax Line number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation * - * @return array of Model\FaxLineResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\FaxLineResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::faxLineGet. This method will eventually become unavailable */ - public function faxLineGetWithHttpInfo(string $number, string $contentType = self::contentTypes['faxLineGet'][0]) + public function faxLineGetWithHttpInfo($number, string $contentType = self::contentTypes['faxLineGet'][0]) { $request = $this->faxLineGetRequest($number, $contentType); @@ -1476,14 +1524,14 @@ public function faxLineGetWithHttpInfo(string $number, string $contentType = sel } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -1491,18 +1539,6 @@ public function faxLineGetWithHttpInfo(string $number, string $contentType = sel $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -1513,16 +1549,17 @@ public function faxLineGetWithHttpInfo(string $number, string $contentType = sel return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FaxLineResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\FaxLineResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1539,19 +1576,33 @@ public function faxLineGetWithHttpInfo(string $number, string $contentType = sel return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxLineResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1568,9 +1619,11 @@ public function faxLineGetWithHttpInfo(string $number, string $contentType = sel return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1583,6 +1636,7 @@ public function faxLineGetWithHttpInfo(string $number, string $contentType = sel ); $e->setResponseObject($data); break; + } throw $e; } @@ -1593,14 +1647,14 @@ public function faxLineGetWithHttpInfo(string $number, string $contentType = sel * * Get Fax Line * - * @param string $number The Fax Line number (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation + * @param string $number The Fax Line number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineGet. This method will eventually become unavailable */ - public function faxLineGetAsync(string $number, string $contentType = self::contentTypes['faxLineGet'][0]) + public function faxLineGetAsync($number, string $contentType = self::contentTypes['faxLineGet'][0]) { return $this->faxLineGetAsyncWithHttpInfo($number, $contentType) ->then( @@ -1615,14 +1669,14 @@ function ($response) { * * Get Fax Line * - * @param string $number The Fax Line number (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation + * @param string $number The Fax Line number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineGet. This method will eventually become unavailable */ - public function faxLineGetAsyncWithHttpInfo(string $number, string $contentType = self::contentTypes['faxLineGet'][0]) + public function faxLineGetAsyncWithHttpInfo($number, string $contentType = self::contentTypes['faxLineGet'][0]) { $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; $request = $this->faxLineGetRequest($number, $contentType); @@ -1632,9 +1686,9 @@ public function faxLineGetAsyncWithHttpInfo(string $number, string $contentType ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1643,7 +1697,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -1657,7 +1711,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1666,22 +1720,24 @@ function ($exception) { /** * Create request for operation 'faxLineGet' * - * @param string $number The Fax Line number (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation + * @param string $number The Fax Line number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::faxLineGet. This method will eventually become unavailable */ - public function faxLineGetRequest(string $number, string $contentType = self::contentTypes['faxLineGet'][0]) + public function faxLineGetRequest($number, string $contentType = self::contentTypes['faxLineGet'][0]) { + // verify the required parameter 'number' is set if ($number === null || (is_array($number) && count($number) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $number when calling faxLineGet' ); } + $resourcePath = '/fax_line'; $formParams = []; $queryParams = []; @@ -1699,8 +1755,11 @@ public function faxLineGetRequest(string $number, string $contentType = self::co true // required ) ?? []); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1714,7 +1773,7 @@ public function faxLineGetRequest(string $number, string $contentType = self::co foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1728,8 +1787,9 @@ public function faxLineGetRequest(string $number, string $contentType = self::co } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1768,16 +1828,16 @@ public function faxLineGetRequest(string $number, string $contentType = self::co * * List Fax Lines * - * @param string $account_id Account ID (optional) - * @param int $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param bool $show_team_lines Include Fax Lines belonging to team members in the list (optional) + * @param string|null $account_id Account ID (optional) + * @param int|null $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param bool|null $show_team_lines Include Fax Lines belonging to team members in the list (optional) * - * @return Model\FaxLineListResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\FaxLineListResponse */ - public function faxLineList(string $account_id = null, int $page = 1, int $page_size = 20, bool $show_team_lines = null) + public function faxLineList($account_id = null, $page = 1, $page_size = 20, $show_team_lines = null) { list($response) = $this->faxLineListWithHttpInfo($account_id, $page, $page_size, $show_team_lines); return $response; @@ -1788,18 +1848,18 @@ public function faxLineList(string $account_id = null, int $page = 1, int $page_ * * List Fax Lines * - * @param string $account_id Account ID (optional) - * @param int $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param bool $show_team_lines Include Fax Lines belonging to team members in the list (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation + * @param string|null $account_id Account ID (optional) + * @param int|null $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param bool|null $show_team_lines Include Fax Lines belonging to team members in the list (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation * - * @return array of Model\FaxLineListResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\FaxLineListResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::faxLineList. This method will eventually become unavailable */ - public function faxLineListWithHttpInfo(string $account_id = null, int $page = 1, int $page_size = 20, bool $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) + public function faxLineListWithHttpInfo($account_id = null, $page = 1, $page_size = 20, $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) { $request = $this->faxLineListRequest($account_id, $page, $page_size, $show_team_lines, $contentType); @@ -1811,14 +1871,14 @@ public function faxLineListWithHttpInfo(string $account_id = null, int $page = 1 } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -1826,18 +1886,6 @@ public function faxLineListWithHttpInfo(string $account_id = null, int $page = 1 $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -1848,16 +1896,17 @@ public function faxLineListWithHttpInfo(string $account_id = null, int $page = 1 return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FaxLineListResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\FaxLineListResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1874,19 +1923,33 @@ public function faxLineListWithHttpInfo(string $account_id = null, int $page = 1 return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxLineListResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\FaxLineListResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1903,9 +1966,11 @@ public function faxLineListWithHttpInfo(string $account_id = null, int $page = 1 return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1918,6 +1983,7 @@ public function faxLineListWithHttpInfo(string $account_id = null, int $page = 1 ); $e->setResponseObject($data); break; + } throw $e; } @@ -1928,17 +1994,17 @@ public function faxLineListWithHttpInfo(string $account_id = null, int $page = 1 * * List Fax Lines * - * @param string $account_id Account ID (optional) - * @param int $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param bool $show_team_lines Include Fax Lines belonging to team members in the list (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation + * @param string|null $account_id Account ID (optional) + * @param int|null $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param bool|null $show_team_lines Include Fax Lines belonging to team members in the list (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineList. This method will eventually become unavailable */ - public function faxLineListAsync(string $account_id = null, int $page = 1, int $page_size = 20, bool $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) + public function faxLineListAsync($account_id = null, $page = 1, $page_size = 20, $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) { return $this->faxLineListAsyncWithHttpInfo($account_id, $page, $page_size, $show_team_lines, $contentType) ->then( @@ -1953,17 +2019,17 @@ function ($response) { * * List Fax Lines * - * @param string $account_id Account ID (optional) - * @param int $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param bool $show_team_lines Include Fax Lines belonging to team members in the list (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation + * @param string|null $account_id Account ID (optional) + * @param int|null $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param bool|null $show_team_lines Include Fax Lines belonging to team members in the list (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineList. This method will eventually become unavailable */ - public function faxLineListAsyncWithHttpInfo(string $account_id = null, int $page = 1, int $page_size = 20, bool $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) + public function faxLineListAsyncWithHttpInfo($account_id = null, $page = 1, $page_size = 20, $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) { $returnType = '\Dropbox\Sign\Model\FaxLineListResponse'; $request = $this->faxLineListRequest($account_id, $page, $page_size, $show_team_lines, $contentType); @@ -1973,9 +2039,9 @@ public function faxLineListAsyncWithHttpInfo(string $account_id = null, int $pag ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1984,7 +2050,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -1998,7 +2064,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -2007,18 +2073,24 @@ function ($exception) { /** * Create request for operation 'faxLineList' * - * @param string $account_id Account ID (optional) - * @param int $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param bool $show_team_lines Include Fax Lines belonging to team members in the list (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation + * @param string|null $account_id Account ID (optional) + * @param int|null $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param bool|null $show_team_lines Include Fax Lines belonging to team members in the list (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::faxLineList. This method will eventually become unavailable */ - public function faxLineListRequest(string $account_id = null, int $page = 1, int $page_size = 20, bool $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) + public function faxLineListRequest($account_id = null, $page = 1, $page_size = 20, $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) { + + + + + + $resourcePath = '/fax_line/list'; $formParams = []; $queryParams = []; @@ -2063,8 +2135,11 @@ public function faxLineListRequest(string $account_id = null, int $page = 1, int false // required ) ?? []); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -2078,7 +2153,7 @@ public function faxLineListRequest(string $account_id = null, int $page = 1, int foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -2092,8 +2167,9 @@ public function faxLineListRequest(string $account_id = null, int $page = 1, int } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2132,13 +2208,13 @@ public function faxLineListRequest(string $account_id = null, int $page = 1, int * * Remove Fax Line Access * - * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request fax_line_remove_user_request (required) + * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request fax_line_remove_user_request (required) * - * @return Model\FaxLineResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\FaxLineResponse */ - public function faxLineRemoveUser(Model\FaxLineRemoveUserRequest $fax_line_remove_user_request) + public function faxLineRemoveUser($fax_line_remove_user_request) { list($response) = $this->faxLineRemoveUserWithHttpInfo($fax_line_remove_user_request); return $response; @@ -2149,15 +2225,15 @@ public function faxLineRemoveUser(Model\FaxLineRemoveUserRequest $fax_line_remov * * Remove Fax Line Access * - * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation + * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation * - * @return array of Model\FaxLineResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\FaxLineResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::faxLineRemoveUser. This method will eventually become unavailable */ - public function faxLineRemoveUserWithHttpInfo(Model\FaxLineRemoveUserRequest $fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) + public function faxLineRemoveUserWithHttpInfo($fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) { $request = $this->faxLineRemoveUserRequest($fax_line_remove_user_request, $contentType); @@ -2169,14 +2245,14 @@ public function faxLineRemoveUserWithHttpInfo(Model\FaxLineRemoveUserRequest $fa } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -2184,18 +2260,6 @@ public function faxLineRemoveUserWithHttpInfo(Model\FaxLineRemoveUserRequest $fa $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -2206,16 +2270,17 @@ public function faxLineRemoveUserWithHttpInfo(Model\FaxLineRemoveUserRequest $fa return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FaxLineResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\FaxLineResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2232,19 +2297,33 @@ public function faxLineRemoveUserWithHttpInfo(Model\FaxLineRemoveUserRequest $fa return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxLineResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2261,9 +2340,11 @@ public function faxLineRemoveUserWithHttpInfo(Model\FaxLineRemoveUserRequest $fa return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2276,6 +2357,7 @@ public function faxLineRemoveUserWithHttpInfo(Model\FaxLineRemoveUserRequest $fa ); $e->setResponseObject($data); break; + } throw $e; } @@ -2286,14 +2368,14 @@ public function faxLineRemoveUserWithHttpInfo(Model\FaxLineRemoveUserRequest $fa * * Remove Fax Line Access * - * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation + * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineRemoveUser. This method will eventually become unavailable */ - public function faxLineRemoveUserAsync(Model\FaxLineRemoveUserRequest $fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) + public function faxLineRemoveUserAsync($fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) { return $this->faxLineRemoveUserAsyncWithHttpInfo($fax_line_remove_user_request, $contentType) ->then( @@ -2308,14 +2390,14 @@ function ($response) { * * Remove Fax Line Access * - * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation + * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineRemoveUser. This method will eventually become unavailable */ - public function faxLineRemoveUserAsyncWithHttpInfo(Model\FaxLineRemoveUserRequest $fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) + public function faxLineRemoveUserAsyncWithHttpInfo($fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) { $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; $request = $this->faxLineRemoveUserRequest($fax_line_remove_user_request, $contentType); @@ -2325,9 +2407,9 @@ public function faxLineRemoveUserAsyncWithHttpInfo(Model\FaxLineRemoveUserReques ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2336,7 +2418,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -2350,7 +2432,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -2359,22 +2441,24 @@ function ($exception) { /** * Create request for operation 'faxLineRemoveUser' * - * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation + * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::faxLineRemoveUser. This method will eventually become unavailable */ - public function faxLineRemoveUserRequest(Model\FaxLineRemoveUserRequest $fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) + public function faxLineRemoveUserRequest($fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) { + // verify the required parameter 'fax_line_remove_user_request' is set if ($fax_line_remove_user_request === null || (is_array($fax_line_remove_user_request) && count($fax_line_remove_user_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $fax_line_remove_user_request when calling faxLineRemoveUser' ); } + $resourcePath = '/fax_line/remove_user'; $formParams = []; $queryParams = []; @@ -2388,8 +2472,11 @@ public function faxLineRemoveUserRequest(Model\FaxLineRemoveUserRequest $fax_lin $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -2397,7 +2484,7 @@ public function faxLineRemoveUserRequest(Model\FaxLineRemoveUserRequest $fax_lin // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($fax_line_remove_user_request)); } else { $httpBody = $fax_line_remove_user_request; @@ -2410,7 +2497,7 @@ public function faxLineRemoveUserRequest(Model\FaxLineRemoveUserRequest $fax_lin foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -2427,8 +2514,9 @@ public function faxLineRemoveUserRequest(Model\FaxLineRemoveUserRequest $fax_lin $payloadHook('multipart', $multipartContents, $fax_line_remove_user_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2465,8 +2553,8 @@ public function faxLineRemoveUserRequest(Model\FaxLineRemoveUserRequest $fax_lin /** * Create http client option * + * @throws \RuntimeException on file opening failure * @return array of http client options - * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -2474,7 +2562,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -2490,8 +2578,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -2501,9 +2589,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); } return [ @@ -2522,8 +2610,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/OAuthApi.php b/sdks/php/src/Api/OAuthApi.php index 81468626d..d2eab06d7 100644 --- a/sdks/php/src/Api/OAuthApi.php +++ b/sdks/php/src/Api/OAuthApi.php @@ -1,10 +1,13 @@ [ 'application/json', @@ -79,12 +87,15 @@ class OAuthApi protected $response; /** - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param Configuration $config + * @param ClientInterface $client + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - Configuration $config = null, - ClientInterface $client = null, - HeaderSelector $selector = null, + ?Configuration $config = null, + ?ClientInterface $client = null, + ?HeaderSelector $selector = null, int $hostIndex = 0 ) { $this->client = $client ?: new Client(); @@ -99,7 +110,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex(int $hostIndex): void + public function setHostIndex($hostIndex): void { $this->hostIndex = $hostIndex; } @@ -140,13 +151,13 @@ public function getResponse() * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request o_auth_token_generate_request (required) + * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request o_auth_token_generate_request (required) * - * @return Model\OAuthTokenResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\OAuthTokenResponse */ - public function oauthTokenGenerate(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request) + public function oauthTokenGenerate($o_auth_token_generate_request) { list($response) = $this->oauthTokenGenerateWithHttpInfo($o_auth_token_generate_request); return $response; @@ -161,17 +172,17 @@ public function oauthTokenGenerate(Model\OAuthTokenGenerateRequest $o_auth_token * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) - * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead - * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation + * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation * - * @return array of Model\OAuthTokenResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\OAuthTokenResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::oauthTokenGenerate. This method will eventually become unavailable */ - public function oauthTokenGenerateWithHttpInfo(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) + public function oauthTokenGenerateWithHttpInfo($o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) { $request = $this->oauthTokenGenerateRequest($o_auth_token_generate_request, $hostIndex, $variables, $contentType); @@ -183,14 +194,14 @@ public function oauthTokenGenerateWithHttpInfo(Model\OAuthTokenGenerateRequest $ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -198,18 +209,6 @@ public function oauthTokenGenerateWithHttpInfo(Model\OAuthTokenGenerateRequest $ $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -220,16 +219,17 @@ public function oauthTokenGenerateWithHttpInfo(Model\OAuthTokenGenerateRequest $ return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\OAuthTokenResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\OAuthTokenResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -246,19 +246,33 @@ public function oauthTokenGenerateWithHttpInfo(Model\OAuthTokenGenerateRequest $ return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\OAuthTokenResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\OAuthTokenResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -275,9 +289,11 @@ public function oauthTokenGenerateWithHttpInfo(Model\OAuthTokenGenerateRequest $ return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -290,6 +306,7 @@ public function oauthTokenGenerateWithHttpInfo(Model\OAuthTokenGenerateRequest $ ); $e->setResponseObject($data); break; + } throw $e; } @@ -304,16 +321,16 @@ public function oauthTokenGenerateWithHttpInfo(Model\OAuthTokenGenerateRequest $ * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) - * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead - * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation + * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::oauthTokenGenerate. This method will eventually become unavailable */ - public function oauthTokenGenerateAsync(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) + public function oauthTokenGenerateAsync($o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) { return $this->oauthTokenGenerateAsyncWithHttpInfo($o_auth_token_generate_request, $hostIndex, $variables, $contentType) ->then( @@ -332,16 +349,16 @@ function ($response) { * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) - * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead - * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation + * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::oauthTokenGenerate. This method will eventually become unavailable */ - public function oauthTokenGenerateAsyncWithHttpInfo(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) + public function oauthTokenGenerateAsyncWithHttpInfo($o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) { $returnType = '\Dropbox\Sign\Model\OAuthTokenResponse'; $request = $this->oauthTokenGenerateRequest($o_auth_token_generate_request, $hostIndex, $variables, $contentType); @@ -351,9 +368,9 @@ public function oauthTokenGenerateAsyncWithHttpInfo(Model\OAuthTokenGenerateRequ ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -362,7 +379,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -376,7 +393,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -385,28 +402,30 @@ function ($exception) { /** * Create request for operation 'oauthTokenGenerate' * - * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. - * if needed, use the 'variables' parameter to pass variables to the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) - * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead - * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation + * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::oauthTokenGenerate. This method will eventually become unavailable */ - public function oauthTokenGenerateRequest(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) + public function oauthTokenGenerateRequest($o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) { + // verify the required parameter 'o_auth_token_generate_request' is set if ($o_auth_token_generate_request === null || (is_array($o_auth_token_generate_request) && count($o_auth_token_generate_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $o_auth_token_generate_request when calling oauthTokenGenerate' ); } + $resourcePath = '/oauth/token'; $formParams = []; $queryParams = []; @@ -420,8 +439,11 @@ public function oauthTokenGenerateRequest(Model\OAuthTokenGenerateRequest $o_aut $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -429,7 +451,7 @@ public function oauthTokenGenerateRequest(Model\OAuthTokenGenerateRequest $o_aut // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($o_auth_token_generate_request)); } else { $httpBody = $o_auth_token_generate_request; @@ -442,7 +464,7 @@ public function oauthTokenGenerateRequest(Model\OAuthTokenGenerateRequest $o_aut foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -459,8 +481,9 @@ public function oauthTokenGenerateRequest(Model\OAuthTokenGenerateRequest $o_aut $payloadHook('multipart', $multipartContents, $o_auth_token_generate_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -468,6 +491,7 @@ public function oauthTokenGenerateRequest(Model\OAuthTokenGenerateRequest $o_aut } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -479,7 +503,7 @@ public function oauthTokenGenerateRequest(Model\OAuthTokenGenerateRequest $o_aut $headers ); - // Preserve the original behavior of server indexing. + # Preserve the original behavior of server indexing. if ($hostIndex === null) { $hostIndex = $this->hostIndex; } @@ -487,7 +511,7 @@ public function oauthTokenGenerateRequest(Model\OAuthTokenGenerateRequest $o_aut $hostSettings = $this->getHostSettingsForoauthTokenGenerate(); if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { - throw new InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than " . count($hostSettings)); + throw new \InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than ".count($hostSettings)); } $operationHost = Configuration::getHostString($hostSettings, $hostIndex, $variables); $query = ObjectSerializer::buildQuery($queryParams); @@ -508,9 +532,9 @@ protected function getHostSettingsForoauthTokenGenerate(): array { return [ [ - 'url' => 'https://app.hellosign.com', - 'description' => 'No description provided', - ], + "url" => "https://app.hellosign.com", + "description" => "No description provided", + ] ]; } @@ -523,13 +547,13 @@ protected function getHostSettingsForoauthTokenGenerate(): array * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request o_auth_token_refresh_request (required) + * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request o_auth_token_refresh_request (required) * - * @return Model\OAuthTokenResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\OAuthTokenResponse */ - public function oauthTokenRefresh(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request) + public function oauthTokenRefresh($o_auth_token_refresh_request) { list($response) = $this->oauthTokenRefreshWithHttpInfo($o_auth_token_refresh_request); return $response; @@ -544,17 +568,17 @@ public function oauthTokenRefresh(Model\OAuthTokenRefreshRequest $o_auth_token_r * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) - * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead - * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation + * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation * - * @return array of Model\OAuthTokenResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\OAuthTokenResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::oauthTokenRefresh. This method will eventually become unavailable */ - public function oauthTokenRefreshWithHttpInfo(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) + public function oauthTokenRefreshWithHttpInfo($o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) { $request = $this->oauthTokenRefreshRequest($o_auth_token_refresh_request, $hostIndex, $variables, $contentType); @@ -566,14 +590,14 @@ public function oauthTokenRefreshWithHttpInfo(Model\OAuthTokenRefreshRequest $o_ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -581,18 +605,6 @@ public function oauthTokenRefreshWithHttpInfo(Model\OAuthTokenRefreshRequest $o_ $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -603,16 +615,17 @@ public function oauthTokenRefreshWithHttpInfo(Model\OAuthTokenRefreshRequest $o_ return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\OAuthTokenResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\OAuthTokenResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -629,19 +642,33 @@ public function oauthTokenRefreshWithHttpInfo(Model\OAuthTokenRefreshRequest $o_ return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\OAuthTokenResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\OAuthTokenResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -658,9 +685,11 @@ public function oauthTokenRefreshWithHttpInfo(Model\OAuthTokenRefreshRequest $o_ return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -673,6 +702,7 @@ public function oauthTokenRefreshWithHttpInfo(Model\OAuthTokenRefreshRequest $o_ ); $e->setResponseObject($data); break; + } throw $e; } @@ -687,16 +717,16 @@ public function oauthTokenRefreshWithHttpInfo(Model\OAuthTokenRefreshRequest $o_ * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) - * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead - * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation + * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::oauthTokenRefresh. This method will eventually become unavailable */ - public function oauthTokenRefreshAsync(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) + public function oauthTokenRefreshAsync($o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) { return $this->oauthTokenRefreshAsyncWithHttpInfo($o_auth_token_refresh_request, $hostIndex, $variables, $contentType) ->then( @@ -715,16 +745,16 @@ function ($response) { * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) - * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead - * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation + * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::oauthTokenRefresh. This method will eventually become unavailable */ - public function oauthTokenRefreshAsyncWithHttpInfo(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) + public function oauthTokenRefreshAsyncWithHttpInfo($o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) { $returnType = '\Dropbox\Sign\Model\OAuthTokenResponse'; $request = $this->oauthTokenRefreshRequest($o_auth_token_refresh_request, $hostIndex, $variables, $contentType); @@ -734,9 +764,9 @@ public function oauthTokenRefreshAsyncWithHttpInfo(Model\OAuthTokenRefreshReques ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -745,7 +775,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -759,7 +789,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -768,28 +798,30 @@ function ($exception) { /** * Create request for operation 'oauthTokenRefresh' * - * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. - * if needed, use the 'variables' parameter to pass variables to the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) - * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead - * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation + * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::oauthTokenRefresh. This method will eventually become unavailable */ - public function oauthTokenRefreshRequest(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) + public function oauthTokenRefreshRequest($o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) { + // verify the required parameter 'o_auth_token_refresh_request' is set if ($o_auth_token_refresh_request === null || (is_array($o_auth_token_refresh_request) && count($o_auth_token_refresh_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $o_auth_token_refresh_request when calling oauthTokenRefresh' ); } + $resourcePath = '/oauth/token?refresh'; $formParams = []; $queryParams = []; @@ -803,8 +835,11 @@ public function oauthTokenRefreshRequest(Model\OAuthTokenRefreshRequest $o_auth_ $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -812,7 +847,7 @@ public function oauthTokenRefreshRequest(Model\OAuthTokenRefreshRequest $o_auth_ // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($o_auth_token_refresh_request)); } else { $httpBody = $o_auth_token_refresh_request; @@ -825,7 +860,7 @@ public function oauthTokenRefreshRequest(Model\OAuthTokenRefreshRequest $o_auth_ foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -842,8 +877,9 @@ public function oauthTokenRefreshRequest(Model\OAuthTokenRefreshRequest $o_auth_ $payloadHook('multipart', $multipartContents, $o_auth_token_refresh_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -851,6 +887,7 @@ public function oauthTokenRefreshRequest(Model\OAuthTokenRefreshRequest $o_auth_ } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -862,7 +899,7 @@ public function oauthTokenRefreshRequest(Model\OAuthTokenRefreshRequest $o_auth_ $headers ); - // Preserve the original behavior of server indexing. + # Preserve the original behavior of server indexing. if ($hostIndex === null) { $hostIndex = $this->hostIndex; } @@ -870,7 +907,7 @@ public function oauthTokenRefreshRequest(Model\OAuthTokenRefreshRequest $o_auth_ $hostSettings = $this->getHostSettingsForoauthTokenRefresh(); if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { - throw new InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than " . count($hostSettings)); + throw new \InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than ".count($hostSettings)); } $operationHost = Configuration::getHostString($hostSettings, $hostIndex, $variables); $query = ObjectSerializer::buildQuery($queryParams); @@ -891,17 +928,17 @@ protected function getHostSettingsForoauthTokenRefresh(): array { return [ [ - 'url' => 'https://app.hellosign.com', - 'description' => 'No description provided', - ], + "url" => "https://app.hellosign.com", + "description" => "No description provided", + ] ]; } /** * Create http client option * + * @throws \RuntimeException on file opening failure * @return array of http client options - * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -909,7 +946,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -925,8 +962,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -936,9 +973,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); } return [ @@ -957,8 +994,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/ReportApi.php b/sdks/php/src/Api/ReportApi.php index 987fc25fe..4db2fcd16 100644 --- a/sdks/php/src/Api/ReportApi.php +++ b/sdks/php/src/Api/ReportApi.php @@ -1,10 +1,13 @@ [ 'application/json', @@ -76,12 +84,15 @@ class ReportApi protected $response; /** - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param Configuration $config + * @param ClientInterface $client + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - Configuration $config = null, - ClientInterface $client = null, - HeaderSelector $selector = null, + ?Configuration $config = null, + ?ClientInterface $client = null, + ?HeaderSelector $selector = null, int $hostIndex = 0 ) { $this->client = $client ?: new Client(); @@ -96,7 +107,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex(int $hostIndex): void + public function setHostIndex($hostIndex): void { $this->hostIndex = $hostIndex; } @@ -133,13 +144,13 @@ public function getResponse() * * Create Report * - * @param Model\ReportCreateRequest $report_create_request report_create_request (required) + * @param Model\ReportCreateRequest $report_create_request report_create_request (required) * - * @return Model\ReportCreateResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\ReportCreateResponse */ - public function reportCreate(Model\ReportCreateRequest $report_create_request) + public function reportCreate($report_create_request) { list($response) = $this->reportCreateWithHttpInfo($report_create_request); return $response; @@ -150,15 +161,15 @@ public function reportCreate(Model\ReportCreateRequest $report_create_request) * * Create Report * - * @param Model\ReportCreateRequest $report_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation + * @param Model\ReportCreateRequest $report_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation * - * @return array of Model\ReportCreateResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\ReportCreateResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::reportCreate. This method will eventually become unavailable */ - public function reportCreateWithHttpInfo(Model\ReportCreateRequest $report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) + public function reportCreateWithHttpInfo($report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) { $request = $this->reportCreateRequest($report_create_request, $contentType); @@ -170,14 +181,14 @@ public function reportCreateWithHttpInfo(Model\ReportCreateRequest $report_creat } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -185,18 +196,6 @@ public function reportCreateWithHttpInfo(Model\ReportCreateRequest $report_creat $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -207,16 +206,17 @@ public function reportCreateWithHttpInfo(Model\ReportCreateRequest $report_creat return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\ReportCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\ReportCreateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -233,19 +233,33 @@ public function reportCreateWithHttpInfo(Model\ReportCreateRequest $report_creat return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ReportCreateResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\ReportCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -262,9 +276,11 @@ public function reportCreateWithHttpInfo(Model\ReportCreateRequest $report_creat return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -277,6 +293,7 @@ public function reportCreateWithHttpInfo(Model\ReportCreateRequest $report_creat ); $e->setResponseObject($data); break; + } throw $e; } @@ -287,14 +304,14 @@ public function reportCreateWithHttpInfo(Model\ReportCreateRequest $report_creat * * Create Report * - * @param Model\ReportCreateRequest $report_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation + * @param Model\ReportCreateRequest $report_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::reportCreate. This method will eventually become unavailable */ - public function reportCreateAsync(Model\ReportCreateRequest $report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) + public function reportCreateAsync($report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) { return $this->reportCreateAsyncWithHttpInfo($report_create_request, $contentType) ->then( @@ -309,14 +326,14 @@ function ($response) { * * Create Report * - * @param Model\ReportCreateRequest $report_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation + * @param Model\ReportCreateRequest $report_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::reportCreate. This method will eventually become unavailable */ - public function reportCreateAsyncWithHttpInfo(Model\ReportCreateRequest $report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) + public function reportCreateAsyncWithHttpInfo($report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) { $returnType = '\Dropbox\Sign\Model\ReportCreateResponse'; $request = $this->reportCreateRequest($report_create_request, $contentType); @@ -326,9 +343,9 @@ public function reportCreateAsyncWithHttpInfo(Model\ReportCreateRequest $report_ ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -337,7 +354,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -351,7 +368,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -360,22 +377,24 @@ function ($exception) { /** * Create request for operation 'reportCreate' * - * @param Model\ReportCreateRequest $report_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation + * @param Model\ReportCreateRequest $report_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::reportCreate. This method will eventually become unavailable */ - public function reportCreateRequest(Model\ReportCreateRequest $report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) + public function reportCreateRequest($report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) { + // verify the required parameter 'report_create_request' is set if ($report_create_request === null || (is_array($report_create_request) && count($report_create_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $report_create_request when calling reportCreate' ); } + $resourcePath = '/report/create'; $formParams = []; $queryParams = []; @@ -389,8 +408,11 @@ public function reportCreateRequest(Model\ReportCreateRequest $report_create_req $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -398,7 +420,7 @@ public function reportCreateRequest(Model\ReportCreateRequest $report_create_req // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($report_create_request)); } else { $httpBody = $report_create_request; @@ -411,7 +433,7 @@ public function reportCreateRequest(Model\ReportCreateRequest $report_create_req foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -428,8 +450,9 @@ public function reportCreateRequest(Model\ReportCreateRequest $report_create_req $payloadHook('multipart', $multipartContents, $report_create_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -466,8 +489,8 @@ public function reportCreateRequest(Model\ReportCreateRequest $report_create_req /** * Create http client option * + * @throws \RuntimeException on file opening failure * @return array of http client options - * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -475,7 +498,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -491,8 +514,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -502,9 +525,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); } return [ @@ -523,8 +546,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/SignatureRequestApi.php b/sdks/php/src/Api/SignatureRequestApi.php index 38947f821..b03c9e5b2 100644 --- a/sdks/php/src/Api/SignatureRequestApi.php +++ b/sdks/php/src/Api/SignatureRequestApi.php @@ -1,10 +1,13 @@ [ 'application/json', @@ -144,12 +151,15 @@ class SignatureRequestApi protected $response; /** - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param Configuration $config + * @param ClientInterface $client + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - Configuration $config = null, - ClientInterface $client = null, - HeaderSelector $selector = null, + ?Configuration $config = null, + ?ClientInterface $client = null, + ?HeaderSelector $selector = null, int $hostIndex = 0 ) { $this->client = $client ?: new Client(); @@ -164,7 +174,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex(int $hostIndex): void + public function setHostIndex($hostIndex): void { $this->hostIndex = $hostIndex; } @@ -201,13 +211,13 @@ public function getResponse() * * Embedded Bulk Send with Template * - * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request signature_request_bulk_create_embedded_with_template_request (required) + * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request signature_request_bulk_create_embedded_with_template_request (required) * - * @return Model\BulkSendJobSendResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\BulkSendJobSendResponse */ - public function signatureRequestBulkCreateEmbeddedWithTemplate(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request) + public function signatureRequestBulkCreateEmbeddedWithTemplate($signature_request_bulk_create_embedded_with_template_request) { list($response) = $this->signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo($signature_request_bulk_create_embedded_with_template_request); return $response; @@ -218,15 +228,15 @@ public function signatureRequestBulkCreateEmbeddedWithTemplate(Model\SignatureRe * * Embedded Bulk Send with Template * - * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @return array of Model\BulkSendJobSendResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\BulkSendJobSendResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestBulkCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) + public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo($signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) { $request = $this->signatureRequestBulkCreateEmbeddedWithTemplateRequest($signature_request_bulk_create_embedded_with_template_request, $contentType); @@ -238,14 +248,14 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(Model } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -253,18 +263,6 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(Model $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -275,16 +273,17 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(Model return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\BulkSendJobSendResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\BulkSendJobSendResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -301,19 +300,33 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(Model return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\BulkSendJobSendResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\BulkSendJobSendResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -330,9 +343,11 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(Model return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -345,6 +360,7 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(Model ); $e->setResponseObject($data); break; + } throw $e; } @@ -355,14 +371,14 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(Model * * Embedded Bulk Send with Template * - * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestBulkCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkCreateEmbeddedWithTemplateAsync(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) + public function signatureRequestBulkCreateEmbeddedWithTemplateAsync($signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) { return $this->signatureRequestBulkCreateEmbeddedWithTemplateAsyncWithHttpInfo($signature_request_bulk_create_embedded_with_template_request, $contentType) ->then( @@ -377,14 +393,14 @@ function ($response) { * * Embedded Bulk Send with Template * - * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestBulkCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkCreateEmbeddedWithTemplateAsyncWithHttpInfo(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) + public function signatureRequestBulkCreateEmbeddedWithTemplateAsyncWithHttpInfo($signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\BulkSendJobSendResponse'; $request = $this->signatureRequestBulkCreateEmbeddedWithTemplateRequest($signature_request_bulk_create_embedded_with_template_request, $contentType); @@ -394,9 +410,9 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateAsyncWithHttpInfo( ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -405,7 +421,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -419,7 +435,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -428,22 +444,24 @@ function ($exception) { /** * Create request for operation 'signatureRequestBulkCreateEmbeddedWithTemplate' * - * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestBulkCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkCreateEmbeddedWithTemplateRequest(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) + public function signatureRequestBulkCreateEmbeddedWithTemplateRequest($signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) { + // verify the required parameter 'signature_request_bulk_create_embedded_with_template_request' is set if ($signature_request_bulk_create_embedded_with_template_request === null || (is_array($signature_request_bulk_create_embedded_with_template_request) && count($signature_request_bulk_create_embedded_with_template_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_bulk_create_embedded_with_template_request when calling signatureRequestBulkCreateEmbeddedWithTemplate' ); } + $resourcePath = '/signature_request/bulk_create_embedded_with_template'; $formParams = []; $queryParams = []; @@ -457,8 +475,11 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateRequest(Model\Sign $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -466,7 +487,7 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateRequest(Model\Sign // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_bulk_create_embedded_with_template_request)); } else { $httpBody = $signature_request_bulk_create_embedded_with_template_request; @@ -479,7 +500,7 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateRequest(Model\Sign foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -496,8 +517,9 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateRequest(Model\Sign $payloadHook('multipart', $multipartContents, $signature_request_bulk_create_embedded_with_template_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -536,13 +558,13 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateRequest(Model\Sign * * Bulk Send with Template * - * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request signature_request_bulk_send_with_template_request (required) + * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request signature_request_bulk_send_with_template_request (required) * - * @return Model\BulkSendJobSendResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\BulkSendJobSendResponse */ - public function signatureRequestBulkSendWithTemplate(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request) + public function signatureRequestBulkSendWithTemplate($signature_request_bulk_send_with_template_request) { list($response) = $this->signatureRequestBulkSendWithTemplateWithHttpInfo($signature_request_bulk_send_with_template_request); return $response; @@ -553,15 +575,15 @@ public function signatureRequestBulkSendWithTemplate(Model\SignatureRequestBulkS * * Bulk Send with Template * - * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation * - * @return array of Model\BulkSendJobSendResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\BulkSendJobSendResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestBulkSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkSendWithTemplateWithHttpInfo(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) + public function signatureRequestBulkSendWithTemplateWithHttpInfo($signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) { $request = $this->signatureRequestBulkSendWithTemplateRequest($signature_request_bulk_send_with_template_request, $contentType); @@ -573,14 +595,14 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo(Model\Signature } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -588,18 +610,6 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo(Model\Signature $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -610,16 +620,17 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo(Model\Signature return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\BulkSendJobSendResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\BulkSendJobSendResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -636,19 +647,33 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo(Model\Signature return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\BulkSendJobSendResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\BulkSendJobSendResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -665,9 +690,11 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo(Model\Signature return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -680,6 +707,7 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo(Model\Signature ); $e->setResponseObject($data); break; + } throw $e; } @@ -690,14 +718,14 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo(Model\Signature * * Bulk Send with Template * - * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestBulkSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkSendWithTemplateAsync(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) + public function signatureRequestBulkSendWithTemplateAsync($signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) { return $this->signatureRequestBulkSendWithTemplateAsyncWithHttpInfo($signature_request_bulk_send_with_template_request, $contentType) ->then( @@ -712,14 +740,14 @@ function ($response) { * * Bulk Send with Template * - * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestBulkSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkSendWithTemplateAsyncWithHttpInfo(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) + public function signatureRequestBulkSendWithTemplateAsyncWithHttpInfo($signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\BulkSendJobSendResponse'; $request = $this->signatureRequestBulkSendWithTemplateRequest($signature_request_bulk_send_with_template_request, $contentType); @@ -729,9 +757,9 @@ public function signatureRequestBulkSendWithTemplateAsyncWithHttpInfo(Model\Sign ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -740,7 +768,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -754,7 +782,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -763,22 +791,24 @@ function ($exception) { /** * Create request for operation 'signatureRequestBulkSendWithTemplate' * - * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestBulkSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkSendWithTemplateRequest(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) + public function signatureRequestBulkSendWithTemplateRequest($signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) { + // verify the required parameter 'signature_request_bulk_send_with_template_request' is set if ($signature_request_bulk_send_with_template_request === null || (is_array($signature_request_bulk_send_with_template_request) && count($signature_request_bulk_send_with_template_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_bulk_send_with_template_request when calling signatureRequestBulkSendWithTemplate' ); } + $resourcePath = '/signature_request/bulk_send_with_template'; $formParams = []; $queryParams = []; @@ -792,8 +822,11 @@ public function signatureRequestBulkSendWithTemplateRequest(Model\SignatureReque $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -801,7 +834,7 @@ public function signatureRequestBulkSendWithTemplateRequest(Model\SignatureReque // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_bulk_send_with_template_request)); } else { $httpBody = $signature_request_bulk_send_with_template_request; @@ -814,7 +847,7 @@ public function signatureRequestBulkSendWithTemplateRequest(Model\SignatureReque foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -831,8 +864,9 @@ public function signatureRequestBulkSendWithTemplateRequest(Model\SignatureReque $payloadHook('multipart', $multipartContents, $signature_request_bulk_send_with_template_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -875,12 +909,13 @@ public function signatureRequestBulkSendWithTemplateRequest(Model\SignatureReque * * Cancel Incomplete Signature Request * - * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) + * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) * * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return void */ - public function signatureRequestCancel(string $signature_request_id) + public function signatureRequestCancel($signature_request_id) { $this->signatureRequestCancelWithHttpInfo($signature_request_id); } @@ -890,15 +925,15 @@ public function signatureRequestCancel(string $signature_request_id) * * Cancel Incomplete Signature Request * - * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation + * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation * - * @return array of null, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestCancel. This method will eventually become unavailable */ - public function signatureRequestCancelWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) + public function signatureRequestCancelWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) { $request = $this->signatureRequestCancelRequest($signature_request_id, $contentType); @@ -910,14 +945,14 @@ public function signatureRequestCancelWithHttpInfo(string $signature_request_id, } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -925,25 +960,16 @@ public function signatureRequestCancelWithHttpInfo(string $signature_request_id, $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() - ); - } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } switch ($e->getCode()) { + } throw $e; } @@ -954,14 +980,14 @@ public function signatureRequestCancelWithHttpInfo(string $signature_request_id, * * Cancel Incomplete Signature Request * - * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation + * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestCancel. This method will eventually become unavailable */ - public function signatureRequestCancelAsync(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) + public function signatureRequestCancelAsync($signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) { return $this->signatureRequestCancelAsyncWithHttpInfo($signature_request_id, $contentType) ->then( @@ -976,14 +1002,14 @@ function ($response) { * * Cancel Incomplete Signature Request * - * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation + * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestCancel. This method will eventually become unavailable */ - public function signatureRequestCancelAsyncWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) + public function signatureRequestCancelAsyncWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) { $returnType = ''; $request = $this->signatureRequestCancelRequest($signature_request_id, $contentType); @@ -991,7 +1017,7 @@ public function signatureRequestCancelAsyncWithHttpInfo(string $signature_reques return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( - function ($response) { + function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { @@ -1005,7 +1031,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1014,22 +1040,24 @@ function ($exception) { /** * Create request for operation 'signatureRequestCancel' * - * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation + * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestCancel. This method will eventually become unavailable */ - public function signatureRequestCancelRequest(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) + public function signatureRequestCancelRequest($signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) { + // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestCancel' ); } + $resourcePath = '/signature_request/cancel/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -1037,17 +1065,20 @@ public function signatureRequestCancelRequest(string $signature_request_id, stri $httpBody = ''; $multipart = false; + + // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{signature_request_id}', + '{' . 'signature_request_id' . '}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1061,7 +1092,7 @@ public function signatureRequestCancelRequest(string $signature_request_id, stri foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1075,8 +1106,9 @@ public function signatureRequestCancelRequest(string $signature_request_id, stri } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1119,13 +1151,13 @@ public function signatureRequestCancelRequest(string $signature_request_id, stri * * Create Embedded Signature Request * - * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request signature_request_create_embedded_request (required) + * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request signature_request_create_embedded_request (required) * - * @return Model\SignatureRequestGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\SignatureRequestGetResponse */ - public function signatureRequestCreateEmbedded(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request) + public function signatureRequestCreateEmbedded($signature_request_create_embedded_request) { list($response) = $this->signatureRequestCreateEmbeddedWithHttpInfo($signature_request_create_embedded_request); return $response; @@ -1136,15 +1168,15 @@ public function signatureRequestCreateEmbedded(Model\SignatureRequestCreateEmbed * * Create Embedded Signature Request * - * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation + * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation * - * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestCreateEmbedded. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedWithHttpInfo(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) + public function signatureRequestCreateEmbeddedWithHttpInfo($signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) { $request = $this->signatureRequestCreateEmbeddedRequest($signature_request_create_embedded_request, $contentType); @@ -1156,14 +1188,14 @@ public function signatureRequestCreateEmbeddedWithHttpInfo(Model\SignatureReques } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -1171,18 +1203,6 @@ public function signatureRequestCreateEmbeddedWithHttpInfo(Model\SignatureReques $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -1193,16 +1213,17 @@ public function signatureRequestCreateEmbeddedWithHttpInfo(Model\SignatureReques return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1219,19 +1240,33 @@ public function signatureRequestCreateEmbeddedWithHttpInfo(Model\SignatureReques return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1248,9 +1283,11 @@ public function signatureRequestCreateEmbeddedWithHttpInfo(Model\SignatureReques return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1263,6 +1300,7 @@ public function signatureRequestCreateEmbeddedWithHttpInfo(Model\SignatureReques ); $e->setResponseObject($data); break; + } throw $e; } @@ -1273,14 +1311,14 @@ public function signatureRequestCreateEmbeddedWithHttpInfo(Model\SignatureReques * * Create Embedded Signature Request * - * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation + * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestCreateEmbedded. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedAsync(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) + public function signatureRequestCreateEmbeddedAsync($signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) { return $this->signatureRequestCreateEmbeddedAsyncWithHttpInfo($signature_request_create_embedded_request, $contentType) ->then( @@ -1295,14 +1333,14 @@ function ($response) { * * Create Embedded Signature Request * - * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation + * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestCreateEmbedded. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedAsyncWithHttpInfo(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) + public function signatureRequestCreateEmbeddedAsyncWithHttpInfo($signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestCreateEmbeddedRequest($signature_request_create_embedded_request, $contentType); @@ -1312,9 +1350,9 @@ public function signatureRequestCreateEmbeddedAsyncWithHttpInfo(Model\SignatureR ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1323,7 +1361,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -1337,7 +1375,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1346,22 +1384,24 @@ function ($exception) { /** * Create request for operation 'signatureRequestCreateEmbedded' * - * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation + * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestCreateEmbedded. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedRequest(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) + public function signatureRequestCreateEmbeddedRequest($signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) { + // verify the required parameter 'signature_request_create_embedded_request' is set if ($signature_request_create_embedded_request === null || (is_array($signature_request_create_embedded_request) && count($signature_request_create_embedded_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_create_embedded_request when calling signatureRequestCreateEmbedded' ); } + $resourcePath = '/signature_request/create_embedded'; $formParams = []; $queryParams = []; @@ -1375,8 +1415,11 @@ public function signatureRequestCreateEmbeddedRequest(Model\SignatureRequestCrea $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1384,7 +1427,7 @@ public function signatureRequestCreateEmbeddedRequest(Model\SignatureRequestCrea // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_create_embedded_request)); } else { $httpBody = $signature_request_create_embedded_request; @@ -1397,7 +1440,7 @@ public function signatureRequestCreateEmbeddedRequest(Model\SignatureRequestCrea foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1414,8 +1457,9 @@ public function signatureRequestCreateEmbeddedRequest(Model\SignatureRequestCrea $payloadHook('multipart', $multipartContents, $signature_request_create_embedded_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1458,13 +1502,13 @@ public function signatureRequestCreateEmbeddedRequest(Model\SignatureRequestCrea * * Create Embedded Signature Request with Template * - * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request signature_request_create_embedded_with_template_request (required) + * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request signature_request_create_embedded_with_template_request (required) * - * @return Model\SignatureRequestGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\SignatureRequestGetResponse */ - public function signatureRequestCreateEmbeddedWithTemplate(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request) + public function signatureRequestCreateEmbeddedWithTemplate($signature_request_create_embedded_with_template_request) { list($response) = $this->signatureRequestCreateEmbeddedWithTemplateWithHttpInfo($signature_request_create_embedded_with_template_request); return $response; @@ -1475,15 +1519,15 @@ public function signatureRequestCreateEmbeddedWithTemplate(Model\SignatureReques * * Create Embedded Signature Request with Template * - * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) + public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo($signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) { $request = $this->signatureRequestCreateEmbeddedWithTemplateRequest($signature_request_create_embedded_with_template_request, $contentType); @@ -1495,14 +1539,14 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(Model\Sig } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -1510,18 +1554,6 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(Model\Sig $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -1532,16 +1564,17 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(Model\Sig return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1558,19 +1591,33 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(Model\Sig return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1587,9 +1634,11 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(Model\Sig return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1602,6 +1651,7 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(Model\Sig ); $e->setResponseObject($data); break; + } throw $e; } @@ -1612,14 +1662,14 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(Model\Sig * * Create Embedded Signature Request with Template * - * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedWithTemplateAsync(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) + public function signatureRequestCreateEmbeddedWithTemplateAsync($signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) { return $this->signatureRequestCreateEmbeddedWithTemplateAsyncWithHttpInfo($signature_request_create_embedded_with_template_request, $contentType) ->then( @@ -1634,14 +1684,14 @@ function ($response) { * * Create Embedded Signature Request with Template * - * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedWithTemplateAsyncWithHttpInfo(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) + public function signatureRequestCreateEmbeddedWithTemplateAsyncWithHttpInfo($signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestCreateEmbeddedWithTemplateRequest($signature_request_create_embedded_with_template_request, $contentType); @@ -1651,9 +1701,9 @@ public function signatureRequestCreateEmbeddedWithTemplateAsyncWithHttpInfo(Mode ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1662,7 +1712,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -1676,7 +1726,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1685,22 +1735,24 @@ function ($exception) { /** * Create request for operation 'signatureRequestCreateEmbeddedWithTemplate' * - * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedWithTemplateRequest(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) + public function signatureRequestCreateEmbeddedWithTemplateRequest($signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) { + // verify the required parameter 'signature_request_create_embedded_with_template_request' is set if ($signature_request_create_embedded_with_template_request === null || (is_array($signature_request_create_embedded_with_template_request) && count($signature_request_create_embedded_with_template_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_create_embedded_with_template_request when calling signatureRequestCreateEmbeddedWithTemplate' ); } + $resourcePath = '/signature_request/create_embedded_with_template'; $formParams = []; $queryParams = []; @@ -1714,8 +1766,11 @@ public function signatureRequestCreateEmbeddedWithTemplateRequest(Model\Signatur $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1723,7 +1778,7 @@ public function signatureRequestCreateEmbeddedWithTemplateRequest(Model\Signatur // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_create_embedded_with_template_request)); } else { $httpBody = $signature_request_create_embedded_with_template_request; @@ -1736,7 +1791,7 @@ public function signatureRequestCreateEmbeddedWithTemplateRequest(Model\Signatur foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1753,8 +1808,9 @@ public function signatureRequestCreateEmbeddedWithTemplateRequest(Model\Signatur $payloadHook('multipart', $multipartContents, $signature_request_create_embedded_with_template_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1797,14 +1853,14 @@ public function signatureRequestCreateEmbeddedWithTemplateRequest(Model\Signatur * * Edit Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditRequest $signature_request_edit_request signature_request_edit_request (required) + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditRequest $signature_request_edit_request signature_request_edit_request (required) * - * @return Model\SignatureRequestGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\SignatureRequestGetResponse */ - public function signatureRequestEdit(string $signature_request_id, Model\SignatureRequestEditRequest $signature_request_edit_request) + public function signatureRequestEdit($signature_request_id, $signature_request_edit_request) { list($response) = $this->signatureRequestEditWithHttpInfo($signature_request_id, $signature_request_edit_request); return $response; @@ -1815,16 +1871,16 @@ public function signatureRequestEdit(string $signature_request_id, Model\Signatu * * Edit Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation * - * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestEdit. This method will eventually become unavailable */ - public function signatureRequestEditWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditRequest $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) + public function signatureRequestEditWithHttpInfo($signature_request_id, $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) { $request = $this->signatureRequestEditRequest($signature_request_id, $signature_request_edit_request, $contentType); @@ -1836,14 +1892,14 @@ public function signatureRequestEditWithHttpInfo(string $signature_request_id, M } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -1851,18 +1907,6 @@ public function signatureRequestEditWithHttpInfo(string $signature_request_id, M $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -1873,16 +1917,17 @@ public function signatureRequestEditWithHttpInfo(string $signature_request_id, M return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1899,19 +1944,33 @@ public function signatureRequestEditWithHttpInfo(string $signature_request_id, M return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1928,9 +1987,11 @@ public function signatureRequestEditWithHttpInfo(string $signature_request_id, M return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1943,6 +2004,7 @@ public function signatureRequestEditWithHttpInfo(string $signature_request_id, M ); $e->setResponseObject($data); break; + } throw $e; } @@ -1953,15 +2015,15 @@ public function signatureRequestEditWithHttpInfo(string $signature_request_id, M * * Edit Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEdit. This method will eventually become unavailable */ - public function signatureRequestEditAsync(string $signature_request_id, Model\SignatureRequestEditRequest $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) + public function signatureRequestEditAsync($signature_request_id, $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) { return $this->signatureRequestEditAsyncWithHttpInfo($signature_request_id, $signature_request_edit_request, $contentType) ->then( @@ -1976,15 +2038,15 @@ function ($response) { * * Edit Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEdit. This method will eventually become unavailable */ - public function signatureRequestEditAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditRequest $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) + public function signatureRequestEditAsyncWithHttpInfo($signature_request_id, $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestEditRequest($signature_request_id, $signature_request_edit_request, $contentType); @@ -1994,9 +2056,9 @@ public function signatureRequestEditAsyncWithHttpInfo(string $signature_request_ ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2005,7 +2067,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -2019,7 +2081,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -2028,30 +2090,32 @@ function ($exception) { /** * Create request for operation 'signatureRequestEdit' * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestEdit. This method will eventually become unavailable */ - public function signatureRequestEditRequest(string $signature_request_id, Model\SignatureRequestEditRequest $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) + public function signatureRequestEditRequest($signature_request_id, $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) { + // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestEdit' ); } // verify the required parameter 'signature_request_edit_request' is set if ($signature_request_edit_request === null || (is_array($signature_request_edit_request) && count($signature_request_edit_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_edit_request when calling signatureRequestEdit' ); } + $resourcePath = '/signature_request/edit/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -2065,17 +2129,19 @@ public function signatureRequestEditRequest(string $signature_request_id, Model\ $multipart = !empty($formParams); + // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{signature_request_id}', + '{' . 'signature_request_id' . '}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -2083,7 +2149,7 @@ public function signatureRequestEditRequest(string $signature_request_id, Model\ // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_edit_request)); } else { $httpBody = $signature_request_edit_request; @@ -2096,7 +2162,7 @@ public function signatureRequestEditRequest(string $signature_request_id, Model\ foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -2113,8 +2179,9 @@ public function signatureRequestEditRequest(string $signature_request_id, Model\ $payloadHook('multipart', $multipartContents, $signature_request_edit_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2157,14 +2224,14 @@ public function signatureRequestEditRequest(string $signature_request_id, Model\ * * Edit Embedded Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request signature_request_edit_embedded_request (required) + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request signature_request_edit_embedded_request (required) * - * @return Model\SignatureRequestGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\SignatureRequestGetResponse */ - public function signatureRequestEditEmbedded(string $signature_request_id, Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request) + public function signatureRequestEditEmbedded($signature_request_id, $signature_request_edit_embedded_request) { list($response) = $this->signatureRequestEditEmbeddedWithHttpInfo($signature_request_id, $signature_request_edit_embedded_request); return $response; @@ -2175,16 +2242,16 @@ public function signatureRequestEditEmbedded(string $signature_request_id, Model * * Edit Embedded Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation * - * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestEditEmbedded. This method will eventually become unavailable */ - public function signatureRequestEditEmbeddedWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) + public function signatureRequestEditEmbeddedWithHttpInfo($signature_request_id, $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) { $request = $this->signatureRequestEditEmbeddedRequest($signature_request_id, $signature_request_edit_embedded_request, $contentType); @@ -2196,14 +2263,14 @@ public function signatureRequestEditEmbeddedWithHttpInfo(string $signature_reque } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -2211,18 +2278,6 @@ public function signatureRequestEditEmbeddedWithHttpInfo(string $signature_reque $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -2233,16 +2288,17 @@ public function signatureRequestEditEmbeddedWithHttpInfo(string $signature_reque return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2259,19 +2315,33 @@ public function signatureRequestEditEmbeddedWithHttpInfo(string $signature_reque return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2288,9 +2358,11 @@ public function signatureRequestEditEmbeddedWithHttpInfo(string $signature_reque return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2303,6 +2375,7 @@ public function signatureRequestEditEmbeddedWithHttpInfo(string $signature_reque ); $e->setResponseObject($data); break; + } throw $e; } @@ -2313,15 +2386,15 @@ public function signatureRequestEditEmbeddedWithHttpInfo(string $signature_reque * * Edit Embedded Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEditEmbedded. This method will eventually become unavailable */ - public function signatureRequestEditEmbeddedAsync(string $signature_request_id, Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) + public function signatureRequestEditEmbeddedAsync($signature_request_id, $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) { return $this->signatureRequestEditEmbeddedAsyncWithHttpInfo($signature_request_id, $signature_request_edit_embedded_request, $contentType) ->then( @@ -2336,15 +2409,15 @@ function ($response) { * * Edit Embedded Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEditEmbedded. This method will eventually become unavailable */ - public function signatureRequestEditEmbeddedAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) + public function signatureRequestEditEmbeddedAsyncWithHttpInfo($signature_request_id, $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestEditEmbeddedRequest($signature_request_id, $signature_request_edit_embedded_request, $contentType); @@ -2354,9 +2427,9 @@ public function signatureRequestEditEmbeddedAsyncWithHttpInfo(string $signature_ ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2365,7 +2438,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -2379,7 +2452,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -2388,30 +2461,32 @@ function ($exception) { /** * Create request for operation 'signatureRequestEditEmbedded' * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestEditEmbedded. This method will eventually become unavailable */ - public function signatureRequestEditEmbeddedRequest(string $signature_request_id, Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) + public function signatureRequestEditEmbeddedRequest($signature_request_id, $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) { + // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestEditEmbedded' ); } // verify the required parameter 'signature_request_edit_embedded_request' is set if ($signature_request_edit_embedded_request === null || (is_array($signature_request_edit_embedded_request) && count($signature_request_edit_embedded_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_edit_embedded_request when calling signatureRequestEditEmbedded' ); } + $resourcePath = '/signature_request/edit_embedded/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -2425,17 +2500,19 @@ public function signatureRequestEditEmbeddedRequest(string $signature_request_id $multipart = !empty($formParams); + // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{signature_request_id}', + '{' . 'signature_request_id' . '}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -2443,7 +2520,7 @@ public function signatureRequestEditEmbeddedRequest(string $signature_request_id // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_edit_embedded_request)); } else { $httpBody = $signature_request_edit_embedded_request; @@ -2456,7 +2533,7 @@ public function signatureRequestEditEmbeddedRequest(string $signature_request_id foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -2473,8 +2550,9 @@ public function signatureRequestEditEmbeddedRequest(string $signature_request_id $payloadHook('multipart', $multipartContents, $signature_request_edit_embedded_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2517,14 +2595,14 @@ public function signatureRequestEditEmbeddedRequest(string $signature_request_id * * Edit Embedded Signature Request with Template * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request signature_request_edit_embedded_with_template_request (required) + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request signature_request_edit_embedded_with_template_request (required) * - * @return Model\SignatureRequestGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\SignatureRequestGetResponse */ - public function signatureRequestEditEmbeddedWithTemplate(string $signature_request_id, Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request) + public function signatureRequestEditEmbeddedWithTemplate($signature_request_id, $signature_request_edit_embedded_with_template_request) { list($response) = $this->signatureRequestEditEmbeddedWithTemplateWithHttpInfo($signature_request_id, $signature_request_edit_embedded_with_template_request); return $response; @@ -2535,16 +2613,16 @@ public function signatureRequestEditEmbeddedWithTemplate(string $signature_reque * * Edit Embedded Signature Request with Template * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation * - * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestEditEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) + public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo($signature_request_id, $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) { $request = $this->signatureRequestEditEmbeddedWithTemplateRequest($signature_request_id, $signature_request_edit_embedded_with_template_request, $contentType); @@ -2556,14 +2634,14 @@ public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo(string $sig } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -2571,18 +2649,6 @@ public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo(string $sig $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -2593,16 +2659,17 @@ public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo(string $sig return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2619,19 +2686,33 @@ public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo(string $sig return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2648,9 +2729,11 @@ public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo(string $sig return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2663,6 +2746,7 @@ public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo(string $sig ); $e->setResponseObject($data); break; + } throw $e; } @@ -2673,15 +2757,15 @@ public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo(string $sig * * Edit Embedded Signature Request with Template * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEditEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestEditEmbeddedWithTemplateAsync(string $signature_request_id, Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) + public function signatureRequestEditEmbeddedWithTemplateAsync($signature_request_id, $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) { return $this->signatureRequestEditEmbeddedWithTemplateAsyncWithHttpInfo($signature_request_id, $signature_request_edit_embedded_with_template_request, $contentType) ->then( @@ -2696,15 +2780,15 @@ function ($response) { * * Edit Embedded Signature Request with Template * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEditEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestEditEmbeddedWithTemplateAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) + public function signatureRequestEditEmbeddedWithTemplateAsyncWithHttpInfo($signature_request_id, $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestEditEmbeddedWithTemplateRequest($signature_request_id, $signature_request_edit_embedded_with_template_request, $contentType); @@ -2714,9 +2798,9 @@ public function signatureRequestEditEmbeddedWithTemplateAsyncWithHttpInfo(string ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2725,7 +2809,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -2739,7 +2823,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -2748,30 +2832,32 @@ function ($exception) { /** * Create request for operation 'signatureRequestEditEmbeddedWithTemplate' * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestEditEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestEditEmbeddedWithTemplateRequest(string $signature_request_id, Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) + public function signatureRequestEditEmbeddedWithTemplateRequest($signature_request_id, $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) { + // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestEditEmbeddedWithTemplate' ); } // verify the required parameter 'signature_request_edit_embedded_with_template_request' is set if ($signature_request_edit_embedded_with_template_request === null || (is_array($signature_request_edit_embedded_with_template_request) && count($signature_request_edit_embedded_with_template_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_edit_embedded_with_template_request when calling signatureRequestEditEmbeddedWithTemplate' ); } + $resourcePath = '/signature_request/edit_embedded_with_template/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -2785,17 +2871,19 @@ public function signatureRequestEditEmbeddedWithTemplateRequest(string $signatur $multipart = !empty($formParams); + // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{signature_request_id}', + '{' . 'signature_request_id' . '}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -2803,7 +2891,7 @@ public function signatureRequestEditEmbeddedWithTemplateRequest(string $signatur // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_edit_embedded_with_template_request)); } else { $httpBody = $signature_request_edit_embedded_with_template_request; @@ -2816,7 +2904,7 @@ public function signatureRequestEditEmbeddedWithTemplateRequest(string $signatur foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -2833,8 +2921,9 @@ public function signatureRequestEditEmbeddedWithTemplateRequest(string $signatur $payloadHook('multipart', $multipartContents, $signature_request_edit_embedded_with_template_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2877,14 +2966,14 @@ public function signatureRequestEditEmbeddedWithTemplateRequest(string $signatur * * Edit Signature Request With Template * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request signature_request_edit_with_template_request (required) + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request signature_request_edit_with_template_request (required) * - * @return Model\SignatureRequestGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\SignatureRequestGetResponse */ - public function signatureRequestEditWithTemplate(string $signature_request_id, Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request) + public function signatureRequestEditWithTemplate($signature_request_id, $signature_request_edit_with_template_request) { list($response) = $this->signatureRequestEditWithTemplateWithHttpInfo($signature_request_id, $signature_request_edit_with_template_request); return $response; @@ -2895,16 +2984,16 @@ public function signatureRequestEditWithTemplate(string $signature_request_id, M * * Edit Signature Request With Template * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation * - * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestEditWithTemplate. This method will eventually become unavailable */ - public function signatureRequestEditWithTemplateWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) + public function signatureRequestEditWithTemplateWithHttpInfo($signature_request_id, $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) { $request = $this->signatureRequestEditWithTemplateRequest($signature_request_id, $signature_request_edit_with_template_request, $contentType); @@ -2916,14 +3005,14 @@ public function signatureRequestEditWithTemplateWithHttpInfo(string $signature_r } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -2931,18 +3020,6 @@ public function signatureRequestEditWithTemplateWithHttpInfo(string $signature_r $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -2953,16 +3030,17 @@ public function signatureRequestEditWithTemplateWithHttpInfo(string $signature_r return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2979,19 +3057,33 @@ public function signatureRequestEditWithTemplateWithHttpInfo(string $signature_r return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3008,9 +3100,11 @@ public function signatureRequestEditWithTemplateWithHttpInfo(string $signature_r return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -3023,6 +3117,7 @@ public function signatureRequestEditWithTemplateWithHttpInfo(string $signature_r ); $e->setResponseObject($data); break; + } throw $e; } @@ -3033,15 +3128,15 @@ public function signatureRequestEditWithTemplateWithHttpInfo(string $signature_r * * Edit Signature Request With Template * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEditWithTemplate. This method will eventually become unavailable */ - public function signatureRequestEditWithTemplateAsync(string $signature_request_id, Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) + public function signatureRequestEditWithTemplateAsync($signature_request_id, $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) { return $this->signatureRequestEditWithTemplateAsyncWithHttpInfo($signature_request_id, $signature_request_edit_with_template_request, $contentType) ->then( @@ -3056,15 +3151,15 @@ function ($response) { * * Edit Signature Request With Template * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEditWithTemplate. This method will eventually become unavailable */ - public function signatureRequestEditWithTemplateAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) + public function signatureRequestEditWithTemplateAsyncWithHttpInfo($signature_request_id, $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestEditWithTemplateRequest($signature_request_id, $signature_request_edit_with_template_request, $contentType); @@ -3074,9 +3169,9 @@ public function signatureRequestEditWithTemplateAsyncWithHttpInfo(string $signat ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -3085,7 +3180,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -3099,7 +3194,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -3108,30 +3203,32 @@ function ($exception) { /** * Create request for operation 'signatureRequestEditWithTemplate' * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestEditWithTemplate. This method will eventually become unavailable */ - public function signatureRequestEditWithTemplateRequest(string $signature_request_id, Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) + public function signatureRequestEditWithTemplateRequest($signature_request_id, $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) { + // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestEditWithTemplate' ); } // verify the required parameter 'signature_request_edit_with_template_request' is set if ($signature_request_edit_with_template_request === null || (is_array($signature_request_edit_with_template_request) && count($signature_request_edit_with_template_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_edit_with_template_request when calling signatureRequestEditWithTemplate' ); } + $resourcePath = '/signature_request/edit_with_template/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -3145,17 +3242,19 @@ public function signatureRequestEditWithTemplateRequest(string $signature_reques $multipart = !empty($formParams); + // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{signature_request_id}', + '{' . 'signature_request_id' . '}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -3163,7 +3262,7 @@ public function signatureRequestEditWithTemplateRequest(string $signature_reques // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_edit_with_template_request)); } else { $httpBody = $signature_request_edit_with_template_request; @@ -3176,7 +3275,7 @@ public function signatureRequestEditWithTemplateRequest(string $signature_reques foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -3193,8 +3292,9 @@ public function signatureRequestEditWithTemplateRequest(string $signature_reques $payloadHook('multipart', $multipartContents, $signature_request_edit_with_template_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -3237,14 +3337,14 @@ public function signatureRequestEditWithTemplateRequest(string $signature_reques * * Download Files * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') * - * @return SplFileObject * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \SplFileObject|\Dropbox\Sign\Model\ErrorResponse */ - public function signatureRequestFiles(string $signature_request_id, string $file_type = 'pdf') + public function signatureRequestFiles($signature_request_id, $file_type = 'pdf') { list($response) = $this->signatureRequestFilesWithHttpInfo($signature_request_id, $file_type); return $response; @@ -3255,16 +3355,16 @@ public function signatureRequestFiles(string $signature_request_id, string $file * * Download Files * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation * - * @return array of \SplFileObject|\Dropbox\Sign\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of \SplFileObject|\Dropbox\Sign\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestFiles. This method will eventually become unavailable */ - public function signatureRequestFilesWithHttpInfo(string $signature_request_id, string $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) + public function signatureRequestFilesWithHttpInfo($signature_request_id, $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) { $request = $this->signatureRequestFilesRequest($signature_request_id, $file_type, $contentType); @@ -3276,14 +3376,14 @@ public function signatureRequestFilesWithHttpInfo(string $signature_request_id, } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -3291,18 +3391,6 @@ public function signatureRequestFilesWithHttpInfo(string $signature_request_id, $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -3313,16 +3401,17 @@ public function signatureRequestFilesWithHttpInfo(string $signature_request_id, return $result; } + switch ($statusCode) { case 200: if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\SplFileObject' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3339,19 +3428,33 @@ public function signatureRequestFilesWithHttpInfo(string $signature_request_id, return [ ObjectSerializer::deserialize($content, '\SplFileObject', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\SplFileObject'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3368,9 +3471,11 @@ public function signatureRequestFilesWithHttpInfo(string $signature_request_id, return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -3383,6 +3488,7 @@ public function signatureRequestFilesWithHttpInfo(string $signature_request_id, ); $e->setResponseObject($data); break; + } throw $e; } @@ -3393,15 +3499,15 @@ public function signatureRequestFilesWithHttpInfo(string $signature_request_id, * * Download Files * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestFiles. This method will eventually become unavailable */ - public function signatureRequestFilesAsync(string $signature_request_id, string $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) + public function signatureRequestFilesAsync($signature_request_id, $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) { return $this->signatureRequestFilesAsyncWithHttpInfo($signature_request_id, $file_type, $contentType) ->then( @@ -3416,15 +3522,15 @@ function ($response) { * * Download Files * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestFiles. This method will eventually become unavailable */ - public function signatureRequestFilesAsyncWithHttpInfo(string $signature_request_id, string $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) + public function signatureRequestFilesAsyncWithHttpInfo($signature_request_id, $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) { $returnType = '\SplFileObject'; $request = $this->signatureRequestFilesRequest($signature_request_id, $file_type, $contentType); @@ -3434,9 +3540,9 @@ public function signatureRequestFilesAsyncWithHttpInfo(string $signature_request ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -3445,7 +3551,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -3459,7 +3565,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -3468,23 +3574,26 @@ function ($exception) { /** * Create request for operation 'signatureRequestFiles' * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestFiles. This method will eventually become unavailable */ - public function signatureRequestFilesRequest(string $signature_request_id, string $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) + public function signatureRequestFilesRequest($signature_request_id, $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) { + // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestFiles' ); } + + $resourcePath = '/signature_request/files/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -3502,17 +3611,19 @@ public function signatureRequestFilesRequest(string $signature_request_id, strin false // required ) ?? []); + // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{signature_request_id}', + '{' . 'signature_request_id' . '}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/pdf', 'application/zip', 'application/json'], + $multipart ? ['multipart/form-data'] : ['application/pdf', 'application/zip', 'application/json', ], $contentType, $multipart ); @@ -3526,7 +3637,7 @@ public function signatureRequestFilesRequest(string $signature_request_id, strin foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -3540,8 +3651,9 @@ public function signatureRequestFilesRequest(string $signature_request_id, strin } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -3584,13 +3696,13 @@ public function signatureRequestFilesRequest(string $signature_request_id, strin * * Download Files as Data Uri * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) * - * @return Model\FileResponseDataUri * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\FileResponseDataUri */ - public function signatureRequestFilesAsDataUri(string $signature_request_id) + public function signatureRequestFilesAsDataUri($signature_request_id) { list($response) = $this->signatureRequestFilesAsDataUriWithHttpInfo($signature_request_id); return $response; @@ -3601,15 +3713,15 @@ public function signatureRequestFilesAsDataUri(string $signature_request_id) * * Download Files as Data Uri * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation * - * @return array of Model\FileResponseDataUri, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\FileResponseDataUri, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestFilesAsDataUri. This method will eventually become unavailable */ - public function signatureRequestFilesAsDataUriWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) + public function signatureRequestFilesAsDataUriWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) { $request = $this->signatureRequestFilesAsDataUriRequest($signature_request_id, $contentType); @@ -3621,14 +3733,14 @@ public function signatureRequestFilesAsDataUriWithHttpInfo(string $signature_req } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -3636,18 +3748,6 @@ public function signatureRequestFilesAsDataUriWithHttpInfo(string $signature_req $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -3658,16 +3758,17 @@ public function signatureRequestFilesAsDataUriWithHttpInfo(string $signature_req return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FileResponseDataUri' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\FileResponseDataUri' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3684,19 +3785,33 @@ public function signatureRequestFilesAsDataUriWithHttpInfo(string $signature_req return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FileResponseDataUri', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\FileResponseDataUri'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3713,9 +3828,11 @@ public function signatureRequestFilesAsDataUriWithHttpInfo(string $signature_req return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -3728,6 +3845,7 @@ public function signatureRequestFilesAsDataUriWithHttpInfo(string $signature_req ); $e->setResponseObject($data); break; + } throw $e; } @@ -3738,14 +3856,14 @@ public function signatureRequestFilesAsDataUriWithHttpInfo(string $signature_req * * Download Files as Data Uri * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestFilesAsDataUri. This method will eventually become unavailable */ - public function signatureRequestFilesAsDataUriAsync(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) + public function signatureRequestFilesAsDataUriAsync($signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) { return $this->signatureRequestFilesAsDataUriAsyncWithHttpInfo($signature_request_id, $contentType) ->then( @@ -3760,14 +3878,14 @@ function ($response) { * * Download Files as Data Uri * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestFilesAsDataUri. This method will eventually become unavailable */ - public function signatureRequestFilesAsDataUriAsyncWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) + public function signatureRequestFilesAsDataUriAsyncWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) { $returnType = '\Dropbox\Sign\Model\FileResponseDataUri'; $request = $this->signatureRequestFilesAsDataUriRequest($signature_request_id, $contentType); @@ -3777,9 +3895,9 @@ public function signatureRequestFilesAsDataUriAsyncWithHttpInfo(string $signatur ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -3788,7 +3906,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -3802,7 +3920,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -3811,22 +3929,24 @@ function ($exception) { /** * Create request for operation 'signatureRequestFilesAsDataUri' * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestFilesAsDataUri. This method will eventually become unavailable */ - public function signatureRequestFilesAsDataUriRequest(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) + public function signatureRequestFilesAsDataUriRequest($signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) { + // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestFilesAsDataUri' ); } + $resourcePath = '/signature_request/files_as_data_uri/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -3834,17 +3954,20 @@ public function signatureRequestFilesAsDataUriRequest(string $signature_request_ $httpBody = ''; $multipart = false; + + // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{signature_request_id}', + '{' . 'signature_request_id' . '}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -3858,7 +3981,7 @@ public function signatureRequestFilesAsDataUriRequest(string $signature_request_ foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -3872,8 +3995,9 @@ public function signatureRequestFilesAsDataUriRequest(string $signature_request_ } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -3916,14 +4040,14 @@ public function signatureRequestFilesAsDataUriRequest(string $signature_request_ * * Download Files as File Url * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) * - * @return Model\FileResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\FileResponse */ - public function signatureRequestFilesAsFileUrl(string $signature_request_id, int $force_download = 1) + public function signatureRequestFilesAsFileUrl($signature_request_id, $force_download = 1) { list($response) = $this->signatureRequestFilesAsFileUrlWithHttpInfo($signature_request_id, $force_download); return $response; @@ -3934,16 +4058,16 @@ public function signatureRequestFilesAsFileUrl(string $signature_request_id, int * * Download Files as File Url * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation * - * @return array of Model\FileResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\FileResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestFilesAsFileUrl. This method will eventually become unavailable */ - public function signatureRequestFilesAsFileUrlWithHttpInfo(string $signature_request_id, int $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) + public function signatureRequestFilesAsFileUrlWithHttpInfo($signature_request_id, $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) { $request = $this->signatureRequestFilesAsFileUrlRequest($signature_request_id, $force_download, $contentType); @@ -3955,14 +4079,14 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo(string $signature_req } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -3970,18 +4094,6 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo(string $signature_req $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -3992,16 +4104,17 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo(string $signature_req return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FileResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\FileResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -4018,19 +4131,33 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo(string $signature_req return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FileResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\FileResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -4047,9 +4174,11 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo(string $signature_req return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -4062,6 +4191,7 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo(string $signature_req ); $e->setResponseObject($data); break; + } throw $e; } @@ -4072,15 +4202,15 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo(string $signature_req * * Download Files as File Url * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestFilesAsFileUrl. This method will eventually become unavailable */ - public function signatureRequestFilesAsFileUrlAsync(string $signature_request_id, int $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) + public function signatureRequestFilesAsFileUrlAsync($signature_request_id, $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) { return $this->signatureRequestFilesAsFileUrlAsyncWithHttpInfo($signature_request_id, $force_download, $contentType) ->then( @@ -4095,15 +4225,15 @@ function ($response) { * * Download Files as File Url * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestFilesAsFileUrl. This method will eventually become unavailable */ - public function signatureRequestFilesAsFileUrlAsyncWithHttpInfo(string $signature_request_id, int $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) + public function signatureRequestFilesAsFileUrlAsyncWithHttpInfo($signature_request_id, $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) { $returnType = '\Dropbox\Sign\Model\FileResponse'; $request = $this->signatureRequestFilesAsFileUrlRequest($signature_request_id, $force_download, $contentType); @@ -4113,9 +4243,9 @@ public function signatureRequestFilesAsFileUrlAsyncWithHttpInfo(string $signatur ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -4124,7 +4254,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -4138,7 +4268,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -4147,23 +4277,26 @@ function ($exception) { /** * Create request for operation 'signatureRequestFilesAsFileUrl' * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestFilesAsFileUrl. This method will eventually become unavailable */ - public function signatureRequestFilesAsFileUrlRequest(string $signature_request_id, int $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) + public function signatureRequestFilesAsFileUrlRequest($signature_request_id, $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) { + // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestFilesAsFileUrl' ); } + + $resourcePath = '/signature_request/files_as_file_url/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -4181,17 +4314,19 @@ public function signatureRequestFilesAsFileUrlRequest(string $signature_request_ false // required ) ?? []); + // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{signature_request_id}', + '{' . 'signature_request_id' . '}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -4205,7 +4340,7 @@ public function signatureRequestFilesAsFileUrlRequest(string $signature_request_ foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -4219,8 +4354,9 @@ public function signatureRequestFilesAsFileUrlRequest(string $signature_request_ } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -4263,13 +4399,13 @@ public function signatureRequestFilesAsFileUrlRequest(string $signature_request_ * * Get Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) * - * @return Model\SignatureRequestGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\SignatureRequestGetResponse */ - public function signatureRequestGet(string $signature_request_id) + public function signatureRequestGet($signature_request_id) { list($response) = $this->signatureRequestGetWithHttpInfo($signature_request_id); return $response; @@ -4280,15 +4416,15 @@ public function signatureRequestGet(string $signature_request_id) * * Get Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation * - * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestGet. This method will eventually become unavailable */ - public function signatureRequestGetWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) + public function signatureRequestGetWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) { $request = $this->signatureRequestGetRequest($signature_request_id, $contentType); @@ -4300,14 +4436,14 @@ public function signatureRequestGetWithHttpInfo(string $signature_request_id, st } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -4315,18 +4451,6 @@ public function signatureRequestGetWithHttpInfo(string $signature_request_id, st $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -4337,16 +4461,17 @@ public function signatureRequestGetWithHttpInfo(string $signature_request_id, st return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -4363,19 +4488,33 @@ public function signatureRequestGetWithHttpInfo(string $signature_request_id, st return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -4392,9 +4531,11 @@ public function signatureRequestGetWithHttpInfo(string $signature_request_id, st return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -4407,6 +4548,7 @@ public function signatureRequestGetWithHttpInfo(string $signature_request_id, st ); $e->setResponseObject($data); break; + } throw $e; } @@ -4417,14 +4559,14 @@ public function signatureRequestGetWithHttpInfo(string $signature_request_id, st * * Get Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestGet. This method will eventually become unavailable */ - public function signatureRequestGetAsync(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) + public function signatureRequestGetAsync($signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) { return $this->signatureRequestGetAsyncWithHttpInfo($signature_request_id, $contentType) ->then( @@ -4439,14 +4581,14 @@ function ($response) { * * Get Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestGet. This method will eventually become unavailable */ - public function signatureRequestGetAsyncWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) + public function signatureRequestGetAsyncWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestGetRequest($signature_request_id, $contentType); @@ -4456,9 +4598,9 @@ public function signatureRequestGetAsyncWithHttpInfo(string $signature_request_i ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -4467,7 +4609,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -4481,7 +4623,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -4490,22 +4632,24 @@ function ($exception) { /** * Create request for operation 'signatureRequestGet' * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestGet. This method will eventually become unavailable */ - public function signatureRequestGetRequest(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) + public function signatureRequestGetRequest($signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) { + // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestGet' ); } + $resourcePath = '/signature_request/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -4513,17 +4657,20 @@ public function signatureRequestGetRequest(string $signature_request_id, string $httpBody = ''; $multipart = false; + + // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{signature_request_id}', + '{' . 'signature_request_id' . '}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -4537,7 +4684,7 @@ public function signatureRequestGetRequest(string $signature_request_id, string foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -4551,8 +4698,9 @@ public function signatureRequestGetRequest(string $signature_request_id, string } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -4595,16 +4743,16 @@ public function signatureRequestGetRequest(string $signature_request_id, string * * List Signature Requests * - * @param string $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param string|null $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) * - * @return Model\SignatureRequestListResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\SignatureRequestListResponse */ - public function signatureRequestList(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null) + public function signatureRequestList($account_id = null, $page = 1, $page_size = 20, $query = null) { list($response) = $this->signatureRequestListWithHttpInfo($account_id, $page, $page_size, $query); return $response; @@ -4615,18 +4763,18 @@ public function signatureRequestList(string $account_id = null, int $page = 1, i * * List Signature Requests * - * @param string $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation + * @param string|null $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation * - * @return array of Model\SignatureRequestListResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\SignatureRequestListResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestList. This method will eventually become unavailable */ - public function signatureRequestListWithHttpInfo(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) + public function signatureRequestListWithHttpInfo($account_id = null, $page = 1, $page_size = 20, $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) { $request = $this->signatureRequestListRequest($account_id, $page, $page_size, $query, $contentType); @@ -4638,14 +4786,14 @@ public function signatureRequestListWithHttpInfo(string $account_id = null, int } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -4653,18 +4801,6 @@ public function signatureRequestListWithHttpInfo(string $account_id = null, int $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -4675,16 +4811,17 @@ public function signatureRequestListWithHttpInfo(string $account_id = null, int return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestListResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestListResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -4701,19 +4838,33 @@ public function signatureRequestListWithHttpInfo(string $account_id = null, int return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestListResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestListResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -4730,9 +4881,11 @@ public function signatureRequestListWithHttpInfo(string $account_id = null, int return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -4745,6 +4898,7 @@ public function signatureRequestListWithHttpInfo(string $account_id = null, int ); $e->setResponseObject($data); break; + } throw $e; } @@ -4755,17 +4909,17 @@ public function signatureRequestListWithHttpInfo(string $account_id = null, int * * List Signature Requests * - * @param string $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation + * @param string|null $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestList. This method will eventually become unavailable */ - public function signatureRequestListAsync(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) + public function signatureRequestListAsync($account_id = null, $page = 1, $page_size = 20, $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) { return $this->signatureRequestListAsyncWithHttpInfo($account_id, $page, $page_size, $query, $contentType) ->then( @@ -4780,17 +4934,17 @@ function ($response) { * * List Signature Requests * - * @param string $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation + * @param string|null $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestList. This method will eventually become unavailable */ - public function signatureRequestListAsyncWithHttpInfo(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) + public function signatureRequestListAsyncWithHttpInfo($account_id = null, $page = 1, $page_size = 20, $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestListResponse'; $request = $this->signatureRequestListRequest($account_id, $page, $page_size, $query, $contentType); @@ -4800,9 +4954,9 @@ public function signatureRequestListAsyncWithHttpInfo(string $account_id = null, ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -4811,7 +4965,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -4825,7 +4979,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -4834,18 +4988,24 @@ function ($exception) { /** * Create request for operation 'signatureRequestList' * - * @param string $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation + * @param string|null $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestList. This method will eventually become unavailable */ - public function signatureRequestListRequest(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) + public function signatureRequestListRequest($account_id = null, $page = 1, $page_size = 20, $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) { + + + + + + $resourcePath = '/signature_request/list'; $formParams = []; $queryParams = []; @@ -4890,8 +5050,11 @@ public function signatureRequestListRequest(string $account_id = null, int $page false // required ) ?? []); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -4905,7 +5068,7 @@ public function signatureRequestListRequest(string $account_id = null, int $page foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -4919,8 +5082,9 @@ public function signatureRequestListRequest(string $account_id = null, int $page } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -4963,13 +5127,13 @@ public function signatureRequestListRequest(string $account_id = null, int $page * * Release On-Hold Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to release. (required) + * @param string $signature_request_id The id of the SignatureRequest to release. (required) * - * @return Model\SignatureRequestGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\SignatureRequestGetResponse */ - public function signatureRequestReleaseHold(string $signature_request_id) + public function signatureRequestReleaseHold($signature_request_id) { list($response) = $this->signatureRequestReleaseHoldWithHttpInfo($signature_request_id); return $response; @@ -4980,15 +5144,15 @@ public function signatureRequestReleaseHold(string $signature_request_id) * * Release On-Hold Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to release. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to release. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation * - * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestReleaseHold. This method will eventually become unavailable */ - public function signatureRequestReleaseHoldWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) + public function signatureRequestReleaseHoldWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) { $request = $this->signatureRequestReleaseHoldRequest($signature_request_id, $contentType); @@ -5000,14 +5164,14 @@ public function signatureRequestReleaseHoldWithHttpInfo(string $signature_reques } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -5015,18 +5179,6 @@ public function signatureRequestReleaseHoldWithHttpInfo(string $signature_reques $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -5037,16 +5189,17 @@ public function signatureRequestReleaseHoldWithHttpInfo(string $signature_reques return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -5063,19 +5216,33 @@ public function signatureRequestReleaseHoldWithHttpInfo(string $signature_reques return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -5092,9 +5259,11 @@ public function signatureRequestReleaseHoldWithHttpInfo(string $signature_reques return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -5107,6 +5276,7 @@ public function signatureRequestReleaseHoldWithHttpInfo(string $signature_reques ); $e->setResponseObject($data); break; + } throw $e; } @@ -5117,14 +5287,14 @@ public function signatureRequestReleaseHoldWithHttpInfo(string $signature_reques * * Release On-Hold Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to release. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to release. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestReleaseHold. This method will eventually become unavailable */ - public function signatureRequestReleaseHoldAsync(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) + public function signatureRequestReleaseHoldAsync($signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) { return $this->signatureRequestReleaseHoldAsyncWithHttpInfo($signature_request_id, $contentType) ->then( @@ -5139,14 +5309,14 @@ function ($response) { * * Release On-Hold Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to release. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to release. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestReleaseHold. This method will eventually become unavailable */ - public function signatureRequestReleaseHoldAsyncWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) + public function signatureRequestReleaseHoldAsyncWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestReleaseHoldRequest($signature_request_id, $contentType); @@ -5156,9 +5326,9 @@ public function signatureRequestReleaseHoldAsyncWithHttpInfo(string $signature_r ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -5167,7 +5337,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -5181,7 +5351,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -5190,22 +5360,24 @@ function ($exception) { /** * Create request for operation 'signatureRequestReleaseHold' * - * @param string $signature_request_id The id of the SignatureRequest to release. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to release. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestReleaseHold. This method will eventually become unavailable */ - public function signatureRequestReleaseHoldRequest(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) + public function signatureRequestReleaseHoldRequest($signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) { + // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestReleaseHold' ); } + $resourcePath = '/signature_request/release_hold/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -5213,17 +5385,20 @@ public function signatureRequestReleaseHoldRequest(string $signature_request_id, $httpBody = ''; $multipart = false; + + // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{signature_request_id}', + '{' . 'signature_request_id' . '}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -5237,7 +5412,7 @@ public function signatureRequestReleaseHoldRequest(string $signature_request_id, foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -5251,8 +5426,9 @@ public function signatureRequestReleaseHoldRequest(string $signature_request_id, } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -5295,14 +5471,14 @@ public function signatureRequestReleaseHoldRequest(string $signature_request_id, * * Send Request Reminder * - * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) - * @param Model\SignatureRequestRemindRequest $signature_request_remind_request signature_request_remind_request (required) + * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) + * @param Model\SignatureRequestRemindRequest $signature_request_remind_request signature_request_remind_request (required) * - * @return Model\SignatureRequestGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\SignatureRequestGetResponse */ - public function signatureRequestRemind(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request) + public function signatureRequestRemind($signature_request_id, $signature_request_remind_request) { list($response) = $this->signatureRequestRemindWithHttpInfo($signature_request_id, $signature_request_remind_request); return $response; @@ -5313,16 +5489,16 @@ public function signatureRequestRemind(string $signature_request_id, Model\Signa * * Send Request Reminder * - * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) - * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) + * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation * - * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestRemind. This method will eventually become unavailable */ - public function signatureRequestRemindWithHttpInfo(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) + public function signatureRequestRemindWithHttpInfo($signature_request_id, $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) { $request = $this->signatureRequestRemindRequest($signature_request_id, $signature_request_remind_request, $contentType); @@ -5334,14 +5510,14 @@ public function signatureRequestRemindWithHttpInfo(string $signature_request_id, } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -5349,18 +5525,6 @@ public function signatureRequestRemindWithHttpInfo(string $signature_request_id, $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -5371,16 +5535,17 @@ public function signatureRequestRemindWithHttpInfo(string $signature_request_id, return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -5397,19 +5562,33 @@ public function signatureRequestRemindWithHttpInfo(string $signature_request_id, return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -5426,9 +5605,11 @@ public function signatureRequestRemindWithHttpInfo(string $signature_request_id, return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -5441,6 +5622,7 @@ public function signatureRequestRemindWithHttpInfo(string $signature_request_id, ); $e->setResponseObject($data); break; + } throw $e; } @@ -5451,15 +5633,15 @@ public function signatureRequestRemindWithHttpInfo(string $signature_request_id, * * Send Request Reminder * - * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) - * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) + * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestRemind. This method will eventually become unavailable */ - public function signatureRequestRemindAsync(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) + public function signatureRequestRemindAsync($signature_request_id, $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) { return $this->signatureRequestRemindAsyncWithHttpInfo($signature_request_id, $signature_request_remind_request, $contentType) ->then( @@ -5474,15 +5656,15 @@ function ($response) { * * Send Request Reminder * - * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) - * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) + * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestRemind. This method will eventually become unavailable */ - public function signatureRequestRemindAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) + public function signatureRequestRemindAsyncWithHttpInfo($signature_request_id, $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestRemindRequest($signature_request_id, $signature_request_remind_request, $contentType); @@ -5492,9 +5674,9 @@ public function signatureRequestRemindAsyncWithHttpInfo(string $signature_reques ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -5503,7 +5685,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -5517,7 +5699,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -5526,30 +5708,32 @@ function ($exception) { /** * Create request for operation 'signatureRequestRemind' * - * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) - * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) + * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestRemind. This method will eventually become unavailable */ - public function signatureRequestRemindRequest(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) + public function signatureRequestRemindRequest($signature_request_id, $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) { + // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestRemind' ); } // verify the required parameter 'signature_request_remind_request' is set if ($signature_request_remind_request === null || (is_array($signature_request_remind_request) && count($signature_request_remind_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_remind_request when calling signatureRequestRemind' ); } + $resourcePath = '/signature_request/remind/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -5563,17 +5747,19 @@ public function signatureRequestRemindRequest(string $signature_request_id, Mode $multipart = !empty($formParams); + // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{signature_request_id}', + '{' . 'signature_request_id' . '}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -5581,7 +5767,7 @@ public function signatureRequestRemindRequest(string $signature_request_id, Mode // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_remind_request)); } else { $httpBody = $signature_request_remind_request; @@ -5594,7 +5780,7 @@ public function signatureRequestRemindRequest(string $signature_request_id, Mode foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -5611,8 +5797,9 @@ public function signatureRequestRemindRequest(string $signature_request_id, Mode $payloadHook('multipart', $multipartContents, $signature_request_remind_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -5655,12 +5842,13 @@ public function signatureRequestRemindRequest(string $signature_request_id, Mode * * Remove Signature Request Access * - * @param string $signature_request_id The id of the SignatureRequest to remove. (required) + * @param string $signature_request_id The id of the SignatureRequest to remove. (required) * * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return void */ - public function signatureRequestRemove(string $signature_request_id) + public function signatureRequestRemove($signature_request_id) { $this->signatureRequestRemoveWithHttpInfo($signature_request_id); } @@ -5670,15 +5858,15 @@ public function signatureRequestRemove(string $signature_request_id) * * Remove Signature Request Access * - * @param string $signature_request_id The id of the SignatureRequest to remove. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to remove. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation * - * @return array of null, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestRemove. This method will eventually become unavailable */ - public function signatureRequestRemoveWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) + public function signatureRequestRemoveWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) { $request = $this->signatureRequestRemoveRequest($signature_request_id, $contentType); @@ -5690,14 +5878,14 @@ public function signatureRequestRemoveWithHttpInfo(string $signature_request_id, } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -5705,25 +5893,16 @@ public function signatureRequestRemoveWithHttpInfo(string $signature_request_id, $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() - ); - } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } switch ($e->getCode()) { + } throw $e; } @@ -5734,14 +5913,14 @@ public function signatureRequestRemoveWithHttpInfo(string $signature_request_id, * * Remove Signature Request Access * - * @param string $signature_request_id The id of the SignatureRequest to remove. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to remove. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestRemove. This method will eventually become unavailable */ - public function signatureRequestRemoveAsync(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) + public function signatureRequestRemoveAsync($signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) { return $this->signatureRequestRemoveAsyncWithHttpInfo($signature_request_id, $contentType) ->then( @@ -5756,14 +5935,14 @@ function ($response) { * * Remove Signature Request Access * - * @param string $signature_request_id The id of the SignatureRequest to remove. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to remove. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestRemove. This method will eventually become unavailable */ - public function signatureRequestRemoveAsyncWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) + public function signatureRequestRemoveAsyncWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) { $returnType = ''; $request = $this->signatureRequestRemoveRequest($signature_request_id, $contentType); @@ -5771,7 +5950,7 @@ public function signatureRequestRemoveAsyncWithHttpInfo(string $signature_reques return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( - function ($response) { + function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { @@ -5785,7 +5964,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -5794,22 +5973,24 @@ function ($exception) { /** * Create request for operation 'signatureRequestRemove' * - * @param string $signature_request_id The id of the SignatureRequest to remove. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to remove. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestRemove. This method will eventually become unavailable */ - public function signatureRequestRemoveRequest(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) + public function signatureRequestRemoveRequest($signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) { + // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestRemove' ); } + $resourcePath = '/signature_request/remove/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -5817,17 +5998,20 @@ public function signatureRequestRemoveRequest(string $signature_request_id, stri $httpBody = ''; $multipart = false; + + // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{signature_request_id}', + '{' . 'signature_request_id' . '}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -5841,7 +6025,7 @@ public function signatureRequestRemoveRequest(string $signature_request_id, stri foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -5855,8 +6039,9 @@ public function signatureRequestRemoveRequest(string $signature_request_id, stri } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -5895,13 +6080,13 @@ public function signatureRequestRemoveRequest(string $signature_request_id, stri * * Send Signature Request * - * @param Model\SignatureRequestSendRequest $signature_request_send_request signature_request_send_request (required) + * @param Model\SignatureRequestSendRequest $signature_request_send_request signature_request_send_request (required) * - * @return Model\SignatureRequestGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\SignatureRequestGetResponse */ - public function signatureRequestSend(Model\SignatureRequestSendRequest $signature_request_send_request) + public function signatureRequestSend($signature_request_send_request) { list($response) = $this->signatureRequestSendWithHttpInfo($signature_request_send_request); return $response; @@ -5912,15 +6097,15 @@ public function signatureRequestSend(Model\SignatureRequestSendRequest $signatur * * Send Signature Request * - * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation + * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation * - * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestSend. This method will eventually become unavailable */ - public function signatureRequestSendWithHttpInfo(Model\SignatureRequestSendRequest $signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) + public function signatureRequestSendWithHttpInfo($signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) { $request = $this->signatureRequestSendRequest($signature_request_send_request, $contentType); @@ -5932,14 +6117,14 @@ public function signatureRequestSendWithHttpInfo(Model\SignatureRequestSendReque } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -5947,18 +6132,6 @@ public function signatureRequestSendWithHttpInfo(Model\SignatureRequestSendReque $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -5969,16 +6142,17 @@ public function signatureRequestSendWithHttpInfo(Model\SignatureRequestSendReque return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -5995,19 +6169,33 @@ public function signatureRequestSendWithHttpInfo(Model\SignatureRequestSendReque return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -6024,9 +6212,11 @@ public function signatureRequestSendWithHttpInfo(Model\SignatureRequestSendReque return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -6039,6 +6229,7 @@ public function signatureRequestSendWithHttpInfo(Model\SignatureRequestSendReque ); $e->setResponseObject($data); break; + } throw $e; } @@ -6049,14 +6240,14 @@ public function signatureRequestSendWithHttpInfo(Model\SignatureRequestSendReque * * Send Signature Request * - * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation + * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestSend. This method will eventually become unavailable */ - public function signatureRequestSendAsync(Model\SignatureRequestSendRequest $signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) + public function signatureRequestSendAsync($signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) { return $this->signatureRequestSendAsyncWithHttpInfo($signature_request_send_request, $contentType) ->then( @@ -6071,14 +6262,14 @@ function ($response) { * * Send Signature Request * - * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation + * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestSend. This method will eventually become unavailable */ - public function signatureRequestSendAsyncWithHttpInfo(Model\SignatureRequestSendRequest $signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) + public function signatureRequestSendAsyncWithHttpInfo($signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestSendRequest($signature_request_send_request, $contentType); @@ -6088,9 +6279,9 @@ public function signatureRequestSendAsyncWithHttpInfo(Model\SignatureRequestSend ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -6099,7 +6290,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -6113,7 +6304,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -6122,22 +6313,24 @@ function ($exception) { /** * Create request for operation 'signatureRequestSend' * - * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation + * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestSend. This method will eventually become unavailable */ - public function signatureRequestSendRequest(Model\SignatureRequestSendRequest $signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) + public function signatureRequestSendRequest($signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) { + // verify the required parameter 'signature_request_send_request' is set if ($signature_request_send_request === null || (is_array($signature_request_send_request) && count($signature_request_send_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_send_request when calling signatureRequestSend' ); } + $resourcePath = '/signature_request/send'; $formParams = []; $queryParams = []; @@ -6151,8 +6344,11 @@ public function signatureRequestSendRequest(Model\SignatureRequestSendRequest $s $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -6160,7 +6356,7 @@ public function signatureRequestSendRequest(Model\SignatureRequestSendRequest $s // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_send_request)); } else { $httpBody = $signature_request_send_request; @@ -6173,7 +6369,7 @@ public function signatureRequestSendRequest(Model\SignatureRequestSendRequest $s foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -6190,8 +6386,9 @@ public function signatureRequestSendRequest(Model\SignatureRequestSendRequest $s $payloadHook('multipart', $multipartContents, $signature_request_send_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -6234,13 +6431,13 @@ public function signatureRequestSendRequest(Model\SignatureRequestSendRequest $s * * Send with Template * - * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request signature_request_send_with_template_request (required) + * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request signature_request_send_with_template_request (required) * - * @return Model\SignatureRequestGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\SignatureRequestGetResponse */ - public function signatureRequestSendWithTemplate(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request) + public function signatureRequestSendWithTemplate($signature_request_send_with_template_request) { list($response) = $this->signatureRequestSendWithTemplateWithHttpInfo($signature_request_send_with_template_request); return $response; @@ -6251,15 +6448,15 @@ public function signatureRequestSendWithTemplate(Model\SignatureRequestSendWithT * * Send with Template * - * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation * - * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestSendWithTemplateWithHttpInfo(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) + public function signatureRequestSendWithTemplateWithHttpInfo($signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) { $request = $this->signatureRequestSendWithTemplateRequest($signature_request_send_with_template_request, $contentType); @@ -6271,14 +6468,14 @@ public function signatureRequestSendWithTemplateWithHttpInfo(Model\SignatureRequ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -6286,18 +6483,6 @@ public function signatureRequestSendWithTemplateWithHttpInfo(Model\SignatureRequ $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -6308,16 +6493,17 @@ public function signatureRequestSendWithTemplateWithHttpInfo(Model\SignatureRequ return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -6334,19 +6520,33 @@ public function signatureRequestSendWithTemplateWithHttpInfo(Model\SignatureRequ return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -6363,9 +6563,11 @@ public function signatureRequestSendWithTemplateWithHttpInfo(Model\SignatureRequ return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -6378,6 +6580,7 @@ public function signatureRequestSendWithTemplateWithHttpInfo(Model\SignatureRequ ); $e->setResponseObject($data); break; + } throw $e; } @@ -6388,14 +6591,14 @@ public function signatureRequestSendWithTemplateWithHttpInfo(Model\SignatureRequ * * Send with Template * - * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestSendWithTemplateAsync(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) + public function signatureRequestSendWithTemplateAsync($signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) { return $this->signatureRequestSendWithTemplateAsyncWithHttpInfo($signature_request_send_with_template_request, $contentType) ->then( @@ -6410,14 +6613,14 @@ function ($response) { * * Send with Template * - * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestSendWithTemplateAsyncWithHttpInfo(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) + public function signatureRequestSendWithTemplateAsyncWithHttpInfo($signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestSendWithTemplateRequest($signature_request_send_with_template_request, $contentType); @@ -6427,9 +6630,9 @@ public function signatureRequestSendWithTemplateAsyncWithHttpInfo(Model\Signatur ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -6438,7 +6641,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -6452,7 +6655,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -6461,22 +6664,24 @@ function ($exception) { /** * Create request for operation 'signatureRequestSendWithTemplate' * - * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestSendWithTemplateRequest(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) + public function signatureRequestSendWithTemplateRequest($signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) { + // verify the required parameter 'signature_request_send_with_template_request' is set if ($signature_request_send_with_template_request === null || (is_array($signature_request_send_with_template_request) && count($signature_request_send_with_template_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_send_with_template_request when calling signatureRequestSendWithTemplate' ); } + $resourcePath = '/signature_request/send_with_template'; $formParams = []; $queryParams = []; @@ -6490,8 +6695,11 @@ public function signatureRequestSendWithTemplateRequest(Model\SignatureRequestSe $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -6499,7 +6707,7 @@ public function signatureRequestSendWithTemplateRequest(Model\SignatureRequestSe // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_send_with_template_request)); } else { $httpBody = $signature_request_send_with_template_request; @@ -6512,7 +6720,7 @@ public function signatureRequestSendWithTemplateRequest(Model\SignatureRequestSe foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -6529,8 +6737,9 @@ public function signatureRequestSendWithTemplateRequest(Model\SignatureRequestSe $payloadHook('multipart', $multipartContents, $signature_request_send_with_template_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -6573,14 +6782,14 @@ public function signatureRequestSendWithTemplateRequest(Model\SignatureRequestSe * * Update Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to update. (required) - * @param Model\SignatureRequestUpdateRequest $signature_request_update_request signature_request_update_request (required) + * @param string $signature_request_id The id of the SignatureRequest to update. (required) + * @param Model\SignatureRequestUpdateRequest $signature_request_update_request signature_request_update_request (required) * - * @return Model\SignatureRequestGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\SignatureRequestGetResponse */ - public function signatureRequestUpdate(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request) + public function signatureRequestUpdate($signature_request_id, $signature_request_update_request) { list($response) = $this->signatureRequestUpdateWithHttpInfo($signature_request_id, $signature_request_update_request); return $response; @@ -6591,16 +6800,16 @@ public function signatureRequestUpdate(string $signature_request_id, Model\Signa * * Update Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to update. (required) - * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to update. (required) + * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation * - * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::signatureRequestUpdate. This method will eventually become unavailable */ - public function signatureRequestUpdateWithHttpInfo(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) + public function signatureRequestUpdateWithHttpInfo($signature_request_id, $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) { $request = $this->signatureRequestUpdateRequest($signature_request_id, $signature_request_update_request, $contentType); @@ -6612,14 +6821,14 @@ public function signatureRequestUpdateWithHttpInfo(string $signature_request_id, } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -6627,18 +6836,6 @@ public function signatureRequestUpdateWithHttpInfo(string $signature_request_id, $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -6649,16 +6846,17 @@ public function signatureRequestUpdateWithHttpInfo(string $signature_request_id, return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -6675,19 +6873,33 @@ public function signatureRequestUpdateWithHttpInfo(string $signature_request_id, return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -6704,9 +6916,11 @@ public function signatureRequestUpdateWithHttpInfo(string $signature_request_id, return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -6719,6 +6933,7 @@ public function signatureRequestUpdateWithHttpInfo(string $signature_request_id, ); $e->setResponseObject($data); break; + } throw $e; } @@ -6729,15 +6944,15 @@ public function signatureRequestUpdateWithHttpInfo(string $signature_request_id, * * Update Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to update. (required) - * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to update. (required) + * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestUpdate. This method will eventually become unavailable */ - public function signatureRequestUpdateAsync(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) + public function signatureRequestUpdateAsync($signature_request_id, $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) { return $this->signatureRequestUpdateAsyncWithHttpInfo($signature_request_id, $signature_request_update_request, $contentType) ->then( @@ -6752,15 +6967,15 @@ function ($response) { * * Update Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to update. (required) - * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to update. (required) + * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestUpdate. This method will eventually become unavailable */ - public function signatureRequestUpdateAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) + public function signatureRequestUpdateAsyncWithHttpInfo($signature_request_id, $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestUpdateRequest($signature_request_id, $signature_request_update_request, $contentType); @@ -6770,9 +6985,9 @@ public function signatureRequestUpdateAsyncWithHttpInfo(string $signature_reques ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -6781,7 +6996,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -6795,7 +7010,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -6804,30 +7019,32 @@ function ($exception) { /** * Create request for operation 'signatureRequestUpdate' * - * @param string $signature_request_id The id of the SignatureRequest to update. (required) - * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to update. (required) + * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::signatureRequestUpdate. This method will eventually become unavailable */ - public function signatureRequestUpdateRequest(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) + public function signatureRequestUpdateRequest($signature_request_id, $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) { + // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestUpdate' ); } // verify the required parameter 'signature_request_update_request' is set if ($signature_request_update_request === null || (is_array($signature_request_update_request) && count($signature_request_update_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_update_request when calling signatureRequestUpdate' ); } + $resourcePath = '/signature_request/update/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -6841,17 +7058,19 @@ public function signatureRequestUpdateRequest(string $signature_request_id, Mode $multipart = !empty($formParams); + // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{signature_request_id}', + '{' . 'signature_request_id' . '}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -6859,7 +7078,7 @@ public function signatureRequestUpdateRequest(string $signature_request_id, Mode // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_update_request)); } else { $httpBody = $signature_request_update_request; @@ -6872,7 +7091,7 @@ public function signatureRequestUpdateRequest(string $signature_request_id, Mode foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -6889,8 +7108,9 @@ public function signatureRequestUpdateRequest(string $signature_request_id, Mode $payloadHook('multipart', $multipartContents, $signature_request_update_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -6931,8 +7151,8 @@ public function signatureRequestUpdateRequest(string $signature_request_id, Mode /** * Create http client option * + * @throws \RuntimeException on file opening failure * @return array of http client options - * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -6940,7 +7160,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -6956,8 +7176,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -6967,9 +7187,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); } return [ @@ -6988,8 +7208,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/TeamApi.php b/sdks/php/src/Api/TeamApi.php index ec599b4ac..82f9d07d8 100644 --- a/sdks/php/src/Api/TeamApi.php +++ b/sdks/php/src/Api/TeamApi.php @@ -1,10 +1,13 @@ [ 'application/json', @@ -103,12 +111,15 @@ class TeamApi protected $response; /** - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param Configuration $config + * @param ClientInterface $client + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - Configuration $config = null, - ClientInterface $client = null, - HeaderSelector $selector = null, + ?Configuration $config = null, + ?ClientInterface $client = null, + ?HeaderSelector $selector = null, int $hostIndex = 0 ) { $this->client = $client ?: new Client(); @@ -123,7 +134,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex(int $hostIndex): void + public function setHostIndex($hostIndex): void { $this->hostIndex = $hostIndex; } @@ -160,14 +171,14 @@ public function getResponse() * * Add User to Team * - * @param Model\TeamAddMemberRequest $team_add_member_request team_add_member_request (required) - * @param string $team_id The id of the team. (optional) + * @param Model\TeamAddMemberRequest $team_add_member_request team_add_member_request (required) + * @param string|null $team_id The id of the team. (optional) * - * @return Model\TeamGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\TeamGetResponse */ - public function teamAddMember(Model\TeamAddMemberRequest $team_add_member_request, string $team_id = null) + public function teamAddMember($team_add_member_request, $team_id = null) { list($response) = $this->teamAddMemberWithHttpInfo($team_add_member_request, $team_id); return $response; @@ -178,16 +189,16 @@ public function teamAddMember(Model\TeamAddMemberRequest $team_add_member_reques * * Add User to Team * - * @param Model\TeamAddMemberRequest $team_add_member_request (required) - * @param string $team_id The id of the team. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation + * @param Model\TeamAddMemberRequest $team_add_member_request (required) + * @param string|null $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation * - * @return array of Model\TeamGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\TeamGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::teamAddMember. This method will eventually become unavailable */ - public function teamAddMemberWithHttpInfo(Model\TeamAddMemberRequest $team_add_member_request, string $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) + public function teamAddMemberWithHttpInfo($team_add_member_request, $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) { $request = $this->teamAddMemberRequest($team_add_member_request, $team_id, $contentType); @@ -199,14 +210,14 @@ public function teamAddMemberWithHttpInfo(Model\TeamAddMemberRequest $team_add_m } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -214,18 +225,6 @@ public function teamAddMemberWithHttpInfo(Model\TeamAddMemberRequest $team_add_m $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -236,16 +235,17 @@ public function teamAddMemberWithHttpInfo(Model\TeamAddMemberRequest $team_add_m return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\TeamGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -262,19 +262,33 @@ public function teamAddMemberWithHttpInfo(Model\TeamAddMemberRequest $team_add_m return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -291,9 +305,11 @@ public function teamAddMemberWithHttpInfo(Model\TeamAddMemberRequest $team_add_m return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -306,6 +322,7 @@ public function teamAddMemberWithHttpInfo(Model\TeamAddMemberRequest $team_add_m ); $e->setResponseObject($data); break; + } throw $e; } @@ -316,15 +333,15 @@ public function teamAddMemberWithHttpInfo(Model\TeamAddMemberRequest $team_add_m * * Add User to Team * - * @param Model\TeamAddMemberRequest $team_add_member_request (required) - * @param string $team_id The id of the team. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation + * @param Model\TeamAddMemberRequest $team_add_member_request (required) + * @param string|null $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamAddMember. This method will eventually become unavailable */ - public function teamAddMemberAsync(Model\TeamAddMemberRequest $team_add_member_request, string $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) + public function teamAddMemberAsync($team_add_member_request, $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) { return $this->teamAddMemberAsyncWithHttpInfo($team_add_member_request, $team_id, $contentType) ->then( @@ -339,15 +356,15 @@ function ($response) { * * Add User to Team * - * @param Model\TeamAddMemberRequest $team_add_member_request (required) - * @param string $team_id The id of the team. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation + * @param Model\TeamAddMemberRequest $team_add_member_request (required) + * @param string|null $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamAddMember. This method will eventually become unavailable */ - public function teamAddMemberAsyncWithHttpInfo(Model\TeamAddMemberRequest $team_add_member_request, string $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) + public function teamAddMemberAsyncWithHttpInfo($team_add_member_request, $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) { $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; $request = $this->teamAddMemberRequest($team_add_member_request, $team_id, $contentType); @@ -357,9 +374,9 @@ public function teamAddMemberAsyncWithHttpInfo(Model\TeamAddMemberRequest $team_ ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -368,7 +385,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -382,7 +399,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -391,23 +408,26 @@ function ($exception) { /** * Create request for operation 'teamAddMember' * - * @param Model\TeamAddMemberRequest $team_add_member_request (required) - * @param string $team_id The id of the team. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation + * @param Model\TeamAddMemberRequest $team_add_member_request (required) + * @param string|null $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::teamAddMember. This method will eventually become unavailable */ - public function teamAddMemberRequest(Model\TeamAddMemberRequest $team_add_member_request, string $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) + public function teamAddMemberRequest($team_add_member_request, $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) { + // verify the required parameter 'team_add_member_request' is set if ($team_add_member_request === null || (is_array($team_add_member_request) && count($team_add_member_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $team_add_member_request when calling teamAddMember' ); } + + $resourcePath = '/team/add_member'; $formParams = []; $queryParams = []; @@ -430,8 +450,11 @@ public function teamAddMemberRequest(Model\TeamAddMemberRequest $team_add_member false // required ) ?? []); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -439,7 +462,7 @@ public function teamAddMemberRequest(Model\TeamAddMemberRequest $team_add_member // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($team_add_member_request)); } else { $httpBody = $team_add_member_request; @@ -452,7 +475,7 @@ public function teamAddMemberRequest(Model\TeamAddMemberRequest $team_add_member foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -469,8 +492,9 @@ public function teamAddMemberRequest(Model\TeamAddMemberRequest $team_add_member $payloadHook('multipart', $multipartContents, $team_add_member_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -513,13 +537,13 @@ public function teamAddMemberRequest(Model\TeamAddMemberRequest $team_add_member * * Create Team * - * @param Model\TeamCreateRequest $team_create_request team_create_request (required) + * @param Model\TeamCreateRequest $team_create_request team_create_request (required) * - * @return Model\TeamGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\TeamGetResponse */ - public function teamCreate(Model\TeamCreateRequest $team_create_request) + public function teamCreate($team_create_request) { list($response) = $this->teamCreateWithHttpInfo($team_create_request); return $response; @@ -530,15 +554,15 @@ public function teamCreate(Model\TeamCreateRequest $team_create_request) * * Create Team * - * @param Model\TeamCreateRequest $team_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation + * @param Model\TeamCreateRequest $team_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation * - * @return array of Model\TeamGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\TeamGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::teamCreate. This method will eventually become unavailable */ - public function teamCreateWithHttpInfo(Model\TeamCreateRequest $team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) + public function teamCreateWithHttpInfo($team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) { $request = $this->teamCreateRequest($team_create_request, $contentType); @@ -550,14 +574,14 @@ public function teamCreateWithHttpInfo(Model\TeamCreateRequest $team_create_requ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -565,18 +589,6 @@ public function teamCreateWithHttpInfo(Model\TeamCreateRequest $team_create_requ $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -587,16 +599,17 @@ public function teamCreateWithHttpInfo(Model\TeamCreateRequest $team_create_requ return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\TeamGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -613,19 +626,33 @@ public function teamCreateWithHttpInfo(Model\TeamCreateRequest $team_create_requ return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -642,9 +669,11 @@ public function teamCreateWithHttpInfo(Model\TeamCreateRequest $team_create_requ return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -657,6 +686,7 @@ public function teamCreateWithHttpInfo(Model\TeamCreateRequest $team_create_requ ); $e->setResponseObject($data); break; + } throw $e; } @@ -667,14 +697,14 @@ public function teamCreateWithHttpInfo(Model\TeamCreateRequest $team_create_requ * * Create Team * - * @param Model\TeamCreateRequest $team_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation + * @param Model\TeamCreateRequest $team_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamCreate. This method will eventually become unavailable */ - public function teamCreateAsync(Model\TeamCreateRequest $team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) + public function teamCreateAsync($team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) { return $this->teamCreateAsyncWithHttpInfo($team_create_request, $contentType) ->then( @@ -689,14 +719,14 @@ function ($response) { * * Create Team * - * @param Model\TeamCreateRequest $team_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation + * @param Model\TeamCreateRequest $team_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamCreate. This method will eventually become unavailable */ - public function teamCreateAsyncWithHttpInfo(Model\TeamCreateRequest $team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) + public function teamCreateAsyncWithHttpInfo($team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) { $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; $request = $this->teamCreateRequest($team_create_request, $contentType); @@ -706,9 +736,9 @@ public function teamCreateAsyncWithHttpInfo(Model\TeamCreateRequest $team_create ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -717,7 +747,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -731,7 +761,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -740,22 +770,24 @@ function ($exception) { /** * Create request for operation 'teamCreate' * - * @param Model\TeamCreateRequest $team_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation + * @param Model\TeamCreateRequest $team_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::teamCreate. This method will eventually become unavailable */ - public function teamCreateRequest(Model\TeamCreateRequest $team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) + public function teamCreateRequest($team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) { + // verify the required parameter 'team_create_request' is set if ($team_create_request === null || (is_array($team_create_request) && count($team_create_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $team_create_request when calling teamCreate' ); } + $resourcePath = '/team/create'; $formParams = []; $queryParams = []; @@ -769,8 +801,11 @@ public function teamCreateRequest(Model\TeamCreateRequest $team_create_request, $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -778,7 +813,7 @@ public function teamCreateRequest(Model\TeamCreateRequest $team_create_request, // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($team_create_request)); } else { $httpBody = $team_create_request; @@ -791,7 +826,7 @@ public function teamCreateRequest(Model\TeamCreateRequest $team_create_request, foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -808,8 +843,9 @@ public function teamCreateRequest(Model\TeamCreateRequest $team_create_request, $payloadHook('multipart', $multipartContents, $team_create_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -852,8 +888,10 @@ public function teamCreateRequest(Model\TeamCreateRequest $team_create_request, * * Delete Team * + * * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return void */ public function teamDelete() { @@ -865,11 +903,11 @@ public function teamDelete() * * Delete Team * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation * - * @return array of null, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::teamDelete. This method will eventually become unavailable */ public function teamDeleteWithHttpInfo(string $contentType = self::contentTypes['teamDelete'][0]) @@ -884,14 +922,14 @@ public function teamDeleteWithHttpInfo(string $contentType = self::contentTypes[ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -899,25 +937,16 @@ public function teamDeleteWithHttpInfo(string $contentType = self::contentTypes[ $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() - ); - } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } switch ($e->getCode()) { + } throw $e; } @@ -928,10 +957,10 @@ public function teamDeleteWithHttpInfo(string $contentType = self::contentTypes[ * * Delete Team * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamDelete. This method will eventually become unavailable */ public function teamDeleteAsync(string $contentType = self::contentTypes['teamDelete'][0]) @@ -949,10 +978,10 @@ function ($response) { * * Delete Team * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamDelete. This method will eventually become unavailable */ public function teamDeleteAsyncWithHttpInfo(string $contentType = self::contentTypes['teamDelete'][0]) @@ -963,7 +992,7 @@ public function teamDeleteAsyncWithHttpInfo(string $contentType = self::contentT return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( - function ($response) { + function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { @@ -977,7 +1006,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -986,14 +1015,16 @@ function ($exception) { /** * Create request for operation 'teamDelete' * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::teamDelete. This method will eventually become unavailable */ public function teamDeleteRequest(string $contentType = self::contentTypes['teamDelete'][0]) { + + $resourcePath = '/team/destroy'; $formParams = []; $queryParams = []; @@ -1001,8 +1032,12 @@ public function teamDeleteRequest(string $contentType = self::contentTypes['team $httpBody = ''; $multipart = false; + + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1016,7 +1051,7 @@ public function teamDeleteRequest(string $contentType = self::contentTypes['team foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1030,8 +1065,9 @@ public function teamDeleteRequest(string $contentType = self::contentTypes['team } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1074,9 +1110,10 @@ public function teamDeleteRequest(string $contentType = self::contentTypes['team * * Get Team * - * @return Model\TeamGetResponse + * * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\TeamGetResponse */ public function teamGet() { @@ -1089,11 +1126,11 @@ public function teamGet() * * Get Team * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation * - * @return array of Model\TeamGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\TeamGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::teamGet. This method will eventually become unavailable */ public function teamGetWithHttpInfo(string $contentType = self::contentTypes['teamGet'][0]) @@ -1108,14 +1145,14 @@ public function teamGetWithHttpInfo(string $contentType = self::contentTypes['te } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -1123,18 +1160,6 @@ public function teamGetWithHttpInfo(string $contentType = self::contentTypes['te $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -1145,16 +1170,17 @@ public function teamGetWithHttpInfo(string $contentType = self::contentTypes['te return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\TeamGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1171,19 +1197,33 @@ public function teamGetWithHttpInfo(string $contentType = self::contentTypes['te return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1200,9 +1240,11 @@ public function teamGetWithHttpInfo(string $contentType = self::contentTypes['te return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1215,6 +1257,7 @@ public function teamGetWithHttpInfo(string $contentType = self::contentTypes['te ); $e->setResponseObject($data); break; + } throw $e; } @@ -1225,10 +1268,10 @@ public function teamGetWithHttpInfo(string $contentType = self::contentTypes['te * * Get Team * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamGet. This method will eventually become unavailable */ public function teamGetAsync(string $contentType = self::contentTypes['teamGet'][0]) @@ -1246,10 +1289,10 @@ function ($response) { * * Get Team * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamGet. This method will eventually become unavailable */ public function teamGetAsyncWithHttpInfo(string $contentType = self::contentTypes['teamGet'][0]) @@ -1262,9 +1305,9 @@ public function teamGetAsyncWithHttpInfo(string $contentType = self::contentType ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1273,7 +1316,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -1287,7 +1330,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1296,14 +1339,16 @@ function ($exception) { /** * Create request for operation 'teamGet' * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::teamGet. This method will eventually become unavailable */ public function teamGetRequest(string $contentType = self::contentTypes['teamGet'][0]) { + + $resourcePath = '/team'; $formParams = []; $queryParams = []; @@ -1311,8 +1356,12 @@ public function teamGetRequest(string $contentType = self::contentTypes['teamGet $httpBody = ''; $multipart = false; + + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1326,7 +1375,7 @@ public function teamGetRequest(string $contentType = self::contentTypes['teamGet foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1340,8 +1389,9 @@ public function teamGetRequest(string $contentType = self::contentTypes['teamGet } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1384,13 +1434,13 @@ public function teamGetRequest(string $contentType = self::contentTypes['teamGet * * Get Team Info * - * @param string $team_id The id of the team. (optional) + * @param string|null $team_id The id of the team. (optional) * - * @return Model\TeamGetInfoResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\TeamGetInfoResponse */ - public function teamInfo(string $team_id = null) + public function teamInfo($team_id = null) { list($response) = $this->teamInfoWithHttpInfo($team_id); return $response; @@ -1401,15 +1451,15 @@ public function teamInfo(string $team_id = null) * * Get Team Info * - * @param string $team_id The id of the team. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation + * @param string|null $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation * - * @return array of Model\TeamGetInfoResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\TeamGetInfoResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::teamInfo. This method will eventually become unavailable */ - public function teamInfoWithHttpInfo(string $team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) + public function teamInfoWithHttpInfo($team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) { $request = $this->teamInfoRequest($team_id, $contentType); @@ -1421,14 +1471,14 @@ public function teamInfoWithHttpInfo(string $team_id = null, string $contentType } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -1436,18 +1486,6 @@ public function teamInfoWithHttpInfo(string $team_id = null, string $contentType $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -1458,16 +1496,17 @@ public function teamInfoWithHttpInfo(string $team_id = null, string $contentType return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TeamGetInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\TeamGetInfoResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1484,19 +1523,33 @@ public function teamInfoWithHttpInfo(string $team_id = null, string $contentType return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetInfoResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\TeamGetInfoResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1513,9 +1566,11 @@ public function teamInfoWithHttpInfo(string $team_id = null, string $contentType return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1528,6 +1583,7 @@ public function teamInfoWithHttpInfo(string $team_id = null, string $contentType ); $e->setResponseObject($data); break; + } throw $e; } @@ -1538,14 +1594,14 @@ public function teamInfoWithHttpInfo(string $team_id = null, string $contentType * * Get Team Info * - * @param string $team_id The id of the team. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation + * @param string|null $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamInfo. This method will eventually become unavailable */ - public function teamInfoAsync(string $team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) + public function teamInfoAsync($team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) { return $this->teamInfoAsyncWithHttpInfo($team_id, $contentType) ->then( @@ -1560,14 +1616,14 @@ function ($response) { * * Get Team Info * - * @param string $team_id The id of the team. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation + * @param string|null $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamInfo. This method will eventually become unavailable */ - public function teamInfoAsyncWithHttpInfo(string $team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) + public function teamInfoAsyncWithHttpInfo($team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) { $returnType = '\Dropbox\Sign\Model\TeamGetInfoResponse'; $request = $this->teamInfoRequest($team_id, $contentType); @@ -1577,9 +1633,9 @@ public function teamInfoAsyncWithHttpInfo(string $team_id = null, string $conten ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1588,7 +1644,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -1602,7 +1658,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1611,15 +1667,18 @@ function ($exception) { /** * Create request for operation 'teamInfo' * - * @param string $team_id The id of the team. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation + * @param string|null $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::teamInfo. This method will eventually become unavailable */ - public function teamInfoRequest(string $team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) + public function teamInfoRequest($team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) { + + + $resourcePath = '/team/info'; $formParams = []; $queryParams = []; @@ -1637,8 +1696,11 @@ public function teamInfoRequest(string $team_id = null, string $contentType = se false // required ) ?? []); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1652,7 +1714,7 @@ public function teamInfoRequest(string $team_id = null, string $contentType = se foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1666,8 +1728,9 @@ public function teamInfoRequest(string $team_id = null, string $contentType = se } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1710,13 +1773,13 @@ public function teamInfoRequest(string $team_id = null, string $contentType = se * * List Team Invites * - * @param string $email_address The email address for which to display the team invites. (optional) + * @param string|null $email_address The email address for which to display the team invites. (optional) * - * @return Model\TeamInvitesResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\TeamInvitesResponse */ - public function teamInvites(string $email_address = null) + public function teamInvites($email_address = null) { list($response) = $this->teamInvitesWithHttpInfo($email_address); return $response; @@ -1727,15 +1790,15 @@ public function teamInvites(string $email_address = null) * * List Team Invites * - * @param string $email_address The email address for which to display the team invites. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation + * @param string|null $email_address The email address for which to display the team invites. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation * - * @return array of Model\TeamInvitesResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\TeamInvitesResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::teamInvites. This method will eventually become unavailable */ - public function teamInvitesWithHttpInfo(string $email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) + public function teamInvitesWithHttpInfo($email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) { $request = $this->teamInvitesRequest($email_address, $contentType); @@ -1747,14 +1810,14 @@ public function teamInvitesWithHttpInfo(string $email_address = null, string $co } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -1762,18 +1825,6 @@ public function teamInvitesWithHttpInfo(string $email_address = null, string $co $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -1784,16 +1835,17 @@ public function teamInvitesWithHttpInfo(string $email_address = null, string $co return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TeamInvitesResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\TeamInvitesResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1810,19 +1862,33 @@ public function teamInvitesWithHttpInfo(string $email_address = null, string $co return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamInvitesResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\TeamInvitesResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1839,9 +1905,11 @@ public function teamInvitesWithHttpInfo(string $email_address = null, string $co return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1854,6 +1922,7 @@ public function teamInvitesWithHttpInfo(string $email_address = null, string $co ); $e->setResponseObject($data); break; + } throw $e; } @@ -1864,14 +1933,14 @@ public function teamInvitesWithHttpInfo(string $email_address = null, string $co * * List Team Invites * - * @param string $email_address The email address for which to display the team invites. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation + * @param string|null $email_address The email address for which to display the team invites. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamInvites. This method will eventually become unavailable */ - public function teamInvitesAsync(string $email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) + public function teamInvitesAsync($email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) { return $this->teamInvitesAsyncWithHttpInfo($email_address, $contentType) ->then( @@ -1886,14 +1955,14 @@ function ($response) { * * List Team Invites * - * @param string $email_address The email address for which to display the team invites. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation + * @param string|null $email_address The email address for which to display the team invites. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamInvites. This method will eventually become unavailable */ - public function teamInvitesAsyncWithHttpInfo(string $email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) + public function teamInvitesAsyncWithHttpInfo($email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) { $returnType = '\Dropbox\Sign\Model\TeamInvitesResponse'; $request = $this->teamInvitesRequest($email_address, $contentType); @@ -1903,9 +1972,9 @@ public function teamInvitesAsyncWithHttpInfo(string $email_address = null, strin ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1914,7 +1983,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -1928,7 +1997,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1937,15 +2006,18 @@ function ($exception) { /** * Create request for operation 'teamInvites' * - * @param string $email_address The email address for which to display the team invites. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation + * @param string|null $email_address The email address for which to display the team invites. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::teamInvites. This method will eventually become unavailable */ - public function teamInvitesRequest(string $email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) + public function teamInvitesRequest($email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) { + + + $resourcePath = '/team/invites'; $formParams = []; $queryParams = []; @@ -1963,8 +2035,11 @@ public function teamInvitesRequest(string $email_address = null, string $content false // required ) ?? []); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1978,7 +2053,7 @@ public function teamInvitesRequest(string $email_address = null, string $content foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1992,8 +2067,9 @@ public function teamInvitesRequest(string $email_address = null, string $content } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2036,15 +2112,15 @@ public function teamInvitesRequest(string $email_address = null, string $content * * List Team Members * - * @param string $team_id The id of the team that a member list is being requested from. (required) - * @param int $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $team_id The id of the team that a member list is being requested from. (required) + * @param int|null $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) * - * @return Model\TeamMembersResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\TeamMembersResponse */ - public function teamMembers(string $team_id, int $page = 1, int $page_size = 20) + public function teamMembers($team_id, $page = 1, $page_size = 20) { list($response) = $this->teamMembersWithHttpInfo($team_id, $page, $page_size); return $response; @@ -2055,17 +2131,17 @@ public function teamMembers(string $team_id, int $page = 1, int $page_size = 20) * * List Team Members * - * @param string $team_id The id of the team that a member list is being requested from. (required) - * @param int $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation + * @param string $team_id The id of the team that a member list is being requested from. (required) + * @param int|null $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation * - * @return array of Model\TeamMembersResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\TeamMembersResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::teamMembers. This method will eventually become unavailable */ - public function teamMembersWithHttpInfo(string $team_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) + public function teamMembersWithHttpInfo($team_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) { $request = $this->teamMembersRequest($team_id, $page, $page_size, $contentType); @@ -2077,14 +2153,14 @@ public function teamMembersWithHttpInfo(string $team_id, int $page = 1, int $pag } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -2092,18 +2168,6 @@ public function teamMembersWithHttpInfo(string $team_id, int $page = 1, int $pag $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -2114,16 +2178,17 @@ public function teamMembersWithHttpInfo(string $team_id, int $page = 1, int $pag return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TeamMembersResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\TeamMembersResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2140,19 +2205,33 @@ public function teamMembersWithHttpInfo(string $team_id, int $page = 1, int $pag return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamMembersResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\TeamMembersResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2169,9 +2248,11 @@ public function teamMembersWithHttpInfo(string $team_id, int $page = 1, int $pag return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2184,6 +2265,7 @@ public function teamMembersWithHttpInfo(string $team_id, int $page = 1, int $pag ); $e->setResponseObject($data); break; + } throw $e; } @@ -2194,16 +2276,16 @@ public function teamMembersWithHttpInfo(string $team_id, int $page = 1, int $pag * * List Team Members * - * @param string $team_id The id of the team that a member list is being requested from. (required) - * @param int $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation + * @param string $team_id The id of the team that a member list is being requested from. (required) + * @param int|null $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamMembers. This method will eventually become unavailable */ - public function teamMembersAsync(string $team_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) + public function teamMembersAsync($team_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) { return $this->teamMembersAsyncWithHttpInfo($team_id, $page, $page_size, $contentType) ->then( @@ -2218,16 +2300,16 @@ function ($response) { * * List Team Members * - * @param string $team_id The id of the team that a member list is being requested from. (required) - * @param int $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation + * @param string $team_id The id of the team that a member list is being requested from. (required) + * @param int|null $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamMembers. This method will eventually become unavailable */ - public function teamMembersAsyncWithHttpInfo(string $team_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) + public function teamMembersAsyncWithHttpInfo($team_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) { $returnType = '\Dropbox\Sign\Model\TeamMembersResponse'; $request = $this->teamMembersRequest($team_id, $page, $page_size, $contentType); @@ -2237,9 +2319,9 @@ public function teamMembersAsyncWithHttpInfo(string $team_id, int $page = 1, int ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2248,7 +2330,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -2262,7 +2344,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -2271,31 +2353,34 @@ function ($exception) { /** * Create request for operation 'teamMembers' * - * @param string $team_id The id of the team that a member list is being requested from. (required) - * @param int $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation + * @param string $team_id The id of the team that a member list is being requested from. (required) + * @param int|null $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::teamMembers. This method will eventually become unavailable */ - public function teamMembersRequest(string $team_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) + public function teamMembersRequest($team_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) { + // verify the required parameter 'team_id' is set if ($team_id === null || (is_array($team_id) && count($team_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $team_id when calling teamMembers' ); } + if ($page_size !== null && $page_size > 100) { - throw new InvalidArgumentException('invalid value for "$page_size" when calling TeamApi.teamMembers, must be smaller than or equal to 100.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling TeamApi.teamMembers, must be smaller than or equal to 100.'); } if ($page_size !== null && $page_size < 1) { - throw new InvalidArgumentException('invalid value for "$page_size" when calling TeamApi.teamMembers, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling TeamApi.teamMembers, must be bigger than or equal to 1.'); } + $resourcePath = '/team/members/{team_id}'; $formParams = []; $queryParams = []; @@ -2322,17 +2407,19 @@ public function teamMembersRequest(string $team_id, int $page = 1, int $page_siz false // required ) ?? []); + // path params if ($team_id !== null) { $resourcePath = str_replace( - '{team_id}', + '{' . 'team_id' . '}', ObjectSerializer::toPathValue($team_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -2346,7 +2433,7 @@ public function teamMembersRequest(string $team_id, int $page = 1, int $page_siz foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -2360,8 +2447,9 @@ public function teamMembersRequest(string $team_id, int $page = 1, int $page_siz } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2404,13 +2492,13 @@ public function teamMembersRequest(string $team_id, int $page = 1, int $page_siz * * Remove User from Team * - * @param Model\TeamRemoveMemberRequest $team_remove_member_request team_remove_member_request (required) + * @param Model\TeamRemoveMemberRequest $team_remove_member_request team_remove_member_request (required) * - * @return Model\TeamGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\TeamGetResponse */ - public function teamRemoveMember(Model\TeamRemoveMemberRequest $team_remove_member_request) + public function teamRemoveMember($team_remove_member_request) { list($response) = $this->teamRemoveMemberWithHttpInfo($team_remove_member_request); return $response; @@ -2421,15 +2509,15 @@ public function teamRemoveMember(Model\TeamRemoveMemberRequest $team_remove_memb * * Remove User from Team * - * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation + * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation * - * @return array of Model\TeamGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\TeamGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::teamRemoveMember. This method will eventually become unavailable */ - public function teamRemoveMemberWithHttpInfo(Model\TeamRemoveMemberRequest $team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) + public function teamRemoveMemberWithHttpInfo($team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) { $request = $this->teamRemoveMemberRequest($team_remove_member_request, $contentType); @@ -2441,14 +2529,14 @@ public function teamRemoveMemberWithHttpInfo(Model\TeamRemoveMemberRequest $team } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -2456,18 +2544,6 @@ public function teamRemoveMemberWithHttpInfo(Model\TeamRemoveMemberRequest $team $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -2478,16 +2554,17 @@ public function teamRemoveMemberWithHttpInfo(Model\TeamRemoveMemberRequest $team return $result; } + switch ($statusCode) { case 201: if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\TeamGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2504,19 +2581,33 @@ public function teamRemoveMemberWithHttpInfo(Model\TeamRemoveMemberRequest $team return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2533,9 +2624,11 @@ public function teamRemoveMemberWithHttpInfo(Model\TeamRemoveMemberRequest $team return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2548,6 +2641,7 @@ public function teamRemoveMemberWithHttpInfo(Model\TeamRemoveMemberRequest $team ); $e->setResponseObject($data); break; + } throw $e; } @@ -2558,14 +2652,14 @@ public function teamRemoveMemberWithHttpInfo(Model\TeamRemoveMemberRequest $team * * Remove User from Team * - * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation + * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamRemoveMember. This method will eventually become unavailable */ - public function teamRemoveMemberAsync(Model\TeamRemoveMemberRequest $team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) + public function teamRemoveMemberAsync($team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) { return $this->teamRemoveMemberAsyncWithHttpInfo($team_remove_member_request, $contentType) ->then( @@ -2580,14 +2674,14 @@ function ($response) { * * Remove User from Team * - * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation + * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamRemoveMember. This method will eventually become unavailable */ - public function teamRemoveMemberAsyncWithHttpInfo(Model\TeamRemoveMemberRequest $team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) + public function teamRemoveMemberAsyncWithHttpInfo($team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) { $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; $request = $this->teamRemoveMemberRequest($team_remove_member_request, $contentType); @@ -2597,9 +2691,9 @@ public function teamRemoveMemberAsyncWithHttpInfo(Model\TeamRemoveMemberRequest ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2608,7 +2702,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -2622,7 +2716,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -2631,22 +2725,24 @@ function ($exception) { /** * Create request for operation 'teamRemoveMember' * - * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation + * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::teamRemoveMember. This method will eventually become unavailable */ - public function teamRemoveMemberRequest(Model\TeamRemoveMemberRequest $team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) + public function teamRemoveMemberRequest($team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) { + // verify the required parameter 'team_remove_member_request' is set if ($team_remove_member_request === null || (is_array($team_remove_member_request) && count($team_remove_member_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $team_remove_member_request when calling teamRemoveMember' ); } + $resourcePath = '/team/remove_member'; $formParams = []; $queryParams = []; @@ -2660,8 +2756,11 @@ public function teamRemoveMemberRequest(Model\TeamRemoveMemberRequest $team_remo $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -2669,7 +2768,7 @@ public function teamRemoveMemberRequest(Model\TeamRemoveMemberRequest $team_remo // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($team_remove_member_request)); } else { $httpBody = $team_remove_member_request; @@ -2682,7 +2781,7 @@ public function teamRemoveMemberRequest(Model\TeamRemoveMemberRequest $team_remo foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -2699,8 +2798,9 @@ public function teamRemoveMemberRequest(Model\TeamRemoveMemberRequest $team_remo $payloadHook('multipart', $multipartContents, $team_remove_member_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2743,15 +2843,15 @@ public function teamRemoveMemberRequest(Model\TeamRemoveMemberRequest $team_remo * * List Sub Teams * - * @param string $team_id The id of the parent Team. (required) - * @param int $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $team_id The id of the parent Team. (required) + * @param int|null $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) * - * @return Model\TeamSubTeamsResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\TeamSubTeamsResponse */ - public function teamSubTeams(string $team_id, int $page = 1, int $page_size = 20) + public function teamSubTeams($team_id, $page = 1, $page_size = 20) { list($response) = $this->teamSubTeamsWithHttpInfo($team_id, $page, $page_size); return $response; @@ -2762,17 +2862,17 @@ public function teamSubTeams(string $team_id, int $page = 1, int $page_size = 20 * * List Sub Teams * - * @param string $team_id The id of the parent Team. (required) - * @param int $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation + * @param string $team_id The id of the parent Team. (required) + * @param int|null $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation * - * @return array of Model\TeamSubTeamsResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\TeamSubTeamsResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::teamSubTeams. This method will eventually become unavailable */ - public function teamSubTeamsWithHttpInfo(string $team_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) + public function teamSubTeamsWithHttpInfo($team_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) { $request = $this->teamSubTeamsRequest($team_id, $page, $page_size, $contentType); @@ -2784,14 +2884,14 @@ public function teamSubTeamsWithHttpInfo(string $team_id, int $page = 1, int $pa } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -2799,18 +2899,6 @@ public function teamSubTeamsWithHttpInfo(string $team_id, int $page = 1, int $pa $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -2821,16 +2909,17 @@ public function teamSubTeamsWithHttpInfo(string $team_id, int $page = 1, int $pa return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TeamSubTeamsResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\TeamSubTeamsResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2847,19 +2936,33 @@ public function teamSubTeamsWithHttpInfo(string $team_id, int $page = 1, int $pa return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamSubTeamsResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\TeamSubTeamsResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2876,9 +2979,11 @@ public function teamSubTeamsWithHttpInfo(string $team_id, int $page = 1, int $pa return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2891,6 +2996,7 @@ public function teamSubTeamsWithHttpInfo(string $team_id, int $page = 1, int $pa ); $e->setResponseObject($data); break; + } throw $e; } @@ -2901,16 +3007,16 @@ public function teamSubTeamsWithHttpInfo(string $team_id, int $page = 1, int $pa * * List Sub Teams * - * @param string $team_id The id of the parent Team. (required) - * @param int $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation + * @param string $team_id The id of the parent Team. (required) + * @param int|null $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamSubTeams. This method will eventually become unavailable */ - public function teamSubTeamsAsync(string $team_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) + public function teamSubTeamsAsync($team_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) { return $this->teamSubTeamsAsyncWithHttpInfo($team_id, $page, $page_size, $contentType) ->then( @@ -2925,16 +3031,16 @@ function ($response) { * * List Sub Teams * - * @param string $team_id The id of the parent Team. (required) - * @param int $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation + * @param string $team_id The id of the parent Team. (required) + * @param int|null $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamSubTeams. This method will eventually become unavailable */ - public function teamSubTeamsAsyncWithHttpInfo(string $team_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) + public function teamSubTeamsAsyncWithHttpInfo($team_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) { $returnType = '\Dropbox\Sign\Model\TeamSubTeamsResponse'; $request = $this->teamSubTeamsRequest($team_id, $page, $page_size, $contentType); @@ -2944,9 +3050,9 @@ public function teamSubTeamsAsyncWithHttpInfo(string $team_id, int $page = 1, in ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2955,7 +3061,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -2969,7 +3075,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -2978,31 +3084,34 @@ function ($exception) { /** * Create request for operation 'teamSubTeams' * - * @param string $team_id The id of the parent Team. (required) - * @param int $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation + * @param string $team_id The id of the parent Team. (required) + * @param int|null $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::teamSubTeams. This method will eventually become unavailable */ - public function teamSubTeamsRequest(string $team_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) + public function teamSubTeamsRequest($team_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) { + // verify the required parameter 'team_id' is set if ($team_id === null || (is_array($team_id) && count($team_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $team_id when calling teamSubTeams' ); } + if ($page_size !== null && $page_size > 100) { - throw new InvalidArgumentException('invalid value for "$page_size" when calling TeamApi.teamSubTeams, must be smaller than or equal to 100.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling TeamApi.teamSubTeams, must be smaller than or equal to 100.'); } if ($page_size !== null && $page_size < 1) { - throw new InvalidArgumentException('invalid value for "$page_size" when calling TeamApi.teamSubTeams, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling TeamApi.teamSubTeams, must be bigger than or equal to 1.'); } + $resourcePath = '/team/sub_teams/{team_id}'; $formParams = []; $queryParams = []; @@ -3029,17 +3138,19 @@ public function teamSubTeamsRequest(string $team_id, int $page = 1, int $page_si false // required ) ?? []); + // path params if ($team_id !== null) { $resourcePath = str_replace( - '{team_id}', + '{' . 'team_id' . '}', ObjectSerializer::toPathValue($team_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -3053,7 +3164,7 @@ public function teamSubTeamsRequest(string $team_id, int $page = 1, int $page_si foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -3067,8 +3178,9 @@ public function teamSubTeamsRequest(string $team_id, int $page = 1, int $page_si } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -3111,13 +3223,13 @@ public function teamSubTeamsRequest(string $team_id, int $page = 1, int $page_si * * Update Team * - * @param Model\TeamUpdateRequest $team_update_request team_update_request (required) + * @param Model\TeamUpdateRequest $team_update_request team_update_request (required) * - * @return Model\TeamGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\TeamGetResponse */ - public function teamUpdate(Model\TeamUpdateRequest $team_update_request) + public function teamUpdate($team_update_request) { list($response) = $this->teamUpdateWithHttpInfo($team_update_request); return $response; @@ -3128,15 +3240,15 @@ public function teamUpdate(Model\TeamUpdateRequest $team_update_request) * * Update Team * - * @param Model\TeamUpdateRequest $team_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation + * @param Model\TeamUpdateRequest $team_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation * - * @return array of Model\TeamGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\TeamGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::teamUpdate. This method will eventually become unavailable */ - public function teamUpdateWithHttpInfo(Model\TeamUpdateRequest $team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) + public function teamUpdateWithHttpInfo($team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) { $request = $this->teamUpdateRequest($team_update_request, $contentType); @@ -3148,14 +3260,14 @@ public function teamUpdateWithHttpInfo(Model\TeamUpdateRequest $team_update_requ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -3163,18 +3275,6 @@ public function teamUpdateWithHttpInfo(Model\TeamUpdateRequest $team_update_requ $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -3185,16 +3285,17 @@ public function teamUpdateWithHttpInfo(Model\TeamUpdateRequest $team_update_requ return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\TeamGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3211,19 +3312,33 @@ public function teamUpdateWithHttpInfo(Model\TeamUpdateRequest $team_update_requ return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3240,9 +3355,11 @@ public function teamUpdateWithHttpInfo(Model\TeamUpdateRequest $team_update_requ return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -3255,6 +3372,7 @@ public function teamUpdateWithHttpInfo(Model\TeamUpdateRequest $team_update_requ ); $e->setResponseObject($data); break; + } throw $e; } @@ -3265,14 +3383,14 @@ public function teamUpdateWithHttpInfo(Model\TeamUpdateRequest $team_update_requ * * Update Team * - * @param Model\TeamUpdateRequest $team_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation + * @param Model\TeamUpdateRequest $team_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamUpdate. This method will eventually become unavailable */ - public function teamUpdateAsync(Model\TeamUpdateRequest $team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) + public function teamUpdateAsync($team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) { return $this->teamUpdateAsyncWithHttpInfo($team_update_request, $contentType) ->then( @@ -3287,14 +3405,14 @@ function ($response) { * * Update Team * - * @param Model\TeamUpdateRequest $team_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation + * @param Model\TeamUpdateRequest $team_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::teamUpdate. This method will eventually become unavailable */ - public function teamUpdateAsyncWithHttpInfo(Model\TeamUpdateRequest $team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) + public function teamUpdateAsyncWithHttpInfo($team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) { $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; $request = $this->teamUpdateRequest($team_update_request, $contentType); @@ -3304,9 +3422,9 @@ public function teamUpdateAsyncWithHttpInfo(Model\TeamUpdateRequest $team_update ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -3315,7 +3433,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -3329,7 +3447,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -3338,22 +3456,24 @@ function ($exception) { /** * Create request for operation 'teamUpdate' * - * @param Model\TeamUpdateRequest $team_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation + * @param Model\TeamUpdateRequest $team_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::teamUpdate. This method will eventually become unavailable */ - public function teamUpdateRequest(Model\TeamUpdateRequest $team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) + public function teamUpdateRequest($team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) { + // verify the required parameter 'team_update_request' is set if ($team_update_request === null || (is_array($team_update_request) && count($team_update_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $team_update_request when calling teamUpdate' ); } + $resourcePath = '/team'; $formParams = []; $queryParams = []; @@ -3367,8 +3487,11 @@ public function teamUpdateRequest(Model\TeamUpdateRequest $team_update_request, $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -3376,7 +3499,7 @@ public function teamUpdateRequest(Model\TeamUpdateRequest $team_update_request, // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($team_update_request)); } else { $httpBody = $team_update_request; @@ -3389,7 +3512,7 @@ public function teamUpdateRequest(Model\TeamUpdateRequest $team_update_request, foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -3406,8 +3529,9 @@ public function teamUpdateRequest(Model\TeamUpdateRequest $team_update_request, $payloadHook('multipart', $multipartContents, $team_update_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -3448,8 +3572,8 @@ public function teamUpdateRequest(Model\TeamUpdateRequest $team_update_request, /** * Create http client option * + * @throws \RuntimeException on file opening failure * @return array of http client options - * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -3457,7 +3581,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -3473,8 +3597,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -3484,9 +3608,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); } return [ @@ -3505,8 +3629,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/TemplateApi.php b/sdks/php/src/Api/TemplateApi.php index 091dc84d6..a03fe5f71 100644 --- a/sdks/php/src/Api/TemplateApi.php +++ b/sdks/php/src/Api/TemplateApi.php @@ -1,10 +1,13 @@ [ 'application/json', @@ -110,12 +117,15 @@ class TemplateApi protected $response; /** - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param Configuration $config + * @param ClientInterface $client + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - Configuration $config = null, - ClientInterface $client = null, - HeaderSelector $selector = null, + ?Configuration $config = null, + ?ClientInterface $client = null, + ?HeaderSelector $selector = null, int $hostIndex = 0 ) { $this->client = $client ?: new Client(); @@ -130,7 +140,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex(int $hostIndex): void + public function setHostIndex($hostIndex): void { $this->hostIndex = $hostIndex; } @@ -167,14 +177,14 @@ public function getResponse() * * Add User to Template * - * @param string $template_id The id of the Template to give the Account access to. (required) - * @param Model\TemplateAddUserRequest $template_add_user_request template_add_user_request (required) + * @param string $template_id The id of the Template to give the Account access to. (required) + * @param Model\TemplateAddUserRequest $template_add_user_request template_add_user_request (required) * - * @return Model\TemplateGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\TemplateGetResponse */ - public function templateAddUser(string $template_id, Model\TemplateAddUserRequest $template_add_user_request) + public function templateAddUser($template_id, $template_add_user_request) { list($response) = $this->templateAddUserWithHttpInfo($template_id, $template_add_user_request); return $response; @@ -185,16 +195,16 @@ public function templateAddUser(string $template_id, Model\TemplateAddUserReques * * Add User to Template * - * @param string $template_id The id of the Template to give the Account access to. (required) - * @param Model\TemplateAddUserRequest $template_add_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation + * @param string $template_id The id of the Template to give the Account access to. (required) + * @param Model\TemplateAddUserRequest $template_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation * - * @return array of Model\TemplateGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\TemplateGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::templateAddUser. This method will eventually become unavailable */ - public function templateAddUserWithHttpInfo(string $template_id, Model\TemplateAddUserRequest $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) + public function templateAddUserWithHttpInfo($template_id, $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) { $request = $this->templateAddUserRequest($template_id, $template_add_user_request, $contentType); @@ -206,14 +216,14 @@ public function templateAddUserWithHttpInfo(string $template_id, Model\TemplateA } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -221,18 +231,6 @@ public function templateAddUserWithHttpInfo(string $template_id, Model\TemplateA $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -243,16 +241,17 @@ public function templateAddUserWithHttpInfo(string $template_id, Model\TemplateA return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TemplateGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\TemplateGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -269,19 +268,33 @@ public function templateAddUserWithHttpInfo(string $template_id, Model\TemplateA return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -298,9 +311,11 @@ public function templateAddUserWithHttpInfo(string $template_id, Model\TemplateA return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -313,6 +328,7 @@ public function templateAddUserWithHttpInfo(string $template_id, Model\TemplateA ); $e->setResponseObject($data); break; + } throw $e; } @@ -323,15 +339,15 @@ public function templateAddUserWithHttpInfo(string $template_id, Model\TemplateA * * Add User to Template * - * @param string $template_id The id of the Template to give the Account access to. (required) - * @param Model\TemplateAddUserRequest $template_add_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation + * @param string $template_id The id of the Template to give the Account access to. (required) + * @param Model\TemplateAddUserRequest $template_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateAddUser. This method will eventually become unavailable */ - public function templateAddUserAsync(string $template_id, Model\TemplateAddUserRequest $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) + public function templateAddUserAsync($template_id, $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) { return $this->templateAddUserAsyncWithHttpInfo($template_id, $template_add_user_request, $contentType) ->then( @@ -346,15 +362,15 @@ function ($response) { * * Add User to Template * - * @param string $template_id The id of the Template to give the Account access to. (required) - * @param Model\TemplateAddUserRequest $template_add_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation + * @param string $template_id The id of the Template to give the Account access to. (required) + * @param Model\TemplateAddUserRequest $template_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateAddUser. This method will eventually become unavailable */ - public function templateAddUserAsyncWithHttpInfo(string $template_id, Model\TemplateAddUserRequest $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) + public function templateAddUserAsyncWithHttpInfo($template_id, $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; $request = $this->templateAddUserRequest($template_id, $template_add_user_request, $contentType); @@ -364,9 +380,9 @@ public function templateAddUserAsyncWithHttpInfo(string $template_id, Model\Temp ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -375,7 +391,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -389,7 +405,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -398,30 +414,32 @@ function ($exception) { /** * Create request for operation 'templateAddUser' * - * @param string $template_id The id of the Template to give the Account access to. (required) - * @param Model\TemplateAddUserRequest $template_add_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation + * @param string $template_id The id of the Template to give the Account access to. (required) + * @param Model\TemplateAddUserRequest $template_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::templateAddUser. This method will eventually become unavailable */ - public function templateAddUserRequest(string $template_id, Model\TemplateAddUserRequest $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) + public function templateAddUserRequest($template_id, $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) { + // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $template_id when calling templateAddUser' ); } // verify the required parameter 'template_add_user_request' is set if ($template_add_user_request === null || (is_array($template_add_user_request) && count($template_add_user_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $template_add_user_request when calling templateAddUser' ); } + $resourcePath = '/template/add_user/{template_id}'; $formParams = []; $queryParams = []; @@ -435,17 +453,19 @@ public function templateAddUserRequest(string $template_id, Model\TemplateAddUse $multipart = !empty($formParams); + // path params if ($template_id !== null) { $resourcePath = str_replace( - '{template_id}', + '{' . 'template_id' . '}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -453,7 +473,7 @@ public function templateAddUserRequest(string $template_id, Model\TemplateAddUse // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_add_user_request)); } else { $httpBody = $template_add_user_request; @@ -466,7 +486,7 @@ public function templateAddUserRequest(string $template_id, Model\TemplateAddUse foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -483,8 +503,9 @@ public function templateAddUserRequest(string $template_id, Model\TemplateAddUse $payloadHook('multipart', $multipartContents, $template_add_user_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -527,13 +548,13 @@ public function templateAddUserRequest(string $template_id, Model\TemplateAddUse * * Create Template * - * @param Model\TemplateCreateRequest $template_create_request template_create_request (required) + * @param Model\TemplateCreateRequest $template_create_request template_create_request (required) * - * @return Model\TemplateCreateResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\TemplateCreateResponse */ - public function templateCreate(Model\TemplateCreateRequest $template_create_request) + public function templateCreate($template_create_request) { list($response) = $this->templateCreateWithHttpInfo($template_create_request); return $response; @@ -544,15 +565,15 @@ public function templateCreate(Model\TemplateCreateRequest $template_create_requ * * Create Template * - * @param Model\TemplateCreateRequest $template_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation + * @param Model\TemplateCreateRequest $template_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation * - * @return array of Model\TemplateCreateResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\TemplateCreateResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::templateCreate. This method will eventually become unavailable */ - public function templateCreateWithHttpInfo(Model\TemplateCreateRequest $template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) + public function templateCreateWithHttpInfo($template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) { $request = $this->templateCreateRequest($template_create_request, $contentType); @@ -564,14 +585,14 @@ public function templateCreateWithHttpInfo(Model\TemplateCreateRequest $template } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -579,18 +600,6 @@ public function templateCreateWithHttpInfo(Model\TemplateCreateRequest $template $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -601,16 +610,17 @@ public function templateCreateWithHttpInfo(Model\TemplateCreateRequest $template return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TemplateCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\TemplateCreateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -627,19 +637,33 @@ public function templateCreateWithHttpInfo(Model\TemplateCreateRequest $template return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateCreateResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\TemplateCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -656,9 +680,11 @@ public function templateCreateWithHttpInfo(Model\TemplateCreateRequest $template return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -671,6 +697,7 @@ public function templateCreateWithHttpInfo(Model\TemplateCreateRequest $template ); $e->setResponseObject($data); break; + } throw $e; } @@ -681,14 +708,14 @@ public function templateCreateWithHttpInfo(Model\TemplateCreateRequest $template * * Create Template * - * @param Model\TemplateCreateRequest $template_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation + * @param Model\TemplateCreateRequest $template_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateCreate. This method will eventually become unavailable */ - public function templateCreateAsync(Model\TemplateCreateRequest $template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) + public function templateCreateAsync($template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) { return $this->templateCreateAsyncWithHttpInfo($template_create_request, $contentType) ->then( @@ -703,14 +730,14 @@ function ($response) { * * Create Template * - * @param Model\TemplateCreateRequest $template_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation + * @param Model\TemplateCreateRequest $template_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateCreate. This method will eventually become unavailable */ - public function templateCreateAsyncWithHttpInfo(Model\TemplateCreateRequest $template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) + public function templateCreateAsyncWithHttpInfo($template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateCreateResponse'; $request = $this->templateCreateRequest($template_create_request, $contentType); @@ -720,9 +747,9 @@ public function templateCreateAsyncWithHttpInfo(Model\TemplateCreateRequest $tem ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -731,7 +758,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -745,7 +772,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -754,22 +781,24 @@ function ($exception) { /** * Create request for operation 'templateCreate' * - * @param Model\TemplateCreateRequest $template_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation + * @param Model\TemplateCreateRequest $template_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::templateCreate. This method will eventually become unavailable */ - public function templateCreateRequest(Model\TemplateCreateRequest $template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) + public function templateCreateRequest($template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) { + // verify the required parameter 'template_create_request' is set if ($template_create_request === null || (is_array($template_create_request) && count($template_create_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $template_create_request when calling templateCreate' ); } + $resourcePath = '/template/create'; $formParams = []; $queryParams = []; @@ -783,8 +812,11 @@ public function templateCreateRequest(Model\TemplateCreateRequest $template_crea $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -792,7 +824,7 @@ public function templateCreateRequest(Model\TemplateCreateRequest $template_crea // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_create_request)); } else { $httpBody = $template_create_request; @@ -805,7 +837,7 @@ public function templateCreateRequest(Model\TemplateCreateRequest $template_crea foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -822,8 +854,9 @@ public function templateCreateRequest(Model\TemplateCreateRequest $template_crea $payloadHook('multipart', $multipartContents, $template_create_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -866,13 +899,13 @@ public function templateCreateRequest(Model\TemplateCreateRequest $template_crea * * Create Embedded Template Draft * - * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request template_create_embedded_draft_request (required) + * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request template_create_embedded_draft_request (required) * - * @return Model\TemplateCreateEmbeddedDraftResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\TemplateCreateEmbeddedDraftResponse */ - public function templateCreateEmbeddedDraft(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request) + public function templateCreateEmbeddedDraft($template_create_embedded_draft_request) { list($response) = $this->templateCreateEmbeddedDraftWithHttpInfo($template_create_embedded_draft_request); return $response; @@ -883,15 +916,15 @@ public function templateCreateEmbeddedDraft(Model\TemplateCreateEmbeddedDraftReq * * Create Embedded Template Draft * - * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation + * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation * - * @return array of Model\TemplateCreateEmbeddedDraftResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\TemplateCreateEmbeddedDraftResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::templateCreateEmbeddedDraft. This method will eventually become unavailable */ - public function templateCreateEmbeddedDraftWithHttpInfo(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) + public function templateCreateEmbeddedDraftWithHttpInfo($template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) { $request = $this->templateCreateEmbeddedDraftRequest($template_create_embedded_draft_request, $contentType); @@ -903,14 +936,14 @@ public function templateCreateEmbeddedDraftWithHttpInfo(Model\TemplateCreateEmbe } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -918,18 +951,6 @@ public function templateCreateEmbeddedDraftWithHttpInfo(Model\TemplateCreateEmbe $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -940,16 +961,17 @@ public function templateCreateEmbeddedDraftWithHttpInfo(Model\TemplateCreateEmbe return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -966,19 +988,33 @@ public function templateCreateEmbeddedDraftWithHttpInfo(Model\TemplateCreateEmbe return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -995,9 +1031,11 @@ public function templateCreateEmbeddedDraftWithHttpInfo(Model\TemplateCreateEmbe return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1010,6 +1048,7 @@ public function templateCreateEmbeddedDraftWithHttpInfo(Model\TemplateCreateEmbe ); $e->setResponseObject($data); break; + } throw $e; } @@ -1020,14 +1059,14 @@ public function templateCreateEmbeddedDraftWithHttpInfo(Model\TemplateCreateEmbe * * Create Embedded Template Draft * - * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation + * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateCreateEmbeddedDraft. This method will eventually become unavailable */ - public function templateCreateEmbeddedDraftAsync(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) + public function templateCreateEmbeddedDraftAsync($template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) { return $this->templateCreateEmbeddedDraftAsyncWithHttpInfo($template_create_embedded_draft_request, $contentType) ->then( @@ -1042,14 +1081,14 @@ function ($response) { * * Create Embedded Template Draft * - * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation + * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateCreateEmbeddedDraft. This method will eventually become unavailable */ - public function templateCreateEmbeddedDraftAsyncWithHttpInfo(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) + public function templateCreateEmbeddedDraftAsyncWithHttpInfo($template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse'; $request = $this->templateCreateEmbeddedDraftRequest($template_create_embedded_draft_request, $contentType); @@ -1059,9 +1098,9 @@ public function templateCreateEmbeddedDraftAsyncWithHttpInfo(Model\TemplateCreat ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1070,7 +1109,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -1084,7 +1123,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1093,22 +1132,24 @@ function ($exception) { /** * Create request for operation 'templateCreateEmbeddedDraft' * - * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation + * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::templateCreateEmbeddedDraft. This method will eventually become unavailable */ - public function templateCreateEmbeddedDraftRequest(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) + public function templateCreateEmbeddedDraftRequest($template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) { + // verify the required parameter 'template_create_embedded_draft_request' is set if ($template_create_embedded_draft_request === null || (is_array($template_create_embedded_draft_request) && count($template_create_embedded_draft_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $template_create_embedded_draft_request when calling templateCreateEmbeddedDraft' ); } + $resourcePath = '/template/create_embedded_draft'; $formParams = []; $queryParams = []; @@ -1122,8 +1163,11 @@ public function templateCreateEmbeddedDraftRequest(Model\TemplateCreateEmbeddedD $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1131,7 +1175,7 @@ public function templateCreateEmbeddedDraftRequest(Model\TemplateCreateEmbeddedD // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_create_embedded_draft_request)); } else { $httpBody = $template_create_embedded_draft_request; @@ -1144,7 +1188,7 @@ public function templateCreateEmbeddedDraftRequest(Model\TemplateCreateEmbeddedD foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1161,8 +1205,9 @@ public function templateCreateEmbeddedDraftRequest(Model\TemplateCreateEmbeddedD $payloadHook('multipart', $multipartContents, $template_create_embedded_draft_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1205,12 +1250,13 @@ public function templateCreateEmbeddedDraftRequest(Model\TemplateCreateEmbeddedD * * Delete Template * - * @param string $template_id The id of the Template to delete. (required) + * @param string $template_id The id of the Template to delete. (required) * * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return void */ - public function templateDelete(string $template_id) + public function templateDelete($template_id) { $this->templateDeleteWithHttpInfo($template_id); } @@ -1220,15 +1266,15 @@ public function templateDelete(string $template_id) * * Delete Template * - * @param string $template_id The id of the Template to delete. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation + * @param string $template_id The id of the Template to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation * - * @return array of null, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::templateDelete. This method will eventually become unavailable */ - public function templateDeleteWithHttpInfo(string $template_id, string $contentType = self::contentTypes['templateDelete'][0]) + public function templateDeleteWithHttpInfo($template_id, string $contentType = self::contentTypes['templateDelete'][0]) { $request = $this->templateDeleteRequest($template_id, $contentType); @@ -1240,14 +1286,14 @@ public function templateDeleteWithHttpInfo(string $template_id, string $contentT } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -1255,25 +1301,16 @@ public function templateDeleteWithHttpInfo(string $template_id, string $contentT $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() - ); - } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } switch ($e->getCode()) { + } throw $e; } @@ -1284,14 +1321,14 @@ public function templateDeleteWithHttpInfo(string $template_id, string $contentT * * Delete Template * - * @param string $template_id The id of the Template to delete. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation + * @param string $template_id The id of the Template to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateDelete. This method will eventually become unavailable */ - public function templateDeleteAsync(string $template_id, string $contentType = self::contentTypes['templateDelete'][0]) + public function templateDeleteAsync($template_id, string $contentType = self::contentTypes['templateDelete'][0]) { return $this->templateDeleteAsyncWithHttpInfo($template_id, $contentType) ->then( @@ -1306,14 +1343,14 @@ function ($response) { * * Delete Template * - * @param string $template_id The id of the Template to delete. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation + * @param string $template_id The id of the Template to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateDelete. This method will eventually become unavailable */ - public function templateDeleteAsyncWithHttpInfo(string $template_id, string $contentType = self::contentTypes['templateDelete'][0]) + public function templateDeleteAsyncWithHttpInfo($template_id, string $contentType = self::contentTypes['templateDelete'][0]) { $returnType = ''; $request = $this->templateDeleteRequest($template_id, $contentType); @@ -1321,7 +1358,7 @@ public function templateDeleteAsyncWithHttpInfo(string $template_id, string $con return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( - function ($response) { + function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { @@ -1335,7 +1372,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1344,22 +1381,24 @@ function ($exception) { /** * Create request for operation 'templateDelete' * - * @param string $template_id The id of the Template to delete. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation + * @param string $template_id The id of the Template to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::templateDelete. This method will eventually become unavailable */ - public function templateDeleteRequest(string $template_id, string $contentType = self::contentTypes['templateDelete'][0]) + public function templateDeleteRequest($template_id, string $contentType = self::contentTypes['templateDelete'][0]) { + // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $template_id when calling templateDelete' ); } + $resourcePath = '/template/delete/{template_id}'; $formParams = []; $queryParams = []; @@ -1367,17 +1406,20 @@ public function templateDeleteRequest(string $template_id, string $contentType = $httpBody = ''; $multipart = false; + + // path params if ($template_id !== null) { $resourcePath = str_replace( - '{template_id}', + '{' . 'template_id' . '}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1391,7 +1433,7 @@ public function templateDeleteRequest(string $template_id, string $contentType = foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1405,8 +1447,9 @@ public function templateDeleteRequest(string $template_id, string $contentType = } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1449,14 +1492,14 @@ public function templateDeleteRequest(string $template_id, string $contentType = * * Get Template Files * - * @param string $template_id The id of the template files to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $template_id The id of the template files to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) * - * @return SplFileObject * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \SplFileObject|\Dropbox\Sign\Model\ErrorResponse */ - public function templateFiles(string $template_id, string $file_type = null) + public function templateFiles($template_id, $file_type = null) { list($response) = $this->templateFilesWithHttpInfo($template_id, $file_type); return $response; @@ -1467,16 +1510,16 @@ public function templateFiles(string $template_id, string $file_type = null) * * Get Template Files * - * @param string $template_id The id of the template files to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation * - * @return array of \SplFileObject|\Dropbox\Sign\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of \SplFileObject|\Dropbox\Sign\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::templateFiles. This method will eventually become unavailable */ - public function templateFilesWithHttpInfo(string $template_id, string $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) + public function templateFilesWithHttpInfo($template_id, $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) { $request = $this->templateFilesRequest($template_id, $file_type, $contentType); @@ -1488,14 +1531,14 @@ public function templateFilesWithHttpInfo(string $template_id, string $file_type } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -1503,18 +1546,6 @@ public function templateFilesWithHttpInfo(string $template_id, string $file_type $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -1525,16 +1556,17 @@ public function templateFilesWithHttpInfo(string $template_id, string $file_type return $result; } + switch ($statusCode) { case 200: if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\SplFileObject' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1551,19 +1583,33 @@ public function templateFilesWithHttpInfo(string $template_id, string $file_type return [ ObjectSerializer::deserialize($content, '\SplFileObject', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\SplFileObject'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1580,9 +1626,11 @@ public function templateFilesWithHttpInfo(string $template_id, string $file_type return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1595,6 +1643,7 @@ public function templateFilesWithHttpInfo(string $template_id, string $file_type ); $e->setResponseObject($data); break; + } throw $e; } @@ -1605,15 +1654,15 @@ public function templateFilesWithHttpInfo(string $template_id, string $file_type * * Get Template Files * - * @param string $template_id The id of the template files to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateFiles. This method will eventually become unavailable */ - public function templateFilesAsync(string $template_id, string $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) + public function templateFilesAsync($template_id, $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) { return $this->templateFilesAsyncWithHttpInfo($template_id, $file_type, $contentType) ->then( @@ -1628,15 +1677,15 @@ function ($response) { * * Get Template Files * - * @param string $template_id The id of the template files to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateFiles. This method will eventually become unavailable */ - public function templateFilesAsyncWithHttpInfo(string $template_id, string $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) + public function templateFilesAsyncWithHttpInfo($template_id, $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) { $returnType = '\SplFileObject'; $request = $this->templateFilesRequest($template_id, $file_type, $contentType); @@ -1646,9 +1695,9 @@ public function templateFilesAsyncWithHttpInfo(string $template_id, string $file ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1657,7 +1706,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -1671,7 +1720,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1680,23 +1729,26 @@ function ($exception) { /** * Create request for operation 'templateFiles' * - * @param string $template_id The id of the template files to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::templateFiles. This method will eventually become unavailable */ - public function templateFilesRequest(string $template_id, string $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) + public function templateFilesRequest($template_id, $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) { + // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $template_id when calling templateFiles' ); } + + $resourcePath = '/template/files/{template_id}'; $formParams = []; $queryParams = []; @@ -1714,17 +1766,19 @@ public function templateFilesRequest(string $template_id, string $file_type = nu false // required ) ?? []); + // path params if ($template_id !== null) { $resourcePath = str_replace( - '{template_id}', + '{' . 'template_id' . '}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/pdf', 'application/zip', 'application/json'], + $multipart ? ['multipart/form-data'] : ['application/pdf', 'application/zip', 'application/json', ], $contentType, $multipart ); @@ -1738,7 +1792,7 @@ public function templateFilesRequest(string $template_id, string $file_type = nu foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1752,8 +1806,9 @@ public function templateFilesRequest(string $template_id, string $file_type = nu } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1796,13 +1851,13 @@ public function templateFilesRequest(string $template_id, string $file_type = nu * * Get Template Files as Data Uri * - * @param string $template_id The id of the template files to retrieve. (required) + * @param string $template_id The id of the template files to retrieve. (required) * - * @return Model\FileResponseDataUri * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\FileResponseDataUri */ - public function templateFilesAsDataUri(string $template_id) + public function templateFilesAsDataUri($template_id) { list($response) = $this->templateFilesAsDataUriWithHttpInfo($template_id); return $response; @@ -1813,15 +1868,15 @@ public function templateFilesAsDataUri(string $template_id) * * Get Template Files as Data Uri * - * @param string $template_id The id of the template files to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation * - * @return array of Model\FileResponseDataUri, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\FileResponseDataUri, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::templateFilesAsDataUri. This method will eventually become unavailable */ - public function templateFilesAsDataUriWithHttpInfo(string $template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) + public function templateFilesAsDataUriWithHttpInfo($template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) { $request = $this->templateFilesAsDataUriRequest($template_id, $contentType); @@ -1833,14 +1888,14 @@ public function templateFilesAsDataUriWithHttpInfo(string $template_id, string $ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -1848,18 +1903,6 @@ public function templateFilesAsDataUriWithHttpInfo(string $template_id, string $ $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -1870,16 +1913,17 @@ public function templateFilesAsDataUriWithHttpInfo(string $template_id, string $ return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FileResponseDataUri' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\FileResponseDataUri' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1896,19 +1940,33 @@ public function templateFilesAsDataUriWithHttpInfo(string $template_id, string $ return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FileResponseDataUri', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\FileResponseDataUri'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1925,9 +1983,11 @@ public function templateFilesAsDataUriWithHttpInfo(string $template_id, string $ return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1940,6 +2000,7 @@ public function templateFilesAsDataUriWithHttpInfo(string $template_id, string $ ); $e->setResponseObject($data); break; + } throw $e; } @@ -1950,14 +2011,14 @@ public function templateFilesAsDataUriWithHttpInfo(string $template_id, string $ * * Get Template Files as Data Uri * - * @param string $template_id The id of the template files to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateFilesAsDataUri. This method will eventually become unavailable */ - public function templateFilesAsDataUriAsync(string $template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) + public function templateFilesAsDataUriAsync($template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) { return $this->templateFilesAsDataUriAsyncWithHttpInfo($template_id, $contentType) ->then( @@ -1972,14 +2033,14 @@ function ($response) { * * Get Template Files as Data Uri * - * @param string $template_id The id of the template files to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateFilesAsDataUri. This method will eventually become unavailable */ - public function templateFilesAsDataUriAsyncWithHttpInfo(string $template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) + public function templateFilesAsDataUriAsyncWithHttpInfo($template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) { $returnType = '\Dropbox\Sign\Model\FileResponseDataUri'; $request = $this->templateFilesAsDataUriRequest($template_id, $contentType); @@ -1989,9 +2050,9 @@ public function templateFilesAsDataUriAsyncWithHttpInfo(string $template_id, str ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2000,7 +2061,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -2014,7 +2075,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -2023,22 +2084,24 @@ function ($exception) { /** * Create request for operation 'templateFilesAsDataUri' * - * @param string $template_id The id of the template files to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::templateFilesAsDataUri. This method will eventually become unavailable */ - public function templateFilesAsDataUriRequest(string $template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) + public function templateFilesAsDataUriRequest($template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) { + // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $template_id when calling templateFilesAsDataUri' ); } + $resourcePath = '/template/files_as_data_uri/{template_id}'; $formParams = []; $queryParams = []; @@ -2046,17 +2109,20 @@ public function templateFilesAsDataUriRequest(string $template_id, string $conte $httpBody = ''; $multipart = false; + + // path params if ($template_id !== null) { $resourcePath = str_replace( - '{template_id}', + '{' . 'template_id' . '}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -2070,7 +2136,7 @@ public function templateFilesAsDataUriRequest(string $template_id, string $conte foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -2084,8 +2150,9 @@ public function templateFilesAsDataUriRequest(string $template_id, string $conte } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2128,14 +2195,14 @@ public function templateFilesAsDataUriRequest(string $template_id, string $conte * * Get Template Files as File Url * - * @param string $template_id The id of the template files to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $template_id The id of the template files to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) * - * @return Model\FileResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\FileResponse */ - public function templateFilesAsFileUrl(string $template_id, int $force_download = 1) + public function templateFilesAsFileUrl($template_id, $force_download = 1) { list($response) = $this->templateFilesAsFileUrlWithHttpInfo($template_id, $force_download); return $response; @@ -2146,16 +2213,16 @@ public function templateFilesAsFileUrl(string $template_id, int $force_download * * Get Template Files as File Url * - * @param string $template_id The id of the template files to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation * - * @return array of Model\FileResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\FileResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::templateFilesAsFileUrl. This method will eventually become unavailable */ - public function templateFilesAsFileUrlWithHttpInfo(string $template_id, int $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) + public function templateFilesAsFileUrlWithHttpInfo($template_id, $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) { $request = $this->templateFilesAsFileUrlRequest($template_id, $force_download, $contentType); @@ -2167,14 +2234,14 @@ public function templateFilesAsFileUrlWithHttpInfo(string $template_id, int $for } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -2182,18 +2249,6 @@ public function templateFilesAsFileUrlWithHttpInfo(string $template_id, int $for $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -2204,16 +2259,17 @@ public function templateFilesAsFileUrlWithHttpInfo(string $template_id, int $for return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FileResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\FileResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2230,19 +2286,33 @@ public function templateFilesAsFileUrlWithHttpInfo(string $template_id, int $for return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FileResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\FileResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2259,9 +2329,11 @@ public function templateFilesAsFileUrlWithHttpInfo(string $template_id, int $for return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2274,6 +2346,7 @@ public function templateFilesAsFileUrlWithHttpInfo(string $template_id, int $for ); $e->setResponseObject($data); break; + } throw $e; } @@ -2284,15 +2357,15 @@ public function templateFilesAsFileUrlWithHttpInfo(string $template_id, int $for * * Get Template Files as File Url * - * @param string $template_id The id of the template files to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateFilesAsFileUrl. This method will eventually become unavailable */ - public function templateFilesAsFileUrlAsync(string $template_id, int $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) + public function templateFilesAsFileUrlAsync($template_id, $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) { return $this->templateFilesAsFileUrlAsyncWithHttpInfo($template_id, $force_download, $contentType) ->then( @@ -2307,15 +2380,15 @@ function ($response) { * * Get Template Files as File Url * - * @param string $template_id The id of the template files to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateFilesAsFileUrl. This method will eventually become unavailable */ - public function templateFilesAsFileUrlAsyncWithHttpInfo(string $template_id, int $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) + public function templateFilesAsFileUrlAsyncWithHttpInfo($template_id, $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) { $returnType = '\Dropbox\Sign\Model\FileResponse'; $request = $this->templateFilesAsFileUrlRequest($template_id, $force_download, $contentType); @@ -2325,9 +2398,9 @@ public function templateFilesAsFileUrlAsyncWithHttpInfo(string $template_id, int ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2336,7 +2409,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -2350,7 +2423,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -2359,23 +2432,26 @@ function ($exception) { /** * Create request for operation 'templateFilesAsFileUrl' * - * @param string $template_id The id of the template files to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::templateFilesAsFileUrl. This method will eventually become unavailable */ - public function templateFilesAsFileUrlRequest(string $template_id, int $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) + public function templateFilesAsFileUrlRequest($template_id, $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) { + // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $template_id when calling templateFilesAsFileUrl' ); } + + $resourcePath = '/template/files_as_file_url/{template_id}'; $formParams = []; $queryParams = []; @@ -2393,17 +2469,19 @@ public function templateFilesAsFileUrlRequest(string $template_id, int $force_do false // required ) ?? []); + // path params if ($template_id !== null) { $resourcePath = str_replace( - '{template_id}', + '{' . 'template_id' . '}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -2417,7 +2495,7 @@ public function templateFilesAsFileUrlRequest(string $template_id, int $force_do foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -2431,8 +2509,9 @@ public function templateFilesAsFileUrlRequest(string $template_id, int $force_do } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2475,13 +2554,13 @@ public function templateFilesAsFileUrlRequest(string $template_id, int $force_do * * Get Template * - * @param string $template_id The id of the Template to retrieve. (required) + * @param string $template_id The id of the Template to retrieve. (required) * - * @return Model\TemplateGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\TemplateGetResponse */ - public function templateGet(string $template_id) + public function templateGet($template_id) { list($response) = $this->templateGetWithHttpInfo($template_id); return $response; @@ -2492,15 +2571,15 @@ public function templateGet(string $template_id) * * Get Template * - * @param string $template_id The id of the Template to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation + * @param string $template_id The id of the Template to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation * - * @return array of Model\TemplateGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\TemplateGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::templateGet. This method will eventually become unavailable */ - public function templateGetWithHttpInfo(string $template_id, string $contentType = self::contentTypes['templateGet'][0]) + public function templateGetWithHttpInfo($template_id, string $contentType = self::contentTypes['templateGet'][0]) { $request = $this->templateGetRequest($template_id, $contentType); @@ -2512,14 +2591,14 @@ public function templateGetWithHttpInfo(string $template_id, string $contentType } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -2527,18 +2606,6 @@ public function templateGetWithHttpInfo(string $template_id, string $contentType $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -2549,16 +2616,17 @@ public function templateGetWithHttpInfo(string $template_id, string $contentType return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TemplateGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\TemplateGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2575,19 +2643,33 @@ public function templateGetWithHttpInfo(string $template_id, string $contentType return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2604,9 +2686,11 @@ public function templateGetWithHttpInfo(string $template_id, string $contentType return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2619,6 +2703,7 @@ public function templateGetWithHttpInfo(string $template_id, string $contentType ); $e->setResponseObject($data); break; + } throw $e; } @@ -2629,14 +2714,14 @@ public function templateGetWithHttpInfo(string $template_id, string $contentType * * Get Template * - * @param string $template_id The id of the Template to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation + * @param string $template_id The id of the Template to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateGet. This method will eventually become unavailable */ - public function templateGetAsync(string $template_id, string $contentType = self::contentTypes['templateGet'][0]) + public function templateGetAsync($template_id, string $contentType = self::contentTypes['templateGet'][0]) { return $this->templateGetAsyncWithHttpInfo($template_id, $contentType) ->then( @@ -2651,14 +2736,14 @@ function ($response) { * * Get Template * - * @param string $template_id The id of the Template to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation + * @param string $template_id The id of the Template to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateGet. This method will eventually become unavailable */ - public function templateGetAsyncWithHttpInfo(string $template_id, string $contentType = self::contentTypes['templateGet'][0]) + public function templateGetAsyncWithHttpInfo($template_id, string $contentType = self::contentTypes['templateGet'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; $request = $this->templateGetRequest($template_id, $contentType); @@ -2668,9 +2753,9 @@ public function templateGetAsyncWithHttpInfo(string $template_id, string $conten ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2679,7 +2764,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -2693,7 +2778,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -2702,22 +2787,24 @@ function ($exception) { /** * Create request for operation 'templateGet' * - * @param string $template_id The id of the Template to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation + * @param string $template_id The id of the Template to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::templateGet. This method will eventually become unavailable */ - public function templateGetRequest(string $template_id, string $contentType = self::contentTypes['templateGet'][0]) + public function templateGetRequest($template_id, string $contentType = self::contentTypes['templateGet'][0]) { + // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $template_id when calling templateGet' ); } + $resourcePath = '/template/{template_id}'; $formParams = []; $queryParams = []; @@ -2725,17 +2812,20 @@ public function templateGetRequest(string $template_id, string $contentType = se $httpBody = ''; $multipart = false; + + // path params if ($template_id !== null) { $resourcePath = str_replace( - '{template_id}', + '{' . 'template_id' . '}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -2749,7 +2839,7 @@ public function templateGetRequest(string $template_id, string $contentType = se foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -2763,8 +2853,9 @@ public function templateGetRequest(string $template_id, string $contentType = se } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2807,16 +2898,16 @@ public function templateGetRequest(string $template_id, string $contentType = se * * List Templates * - * @param string $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param string|null $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) * - * @return Model\TemplateListResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\TemplateListResponse */ - public function templateList(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null) + public function templateList($account_id = null, $page = 1, $page_size = 20, $query = null) { list($response) = $this->templateListWithHttpInfo($account_id, $page, $page_size, $query); return $response; @@ -2827,18 +2918,18 @@ public function templateList(string $account_id = null, int $page = 1, int $page * * List Templates * - * @param string $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation + * @param string|null $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation * - * @return array of Model\TemplateListResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\TemplateListResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::templateList. This method will eventually become unavailable */ - public function templateListWithHttpInfo(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null, string $contentType = self::contentTypes['templateList'][0]) + public function templateListWithHttpInfo($account_id = null, $page = 1, $page_size = 20, $query = null, string $contentType = self::contentTypes['templateList'][0]) { $request = $this->templateListRequest($account_id, $page, $page_size, $query, $contentType); @@ -2850,14 +2941,14 @@ public function templateListWithHttpInfo(string $account_id = null, int $page = } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -2865,18 +2956,6 @@ public function templateListWithHttpInfo(string $account_id = null, int $page = $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -2887,16 +2966,17 @@ public function templateListWithHttpInfo(string $account_id = null, int $page = return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TemplateListResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\TemplateListResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2913,19 +2993,33 @@ public function templateListWithHttpInfo(string $account_id = null, int $page = return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateListResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\TemplateListResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2942,9 +3036,11 @@ public function templateListWithHttpInfo(string $account_id = null, int $page = return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2957,6 +3053,7 @@ public function templateListWithHttpInfo(string $account_id = null, int $page = ); $e->setResponseObject($data); break; + } throw $e; } @@ -2967,17 +3064,17 @@ public function templateListWithHttpInfo(string $account_id = null, int $page = * * List Templates * - * @param string $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation + * @param string|null $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateList. This method will eventually become unavailable */ - public function templateListAsync(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null, string $contentType = self::contentTypes['templateList'][0]) + public function templateListAsync($account_id = null, $page = 1, $page_size = 20, $query = null, string $contentType = self::contentTypes['templateList'][0]) { return $this->templateListAsyncWithHttpInfo($account_id, $page, $page_size, $query, $contentType) ->then( @@ -2992,17 +3089,17 @@ function ($response) { * * List Templates * - * @param string $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation + * @param string|null $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateList. This method will eventually become unavailable */ - public function templateListAsyncWithHttpInfo(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null, string $contentType = self::contentTypes['templateList'][0]) + public function templateListAsyncWithHttpInfo($account_id = null, $page = 1, $page_size = 20, $query = null, string $contentType = self::contentTypes['templateList'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateListResponse'; $request = $this->templateListRequest($account_id, $page, $page_size, $query, $contentType); @@ -3012,9 +3109,9 @@ public function templateListAsyncWithHttpInfo(string $account_id = null, int $pa ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -3023,7 +3120,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -3037,7 +3134,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -3046,25 +3143,30 @@ function ($exception) { /** * Create request for operation 'templateList' * - * @param string $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation + * @param string|null $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::templateList. This method will eventually become unavailable */ - public function templateListRequest(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null, string $contentType = self::contentTypes['templateList'][0]) + public function templateListRequest($account_id = null, $page = 1, $page_size = 20, $query = null, string $contentType = self::contentTypes['templateList'][0]) { + + + if ($page_size !== null && $page_size > 100) { - throw new InvalidArgumentException('invalid value for "$page_size" when calling TemplateApi.templateList, must be smaller than or equal to 100.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling TemplateApi.templateList, must be smaller than or equal to 100.'); } if ($page_size !== null && $page_size < 1) { - throw new InvalidArgumentException('invalid value for "$page_size" when calling TemplateApi.templateList, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling TemplateApi.templateList, must be bigger than or equal to 1.'); } + + $resourcePath = '/template/list'; $formParams = []; $queryParams = []; @@ -3109,8 +3211,11 @@ public function templateListRequest(string $account_id = null, int $page = 1, in false // required ) ?? []); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -3124,7 +3229,7 @@ public function templateListRequest(string $account_id = null, int $page = 1, in foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -3138,8 +3243,9 @@ public function templateListRequest(string $account_id = null, int $page = 1, in } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -3182,14 +3288,14 @@ public function templateListRequest(string $account_id = null, int $page = 1, in * * Remove User from Template * - * @param string $template_id The id of the Template to remove the Account's access to. (required) - * @param Model\TemplateRemoveUserRequest $template_remove_user_request template_remove_user_request (required) + * @param string $template_id The id of the Template to remove the Account's access to. (required) + * @param Model\TemplateRemoveUserRequest $template_remove_user_request template_remove_user_request (required) * - * @return Model\TemplateGetResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\TemplateGetResponse */ - public function templateRemoveUser(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request) + public function templateRemoveUser($template_id, $template_remove_user_request) { list($response) = $this->templateRemoveUserWithHttpInfo($template_id, $template_remove_user_request); return $response; @@ -3200,16 +3306,16 @@ public function templateRemoveUser(string $template_id, Model\TemplateRemoveUser * * Remove User from Template * - * @param string $template_id The id of the Template to remove the Account's access to. (required) - * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation + * @param string $template_id The id of the Template to remove the Account's access to. (required) + * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation * - * @return array of Model\TemplateGetResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\TemplateGetResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::templateRemoveUser. This method will eventually become unavailable */ - public function templateRemoveUserWithHttpInfo(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) + public function templateRemoveUserWithHttpInfo($template_id, $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) { $request = $this->templateRemoveUserRequest($template_id, $template_remove_user_request, $contentType); @@ -3221,14 +3327,14 @@ public function templateRemoveUserWithHttpInfo(string $template_id, Model\Templa } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -3236,18 +3342,6 @@ public function templateRemoveUserWithHttpInfo(string $template_id, Model\Templa $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -3258,16 +3352,17 @@ public function templateRemoveUserWithHttpInfo(string $template_id, Model\Templa return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TemplateGetResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\TemplateGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3284,19 +3379,33 @@ public function templateRemoveUserWithHttpInfo(string $template_id, Model\Templa return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateGetResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3313,9 +3422,11 @@ public function templateRemoveUserWithHttpInfo(string $template_id, Model\Templa return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -3328,6 +3439,7 @@ public function templateRemoveUserWithHttpInfo(string $template_id, Model\Templa ); $e->setResponseObject($data); break; + } throw $e; } @@ -3338,15 +3450,15 @@ public function templateRemoveUserWithHttpInfo(string $template_id, Model\Templa * * Remove User from Template * - * @param string $template_id The id of the Template to remove the Account's access to. (required) - * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation + * @param string $template_id The id of the Template to remove the Account's access to. (required) + * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateRemoveUser. This method will eventually become unavailable */ - public function templateRemoveUserAsync(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) + public function templateRemoveUserAsync($template_id, $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) { return $this->templateRemoveUserAsyncWithHttpInfo($template_id, $template_remove_user_request, $contentType) ->then( @@ -3361,15 +3473,15 @@ function ($response) { * * Remove User from Template * - * @param string $template_id The id of the Template to remove the Account's access to. (required) - * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation + * @param string $template_id The id of the Template to remove the Account's access to. (required) + * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateRemoveUser. This method will eventually become unavailable */ - public function templateRemoveUserAsyncWithHttpInfo(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) + public function templateRemoveUserAsyncWithHttpInfo($template_id, $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; $request = $this->templateRemoveUserRequest($template_id, $template_remove_user_request, $contentType); @@ -3379,9 +3491,9 @@ public function templateRemoveUserAsyncWithHttpInfo(string $template_id, Model\T ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -3390,7 +3502,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -3404,7 +3516,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -3413,30 +3525,32 @@ function ($exception) { /** * Create request for operation 'templateRemoveUser' * - * @param string $template_id The id of the Template to remove the Account's access to. (required) - * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation + * @param string $template_id The id of the Template to remove the Account's access to. (required) + * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::templateRemoveUser. This method will eventually become unavailable */ - public function templateRemoveUserRequest(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) + public function templateRemoveUserRequest($template_id, $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) { + // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $template_id when calling templateRemoveUser' ); } // verify the required parameter 'template_remove_user_request' is set if ($template_remove_user_request === null || (is_array($template_remove_user_request) && count($template_remove_user_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $template_remove_user_request when calling templateRemoveUser' ); } + $resourcePath = '/template/remove_user/{template_id}'; $formParams = []; $queryParams = []; @@ -3450,17 +3564,19 @@ public function templateRemoveUserRequest(string $template_id, Model\TemplateRem $multipart = !empty($formParams); + // path params if ($template_id !== null) { $resourcePath = str_replace( - '{template_id}', + '{' . 'template_id' . '}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -3468,7 +3584,7 @@ public function templateRemoveUserRequest(string $template_id, Model\TemplateRem // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_remove_user_request)); } else { $httpBody = $template_remove_user_request; @@ -3481,7 +3597,7 @@ public function templateRemoveUserRequest(string $template_id, Model\TemplateRem foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -3498,8 +3614,9 @@ public function templateRemoveUserRequest(string $template_id, Model\TemplateRem $payloadHook('multipart', $multipartContents, $template_remove_user_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -3542,14 +3659,14 @@ public function templateRemoveUserRequest(string $template_id, Model\TemplateRem * * Update Template Files * - * @param string $template_id The ID of the template whose files to update. (required) - * @param Model\TemplateUpdateFilesRequest $template_update_files_request template_update_files_request (required) + * @param string $template_id The ID of the template whose files to update. (required) + * @param Model\TemplateUpdateFilesRequest $template_update_files_request template_update_files_request (required) * - * @return Model\TemplateUpdateFilesResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\TemplateUpdateFilesResponse */ - public function templateUpdateFiles(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request) + public function templateUpdateFiles($template_id, $template_update_files_request) { list($response) = $this->templateUpdateFilesWithHttpInfo($template_id, $template_update_files_request); return $response; @@ -3560,16 +3677,16 @@ public function templateUpdateFiles(string $template_id, Model\TemplateUpdateFil * * Update Template Files * - * @param string $template_id The ID of the template whose files to update. (required) - * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation + * @param string $template_id The ID of the template whose files to update. (required) + * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation * - * @return array of Model\TemplateUpdateFilesResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\TemplateUpdateFilesResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::templateUpdateFiles. This method will eventually become unavailable */ - public function templateUpdateFilesWithHttpInfo(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) + public function templateUpdateFilesWithHttpInfo($template_id, $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) { $request = $this->templateUpdateFilesRequest($template_id, $template_update_files_request, $contentType); @@ -3581,14 +3698,14 @@ public function templateUpdateFilesWithHttpInfo(string $template_id, Model\Templ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -3596,18 +3713,6 @@ public function templateUpdateFilesWithHttpInfo(string $template_id, Model\Templ $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -3618,16 +3723,17 @@ public function templateUpdateFilesWithHttpInfo(string $template_id, Model\Templ return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TemplateUpdateFilesResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\TemplateUpdateFilesResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3644,19 +3750,33 @@ public function templateUpdateFilesWithHttpInfo(string $template_id, Model\Templ return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateUpdateFilesResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\TemplateUpdateFilesResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3673,9 +3793,11 @@ public function templateUpdateFilesWithHttpInfo(string $template_id, Model\Templ return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -3688,6 +3810,7 @@ public function templateUpdateFilesWithHttpInfo(string $template_id, Model\Templ ); $e->setResponseObject($data); break; + } throw $e; } @@ -3698,15 +3821,15 @@ public function templateUpdateFilesWithHttpInfo(string $template_id, Model\Templ * * Update Template Files * - * @param string $template_id The ID of the template whose files to update. (required) - * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation + * @param string $template_id The ID of the template whose files to update. (required) + * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateUpdateFiles. This method will eventually become unavailable */ - public function templateUpdateFilesAsync(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) + public function templateUpdateFilesAsync($template_id, $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) { return $this->templateUpdateFilesAsyncWithHttpInfo($template_id, $template_update_files_request, $contentType) ->then( @@ -3721,15 +3844,15 @@ function ($response) { * * Update Template Files * - * @param string $template_id The ID of the template whose files to update. (required) - * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation + * @param string $template_id The ID of the template whose files to update. (required) + * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::templateUpdateFiles. This method will eventually become unavailable */ - public function templateUpdateFilesAsyncWithHttpInfo(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) + public function templateUpdateFilesAsyncWithHttpInfo($template_id, $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateUpdateFilesResponse'; $request = $this->templateUpdateFilesRequest($template_id, $template_update_files_request, $contentType); @@ -3739,9 +3862,9 @@ public function templateUpdateFilesAsyncWithHttpInfo(string $template_id, Model\ ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -3750,7 +3873,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -3764,7 +3887,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -3773,30 +3896,32 @@ function ($exception) { /** * Create request for operation 'templateUpdateFiles' * - * @param string $template_id The ID of the template whose files to update. (required) - * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation + * @param string $template_id The ID of the template whose files to update. (required) + * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::templateUpdateFiles. This method will eventually become unavailable */ - public function templateUpdateFilesRequest(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) + public function templateUpdateFilesRequest($template_id, $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) { + // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $template_id when calling templateUpdateFiles' ); } // verify the required parameter 'template_update_files_request' is set if ($template_update_files_request === null || (is_array($template_update_files_request) && count($template_update_files_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $template_update_files_request when calling templateUpdateFiles' ); } + $resourcePath = '/template/update_files/{template_id}'; $formParams = []; $queryParams = []; @@ -3810,17 +3935,19 @@ public function templateUpdateFilesRequest(string $template_id, Model\TemplateUp $multipart = !empty($formParams); + // path params if ($template_id !== null) { $resourcePath = str_replace( - '{template_id}', + '{' . 'template_id' . '}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -3828,7 +3955,7 @@ public function templateUpdateFilesRequest(string $template_id, Model\TemplateUp // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_update_files_request)); } else { $httpBody = $template_update_files_request; @@ -3841,7 +3968,7 @@ public function templateUpdateFilesRequest(string $template_id, Model\TemplateUp foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -3858,8 +3985,9 @@ public function templateUpdateFilesRequest(string $template_id, Model\TemplateUp $payloadHook('multipart', $multipartContents, $template_update_files_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -3900,8 +4028,8 @@ public function templateUpdateFilesRequest(string $template_id, Model\TemplateUp /** * Create http client option * + * @throws \RuntimeException on file opening failure * @return array of http client options - * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -3909,7 +4037,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -3925,8 +4053,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -3936,9 +4064,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); } return [ @@ -3957,8 +4085,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/UnclaimedDraftApi.php b/sdks/php/src/Api/UnclaimedDraftApi.php index 3886a87c5..eb41b67a3 100644 --- a/sdks/php/src/Api/UnclaimedDraftApi.php +++ b/sdks/php/src/Api/UnclaimedDraftApi.php @@ -1,10 +1,13 @@ [ 'application/json', @@ -88,12 +96,15 @@ class UnclaimedDraftApi protected $response; /** - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param Configuration $config + * @param ClientInterface $client + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - Configuration $config = null, - ClientInterface $client = null, - HeaderSelector $selector = null, + ?Configuration $config = null, + ?ClientInterface $client = null, + ?HeaderSelector $selector = null, int $hostIndex = 0 ) { $this->client = $client ?: new Client(); @@ -108,7 +119,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex(int $hostIndex): void + public function setHostIndex($hostIndex): void { $this->hostIndex = $hostIndex; } @@ -145,13 +156,13 @@ public function getResponse() * * Create Unclaimed Draft * - * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request unclaimed_draft_create_request (required) + * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request unclaimed_draft_create_request (required) * - * @return Model\UnclaimedDraftCreateResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\UnclaimedDraftCreateResponse */ - public function unclaimedDraftCreate(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request) + public function unclaimedDraftCreate($unclaimed_draft_create_request) { list($response) = $this->unclaimedDraftCreateWithHttpInfo($unclaimed_draft_create_request); return $response; @@ -162,15 +173,15 @@ public function unclaimedDraftCreate(Model\UnclaimedDraftCreateRequest $unclaime * * Create Unclaimed Draft * - * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation * - * @return array of Model\UnclaimedDraftCreateResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\UnclaimedDraftCreateResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::unclaimedDraftCreate. This method will eventually become unavailable */ - public function unclaimedDraftCreateWithHttpInfo(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) + public function unclaimedDraftCreateWithHttpInfo($unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) { $request = $this->unclaimedDraftCreateRequest($unclaimed_draft_create_request, $contentType); @@ -182,14 +193,14 @@ public function unclaimedDraftCreateWithHttpInfo(Model\UnclaimedDraftCreateReque } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -197,18 +208,6 @@ public function unclaimedDraftCreateWithHttpInfo(Model\UnclaimedDraftCreateReque $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -219,16 +218,17 @@ public function unclaimedDraftCreateWithHttpInfo(Model\UnclaimedDraftCreateReque return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -245,19 +245,33 @@ public function unclaimedDraftCreateWithHttpInfo(Model\UnclaimedDraftCreateReque return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -274,9 +288,11 @@ public function unclaimedDraftCreateWithHttpInfo(Model\UnclaimedDraftCreateReque return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -289,6 +305,7 @@ public function unclaimedDraftCreateWithHttpInfo(Model\UnclaimedDraftCreateReque ); $e->setResponseObject($data); break; + } throw $e; } @@ -299,14 +316,14 @@ public function unclaimedDraftCreateWithHttpInfo(Model\UnclaimedDraftCreateReque * * Create Unclaimed Draft * - * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftCreate. This method will eventually become unavailable */ - public function unclaimedDraftCreateAsync(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) + public function unclaimedDraftCreateAsync($unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) { return $this->unclaimedDraftCreateAsyncWithHttpInfo($unclaimed_draft_create_request, $contentType) ->then( @@ -321,14 +338,14 @@ function ($response) { * * Create Unclaimed Draft * - * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftCreate. This method will eventually become unavailable */ - public function unclaimedDraftCreateAsyncWithHttpInfo(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) + public function unclaimedDraftCreateAsyncWithHttpInfo($unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) { $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; $request = $this->unclaimedDraftCreateRequest($unclaimed_draft_create_request, $contentType); @@ -338,9 +355,9 @@ public function unclaimedDraftCreateAsyncWithHttpInfo(Model\UnclaimedDraftCreate ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -349,7 +366,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -363,7 +380,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -372,22 +389,24 @@ function ($exception) { /** * Create request for operation 'unclaimedDraftCreate' * - * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::unclaimedDraftCreate. This method will eventually become unavailable */ - public function unclaimedDraftCreateRequest(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) + public function unclaimedDraftCreateRequest($unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) { + // verify the required parameter 'unclaimed_draft_create_request' is set if ($unclaimed_draft_create_request === null || (is_array($unclaimed_draft_create_request) && count($unclaimed_draft_create_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $unclaimed_draft_create_request when calling unclaimedDraftCreate' ); } + $resourcePath = '/unclaimed_draft/create'; $formParams = []; $queryParams = []; @@ -401,8 +420,11 @@ public function unclaimedDraftCreateRequest(Model\UnclaimedDraftCreateRequest $u $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -410,7 +432,7 @@ public function unclaimedDraftCreateRequest(Model\UnclaimedDraftCreateRequest $u // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($unclaimed_draft_create_request)); } else { $httpBody = $unclaimed_draft_create_request; @@ -423,7 +445,7 @@ public function unclaimedDraftCreateRequest(Model\UnclaimedDraftCreateRequest $u foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -440,8 +462,9 @@ public function unclaimedDraftCreateRequest(Model\UnclaimedDraftCreateRequest $u $payloadHook('multipart', $multipartContents, $unclaimed_draft_create_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -484,13 +507,13 @@ public function unclaimedDraftCreateRequest(Model\UnclaimedDraftCreateRequest $u * * Create Embedded Unclaimed Draft * - * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request unclaimed_draft_create_embedded_request (required) + * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request unclaimed_draft_create_embedded_request (required) * - * @return Model\UnclaimedDraftCreateResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\UnclaimedDraftCreateResponse */ - public function unclaimedDraftCreateEmbedded(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request) + public function unclaimedDraftCreateEmbedded($unclaimed_draft_create_embedded_request) { list($response) = $this->unclaimedDraftCreateEmbeddedWithHttpInfo($unclaimed_draft_create_embedded_request); return $response; @@ -501,15 +524,15 @@ public function unclaimedDraftCreateEmbedded(Model\UnclaimedDraftCreateEmbeddedR * * Create Embedded Unclaimed Draft * - * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation * - * @return array of Model\UnclaimedDraftCreateResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\UnclaimedDraftCreateResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::unclaimedDraftCreateEmbedded. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedWithHttpInfo(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) + public function unclaimedDraftCreateEmbeddedWithHttpInfo($unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) { $request = $this->unclaimedDraftCreateEmbeddedRequest($unclaimed_draft_create_embedded_request, $contentType); @@ -521,14 +544,14 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo(Model\UnclaimedDraftCre } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -536,18 +559,6 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo(Model\UnclaimedDraftCre $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -558,16 +569,17 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo(Model\UnclaimedDraftCre return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -584,19 +596,33 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo(Model\UnclaimedDraftCre return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -613,9 +639,11 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo(Model\UnclaimedDraftCre return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -628,6 +656,7 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo(Model\UnclaimedDraftCre ); $e->setResponseObject($data); break; + } throw $e; } @@ -638,14 +667,14 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo(Model\UnclaimedDraftCre * * Create Embedded Unclaimed Draft * - * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftCreateEmbedded. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedAsync(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) + public function unclaimedDraftCreateEmbeddedAsync($unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) { return $this->unclaimedDraftCreateEmbeddedAsyncWithHttpInfo($unclaimed_draft_create_embedded_request, $contentType) ->then( @@ -660,14 +689,14 @@ function ($response) { * * Create Embedded Unclaimed Draft * - * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftCreateEmbedded. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedAsyncWithHttpInfo(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) + public function unclaimedDraftCreateEmbeddedAsyncWithHttpInfo($unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) { $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; $request = $this->unclaimedDraftCreateEmbeddedRequest($unclaimed_draft_create_embedded_request, $contentType); @@ -677,9 +706,9 @@ public function unclaimedDraftCreateEmbeddedAsyncWithHttpInfo(Model\UnclaimedDra ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -688,7 +717,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -702,7 +731,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -711,22 +740,24 @@ function ($exception) { /** * Create request for operation 'unclaimedDraftCreateEmbedded' * - * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::unclaimedDraftCreateEmbedded. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedRequest(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) + public function unclaimedDraftCreateEmbeddedRequest($unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) { + // verify the required parameter 'unclaimed_draft_create_embedded_request' is set if ($unclaimed_draft_create_embedded_request === null || (is_array($unclaimed_draft_create_embedded_request) && count($unclaimed_draft_create_embedded_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $unclaimed_draft_create_embedded_request when calling unclaimedDraftCreateEmbedded' ); } + $resourcePath = '/unclaimed_draft/create_embedded'; $formParams = []; $queryParams = []; @@ -740,8 +771,11 @@ public function unclaimedDraftCreateEmbeddedRequest(Model\UnclaimedDraftCreateEm $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -749,7 +783,7 @@ public function unclaimedDraftCreateEmbeddedRequest(Model\UnclaimedDraftCreateEm // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($unclaimed_draft_create_embedded_request)); } else { $httpBody = $unclaimed_draft_create_embedded_request; @@ -762,7 +796,7 @@ public function unclaimedDraftCreateEmbeddedRequest(Model\UnclaimedDraftCreateEm foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -779,8 +813,9 @@ public function unclaimedDraftCreateEmbeddedRequest(Model\UnclaimedDraftCreateEm $payloadHook('multipart', $multipartContents, $unclaimed_draft_create_embedded_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -823,13 +858,13 @@ public function unclaimedDraftCreateEmbeddedRequest(Model\UnclaimedDraftCreateEm * * Create Embedded Unclaimed Draft with Template * - * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request unclaimed_draft_create_embedded_with_template_request (required) + * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request unclaimed_draft_create_embedded_with_template_request (required) * - * @return Model\UnclaimedDraftCreateResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\UnclaimedDraftCreateResponse */ - public function unclaimedDraftCreateEmbeddedWithTemplate(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request) + public function unclaimedDraftCreateEmbeddedWithTemplate($unclaimed_draft_create_embedded_with_template_request) { list($response) = $this->unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo($unclaimed_draft_create_embedded_with_template_request); return $response; @@ -840,15 +875,15 @@ public function unclaimedDraftCreateEmbeddedWithTemplate(Model\UnclaimedDraftCre * * Create Embedded Unclaimed Draft with Template * - * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @return array of Model\UnclaimedDraftCreateResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\UnclaimedDraftCreateResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::unclaimedDraftCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) + public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo($unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) { $request = $this->unclaimedDraftCreateEmbeddedWithTemplateRequest($unclaimed_draft_create_embedded_with_template_request, $contentType); @@ -860,14 +895,14 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(Model\Uncla } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -875,18 +910,6 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(Model\Uncla $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -897,16 +920,17 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(Model\Uncla return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -923,19 +947,33 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(Model\Uncla return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -952,9 +990,11 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(Model\Uncla return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -967,6 +1007,7 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(Model\Uncla ); $e->setResponseObject($data); break; + } throw $e; } @@ -977,14 +1018,14 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(Model\Uncla * * Create Embedded Unclaimed Draft with Template * - * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedWithTemplateAsync(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) + public function unclaimedDraftCreateEmbeddedWithTemplateAsync($unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) { return $this->unclaimedDraftCreateEmbeddedWithTemplateAsyncWithHttpInfo($unclaimed_draft_create_embedded_with_template_request, $contentType) ->then( @@ -999,14 +1040,14 @@ function ($response) { * * Create Embedded Unclaimed Draft with Template * - * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedWithTemplateAsyncWithHttpInfo(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) + public function unclaimedDraftCreateEmbeddedWithTemplateAsyncWithHttpInfo($unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; $request = $this->unclaimedDraftCreateEmbeddedWithTemplateRequest($unclaimed_draft_create_embedded_with_template_request, $contentType); @@ -1016,9 +1057,9 @@ public function unclaimedDraftCreateEmbeddedWithTemplateAsyncWithHttpInfo(Model\ ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1027,7 +1068,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -1041,7 +1082,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1050,22 +1091,24 @@ function ($exception) { /** * Create request for operation 'unclaimedDraftCreateEmbeddedWithTemplate' * - * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::unclaimedDraftCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedWithTemplateRequest(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) + public function unclaimedDraftCreateEmbeddedWithTemplateRequest($unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) { + // verify the required parameter 'unclaimed_draft_create_embedded_with_template_request' is set if ($unclaimed_draft_create_embedded_with_template_request === null || (is_array($unclaimed_draft_create_embedded_with_template_request) && count($unclaimed_draft_create_embedded_with_template_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $unclaimed_draft_create_embedded_with_template_request when calling unclaimedDraftCreateEmbeddedWithTemplate' ); } + $resourcePath = '/unclaimed_draft/create_embedded_with_template'; $formParams = []; $queryParams = []; @@ -1079,8 +1122,11 @@ public function unclaimedDraftCreateEmbeddedWithTemplateRequest(Model\UnclaimedD $multipart = !empty($formParams); + + + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1088,7 +1134,7 @@ public function unclaimedDraftCreateEmbeddedWithTemplateRequest(Model\UnclaimedD // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($unclaimed_draft_create_embedded_with_template_request)); } else { $httpBody = $unclaimed_draft_create_embedded_with_template_request; @@ -1101,7 +1147,7 @@ public function unclaimedDraftCreateEmbeddedWithTemplateRequest(Model\UnclaimedD foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1118,8 +1164,9 @@ public function unclaimedDraftCreateEmbeddedWithTemplateRequest(Model\UnclaimedD $payloadHook('multipart', $multipartContents, $unclaimed_draft_create_embedded_with_template_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1162,14 +1209,14 @@ public function unclaimedDraftCreateEmbeddedWithTemplateRequest(Model\UnclaimedD * * Edit and Resend Unclaimed Draft * - * @param string $signature_request_id The ID of the signature request to edit and resend. (required) - * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request unclaimed_draft_edit_and_resend_request (required) + * @param string $signature_request_id The ID of the signature request to edit and resend. (required) + * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request unclaimed_draft_edit_and_resend_request (required) * - * @return Model\UnclaimedDraftCreateResponse * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return Model\UnclaimedDraftCreateResponse */ - public function unclaimedDraftEditAndResend(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request) + public function unclaimedDraftEditAndResend($signature_request_id, $unclaimed_draft_edit_and_resend_request) { list($response) = $this->unclaimedDraftEditAndResendWithHttpInfo($signature_request_id, $unclaimed_draft_edit_and_resend_request); return $response; @@ -1180,16 +1227,16 @@ public function unclaimedDraftEditAndResend(string $signature_request_id, Model\ * * Edit and Resend Unclaimed Draft * - * @param string $signature_request_id The ID of the signature request to edit and resend. (required) - * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation + * @param string $signature_request_id The ID of the signature request to edit and resend. (required) + * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation * - * @return array of Model\UnclaimedDraftCreateResponse, HTTP status code, HTTP response headers (array of strings) * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return array of Model\UnclaimedDraftCreateResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated Prefer to use ::unclaimedDraftEditAndResend. This method will eventually become unavailable */ - public function unclaimedDraftEditAndResendWithHttpInfo(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) + public function unclaimedDraftEditAndResendWithHttpInfo($signature_request_id, $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) { $request = $this->unclaimedDraftEditAndResendRequest($signature_request_id, $unclaimed_draft_edit_and_resend_request, $contentType); @@ -1201,14 +1248,14 @@ public function unclaimedDraftEditAndResendWithHttpInfo(string $signature_reques } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string)$e->getResponse()->getBody() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int)$e->getCode(), + (int) $e->getCode(), null, null ); @@ -1216,18 +1263,6 @@ public function unclaimedDraftEditAndResendWithHttpInfo(string $signature_reques $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() - ); - } $result = $this->handleRangeCodeResponse( $response, @@ -1238,16 +1273,17 @@ public function unclaimedDraftEditAndResendWithHttpInfo(string $signature_reques return $result; } + switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1264,19 +1300,33 @@ public function unclaimedDraftEditAndResendWithHttpInfo(string $signature_reques return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + + } + + 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() + ); } $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $exception) { + } catch (\JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1293,9 +1343,11 @@ public function unclaimedDraftEditAndResendWithHttpInfo(string $signature_reques return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1308,6 +1360,7 @@ public function unclaimedDraftEditAndResendWithHttpInfo(string $signature_reques ); $e->setResponseObject($data); break; + } throw $e; } @@ -1318,15 +1371,15 @@ public function unclaimedDraftEditAndResendWithHttpInfo(string $signature_reques * * Edit and Resend Unclaimed Draft * - * @param string $signature_request_id The ID of the signature request to edit and resend. (required) - * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation + * @param string $signature_request_id The ID of the signature request to edit and resend. (required) + * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftEditAndResend. This method will eventually become unavailable */ - public function unclaimedDraftEditAndResendAsync(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) + public function unclaimedDraftEditAndResendAsync($signature_request_id, $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) { return $this->unclaimedDraftEditAndResendAsyncWithHttpInfo($signature_request_id, $unclaimed_draft_edit_and_resend_request, $contentType) ->then( @@ -1341,15 +1394,15 @@ function ($response) { * * Edit and Resend Unclaimed Draft * - * @param string $signature_request_id The ID of the signature request to edit and resend. (required) - * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation + * @param string $signature_request_id The ID of the signature request to edit and resend. (required) + * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftEditAndResend. This method will eventually become unavailable */ - public function unclaimedDraftEditAndResendAsyncWithHttpInfo(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) + public function unclaimedDraftEditAndResendAsyncWithHttpInfo($signature_request_id, $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) { $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; $request = $this->unclaimedDraftEditAndResendRequest($signature_request_id, $unclaimed_draft_edit_and_resend_request, $contentType); @@ -1359,9 +1412,9 @@ public function unclaimedDraftEditAndResendAsyncWithHttpInfo(string $signature_r ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1370,7 +1423,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders(), + $response->getHeaders() ]; }, function ($exception) { @@ -1384,7 +1437,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string)$response->getBody() + (string) $response->getBody() ); } ); @@ -1393,30 +1446,32 @@ function ($exception) { /** * Create request for operation 'unclaimedDraftEditAndResend' * - * @param string $signature_request_id The ID of the signature request to edit and resend. (required) - * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation + * @param string $signature_request_id The ID of the signature request to edit and resend. (required) + * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation * - * @return Request - * @throws InvalidArgumentException + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request * @deprecated Prefer to use ::unclaimedDraftEditAndResend. This method will eventually become unavailable */ - public function unclaimedDraftEditAndResendRequest(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) + public function unclaimedDraftEditAndResendRequest($signature_request_id, $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) { + // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling unclaimedDraftEditAndResend' ); } // verify the required parameter 'unclaimed_draft_edit_and_resend_request' is set if ($unclaimed_draft_edit_and_resend_request === null || (is_array($unclaimed_draft_edit_and_resend_request) && count($unclaimed_draft_edit_and_resend_request) === 0)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Missing the required parameter $unclaimed_draft_edit_and_resend_request when calling unclaimedDraftEditAndResend' ); } + $resourcePath = '/unclaimed_draft/edit_and_resend/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -1430,17 +1485,19 @@ public function unclaimedDraftEditAndResendRequest(string $signature_request_id, $multipart = !empty($formParams); + // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{signature_request_id}', + '{' . 'signature_request_id' . '}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } + $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/json', ], $contentType, $multipart ); @@ -1448,7 +1505,7 @@ public function unclaimedDraftEditAndResendRequest(string $signature_request_id, // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the body + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($unclaimed_draft_edit_and_resend_request)); } else { $httpBody = $unclaimed_draft_edit_and_resend_request; @@ -1461,7 +1518,7 @@ public function unclaimedDraftEditAndResendRequest(string $signature_request_id, foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem, + 'contents' => $formParamValueItem ]; } } @@ -1478,8 +1535,9 @@ public function unclaimedDraftEditAndResendRequest(string $signature_request_id, $payloadHook('multipart', $multipartContents, $unclaimed_draft_edit_and_resend_request); } $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - // if Content-Type contains "application/json", json_encode the form parameters + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1520,8 +1578,8 @@ public function unclaimedDraftEditAndResendRequest(string $signature_request_id, /** * Create http client option * + * @throws \RuntimeException on file opening failure * @return array of http client options - * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -1529,7 +1587,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -1545,8 +1603,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -1556,9 +1614,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); // stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); } return [ @@ -1577,8 +1635,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/ApiException.php b/sdks/php/src/ApiException.php index 3d4a49ca7..a71729e27 100644 --- a/sdks/php/src/ApiException.php +++ b/sdks/php/src/ApiException.php @@ -1,10 +1,13 @@ responseHeaders = $responseHeaders; @@ -86,7 +90,7 @@ public function getResponseHeaders() /** * Gets the HTTP body of the server response either as Json or string * - * @return stdClass|string|null HTTP body of the server response either as \stdClass or string + * @return \stdClass|string|null HTTP body of the server response either as \stdClass or string */ public function getResponseBody() { @@ -97,6 +101,8 @@ public function getResponseBody() * Sets the deserialized response object (during deserialization) * * @param string|int|object|array|mixed $obj Deserialized response object + * + * @return void */ public function setResponseObject($obj) { diff --git a/sdks/php/src/Configuration.php b/sdks/php/src/Configuration.php index 204b66994..ae0b48497 100644 --- a/sdks/php/src/Configuration.php +++ b/sdks/php/src/Configuration.php @@ -1,10 +1,13 @@ apiKeys[$apiKeyIdentifier] = $key; return $this; @@ -157,9 +162,9 @@ protected function setApiKey(string $apiKeyIdentifier, string $key) * * @param string $apiKeyIdentifier API key identifier (authentication scheme) * - * @return string|null API key or token + * @return null|string API key or token */ - protected function getApiKey(string $apiKeyIdentifier) + protected function getApiKey($apiKeyIdentifier) { return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; } @@ -172,7 +177,7 @@ protected function getApiKey(string $apiKeyIdentifier) * * @return $this */ - protected function setApiKeyPrefix(string $apiKeyIdentifier, string $prefix) + protected function setApiKeyPrefix($apiKeyIdentifier, $prefix) { $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; return $this; @@ -183,9 +188,9 @@ protected function setApiKeyPrefix(string $apiKeyIdentifier, string $prefix) * * @param string $apiKeyIdentifier API key identifier (authentication scheme) * - * @return string|null + * @return null|string */ - protected function getApiKeyPrefix(string $apiKeyIdentifier) + protected function getApiKeyPrefix($apiKeyIdentifier) { return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; } @@ -197,7 +202,7 @@ protected function getApiKeyPrefix(string $apiKeyIdentifier) * * @return $this */ - public function setAccessToken(string $accessToken) + public function setAccessToken($accessToken) { $this->accessToken = $accessToken; return $this; @@ -244,7 +249,7 @@ public function getBooleanFormatForQueryString(): string * * @return $this */ - public function setUsername(string $username) + public function setUsername($username) { $this->username = $username; return $this; @@ -267,7 +272,7 @@ public function getUsername() * * @return $this */ - protected function setPassword(string $password) + protected function setPassword($password) { $this->password = $password; return $this; @@ -290,7 +295,7 @@ protected function getPassword() * * @return $this */ - public function setHost(string $host) + public function setHost($host) { $this->host = $host; return $this; @@ -311,13 +316,13 @@ public function getHost() * * @param string $userAgent the user agent of the api client * + * @throws \InvalidArgumentException * @return $this - * @throws InvalidArgumentException */ - public function setUserAgent(string $userAgent) + public function setUserAgent($userAgent) { if (!is_string($userAgent)) { - throw new InvalidArgumentException('User-agent must be a string.'); + throw new \InvalidArgumentException('User-agent must be a string.'); } $this->userAgent = $userAgent; @@ -341,7 +346,7 @@ public function getUserAgent() * * @return $this */ - public function setDebug(bool $debug) + public function setDebug($debug) { $this->debug = $debug; return $this; @@ -364,7 +369,7 @@ public function getDebug() * * @return $this */ - public function setDebugFile(string $debugFile) + public function setDebugFile($debugFile) { $this->debugFile = $debugFile; return $this; @@ -387,7 +392,7 @@ public function getDebugFile() * * @return $this */ - public function setTempFolderPath(string $tempFolderPath) + public function setTempFolderPath($tempFolderPath) { $this->tempFolderPath = $tempFolderPath; return $this; @@ -421,6 +426,8 @@ public static function getDefaultConfiguration() * Sets the default configuration instance * * @param Configuration $config An instance of the Configuration Object + * + * @return void */ public static function setDefaultConfiguration(Configuration $config) { @@ -434,11 +441,11 @@ public static function setDefaultConfiguration(Configuration $config) */ public static function toDebugReport() { - $report = 'PHP SDK (Dropbox\Sign) Debug Report:' . PHP_EOL; + $report = 'PHP SDK (Dropbox\Sign) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' The version of the OpenAPI document: 3.0.0' . PHP_EOL; - $report .= ' SDK Package Version: 1.8-dev' . PHP_EOL; + $report .= ' SDK Package Version: 1.8.1-dev' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; @@ -447,11 +454,11 @@ public static function toDebugReport() /** * Get API key (with prefix if set) * - * @param string $apiKeyIdentifier name of apikey + * @param string $apiKeyIdentifier name of apikey * - * @return string|null API key with the prefix + * @return null|string API key with the prefix */ - protected function getApiKeyWithPrefix(string $apiKeyIdentifier) + protected function getApiKeyWithPrefix($apiKeyIdentifier) { $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); $apiKey = $this->getApiKey($apiKeyIdentifier); @@ -478,21 +485,21 @@ public function getHostSettings() { return [ [ - 'url' => 'https://api.hellosign.com/v3', - 'description' => 'No description provided', - ], + "url" => "https://api.hellosign.com/v3", + "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 $hostSettings, int $hostIndex, array $variables = null) + * 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 $hostSettings, $hostIndex, ?array $variables = null) { if (null === $variables) { $variables = []; @@ -500,23 +507,23 @@ public static function getHostString(array $hostSettings, int $hostIndex, array // check array index out of bound if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { - throw new InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than " . count($hostSettings)); + throw new \InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostSettings)); } $host = $hostSettings[$hostIndex]; - $url = $host['url']; + $url = $host["url"]; // go through variable and assign a value - foreach ($host['variables'] ?? [] as $name => $variable) { + 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); + 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']) . '.'); + 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); + $url = str_replace("{".$name."}", $variable["default_value"], $url); } } @@ -526,11 +533,11 @@ public static function getHostString(array $hostSettings, int $hostIndex, array /** * 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 + * @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(int $index, ?array $variables = null) + public function getHostFromSettings($index, $variables = null) { return self::getHostString($this->getHostSettings(), $index, $variables); } @@ -544,6 +551,8 @@ public function setOptions(array $options): self /** * Get extra request options + * + * @return array */ public function getOptions(): array { diff --git a/sdks/php/src/EventCallbackHelper.php b/sdks/php/src/EventCallbackHelper.php index 16e76ec8b..8d8c4a20b 100644 --- a/sdks/php/src/EventCallbackHelper.php +++ b/sdks/php/src/EventCallbackHelper.php @@ -1,11 +1,14 @@ selectJsonMimeList($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 + # 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") - */ + * Detects whether a string contains a valid JSON mime type + * + * @param string $searchString + * @return bool + */ + public function isJsonMime(string $searchString): bool + { + return preg_match('~^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)~', $searchString) === 1; + } + + /** + * Select all items from a list containing a JSON mime type + * + * @param array $mimeList + * @return array + */ + private function selectJsonMimeList(array $mimeList): array + { + $jsonMimeList = []; + foreach ($mimeList as $mime) { + if ($this->isJsonMime($mime)) { + $jsonMimeList[] = $mime; + } + } + return $jsonMimeList; + } + + + /** + * 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 = [ @@ -107,6 +143,7 @@ private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headers ]; foreach ($accept as $header) { + $headerData = $this->getHeaderAndWeight($header); if (stripos($headerData['header'], 'application/json') === 0) { @@ -143,7 +180,7 @@ private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headers */ private function getHeaderAndWeight(string $header): array { - // matches headers with weight, splitting the header and the weight in $outputArray + # 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], @@ -160,7 +197,9 @@ private function getHeaderAndWeight(string $header): array } /** - * @param array[] $headers + * @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 @@ -185,6 +224,11 @@ private function adjustWeight(array $headers, float &$currentWeight, bool $hasMo return $acceptHeaders; } + /** + * @param string $header + * @param int $weight + * @return string + */ private function buildAcceptHeader(string $header, int $weight): string { if ($weight === 1000) { @@ -212,7 +256,9 @@ private function buildAcceptHeader(string $header, int $weight): string * 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 int $currentWeight varying from 1 to 1000 (will be divided by 1000 to build the quality value) + * @param bool $hasMoreThan28Headers + * @return int */ public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): int { diff --git a/sdks/php/src/Model/AccountCreateRequest.php b/sdks/php/src/Model/AccountCreateRequest.php index f4b927310..2fc6df0bf 100644 --- a/sdks/php/src/Model/AccountCreateRequest.php +++ b/sdks/php/src/Model/AccountCreateRequest.php @@ -1,11 +1,14 @@ */ -class AccountCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class AccountCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountCreateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'email_address' => 'string', 'client_id' => 'string', 'client_secret' => 'string', - 'locale' => 'string', + 'locale' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'email_address' => 'email', 'client_id' => null, 'client_secret' => null, - 'locale' => null, + 'locale' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'email_address' => false, 'client_id' => false, 'client_secret' => false, - 'locale' => false, + 'locale' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -118,6 +120,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -127,7 +131,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -137,7 +141,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -146,6 +150,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -154,6 +161,9 @@ 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 { @@ -170,7 +180,7 @@ public function isNullableSetToNull(string $property): bool 'email_address' => 'email_address', 'client_id' => 'client_id', 'client_secret' => 'client_secret', - 'locale' => 'locale', + 'locale' => 'locale' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'email_address' => 'setEmailAddress', 'client_id' => 'setClientId', 'client_secret' => 'setClientSecret', - 'locale' => 'setLocale', + 'locale' => 'setLocale' ]; /** @@ -194,7 +204,7 @@ public function isNullableSetToNull(string $property): bool 'email_address' => 'getEmailAddress', 'client_id' => 'getClientId', 'client_secret' => 'getClientSecret', - 'locale' => 'getLocale', + 'locale' => 'getLocale' ]; /** @@ -238,6 +248,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -248,10 +259,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('email_address', $data ?? [], null); $this->setIfExists('client_id', $data ?? [], null); @@ -259,33 +270,34 @@ public function __construct(array $data = null) $this->setIfExists('locale', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): AccountCreateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): AccountCreateRequest { /** @var AccountCreateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, AccountCreateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -321,6 +333,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets email_address * @@ -334,14 +347,14 @@ public function getEmailAddress() /** * Sets email_address * - * @param string $email_address the email address which will be associated with the new Account + * @param string $email_address The email address which will be associated with the new Account. * * @return self */ - public function setEmailAddress(string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -365,10 +378,10 @@ public function getClientId() * * @return self */ - public function setClientId(?string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -392,10 +405,10 @@ public function getClientSecret() * * @return self */ - public function setClientSecret(?string $client_secret) + public function setClientSecret($client_secret) { if (is_null($client_secret)) { - throw new InvalidArgumentException('non-nullable client_secret cannot be null'); + throw new \InvalidArgumentException('non-nullable client_secret cannot be null'); } $this->container['client_secret'] = $client_secret; @@ -419,22 +432,23 @@ public function getLocale() * * @return self */ - public function setLocale(?string $locale) + public function setLocale($locale) { if (is_null($locale)) { - throw new InvalidArgumentException('non-nullable locale cannot be null'); + throw new \InvalidArgumentException('non-nullable locale cannot be null'); } $this->container['locale'] = $locale; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -443,11 +457,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -458,8 +472,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -472,9 +488,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -482,12 +500,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -516,3 +534,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/AccountCreateResponse.php b/sdks/php/src/Model/AccountCreateResponse.php index 66e9a34d4..fc6f5752a 100644 --- a/sdks/php/src/Model/AccountCreateResponse.php +++ b/sdks/php/src/Model/AccountCreateResponse.php @@ -1,11 +1,14 @@ */ -class AccountCreateResponse implements ModelInterface, ArrayAccess, JsonSerializable +class AccountCreateResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountCreateResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account' => '\Dropbox\Sign\Model\AccountResponse', 'oauth_data' => '\Dropbox\Sign\Model\OAuthTokenResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account' => null, 'oauth_data' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'account' => false, 'oauth_data' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'account' => 'account', 'oauth_data' => 'oauth_data', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'account' => 'setAccount', 'oauth_data' => 'setOauthData', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'account' => 'getAccount', 'oauth_data' => 'getOauthData', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -232,6 +242,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -242,43 +253,44 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('account', $data ?? [], null); $this->setIfExists('oauth_data', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): AccountCreateResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): AccountCreateResponse { /** @var AccountCreateResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, AccountCreateResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -314,6 +326,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets account * @@ -331,10 +344,10 @@ public function getAccount() * * @return self */ - public function setAccount(AccountResponse $account) + public function setAccount($account) { if (is_null($account)) { - throw new InvalidArgumentException('non-nullable account cannot be null'); + throw new \InvalidArgumentException('non-nullable account cannot be null'); } $this->container['account'] = $account; @@ -358,10 +371,10 @@ public function getOauthData() * * @return self */ - public function setOauthData(?OAuthTokenResponse $oauth_data) + public function setOauthData($oauth_data) { if (is_null($oauth_data)) { - throw new InvalidArgumentException('non-nullable oauth_data cannot be null'); + throw new \InvalidArgumentException('non-nullable oauth_data cannot be null'); } $this->container['oauth_data'] = $oauth_data; @@ -381,26 +394,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -409,11 +423,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -424,8 +438,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -438,9 +454,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -448,12 +466,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -482,3 +500,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/AccountGetResponse.php b/sdks/php/src/Model/AccountGetResponse.php index b59da1285..2b93cfbfe 100644 --- a/sdks/php/src/Model/AccountGetResponse.php +++ b/sdks/php/src/Model/AccountGetResponse.php @@ -1,11 +1,14 @@ */ -class AccountGetResponse implements ModelInterface, ArrayAccess, JsonSerializable +class AccountGetResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountGetResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account' => '\Dropbox\Sign\Model\AccountResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'account' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'account' => 'account', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'account' => 'setAccount', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'account' => 'getAccount', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('account', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): AccountGetResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): AccountGetResponse { /** @var AccountGetResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, AccountGetResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,6 +319,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets account * @@ -324,10 +337,10 @@ public function getAccount() * * @return self */ - public function setAccount(AccountResponse $account) + public function setAccount($account) { if (is_null($account)) { - throw new InvalidArgumentException('non-nullable account cannot be null'); + throw new \InvalidArgumentException('non-nullable account cannot be null'); } $this->container['account'] = $account; @@ -347,26 +360,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -375,11 +389,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,8 +404,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -404,9 +420,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -414,12 +432,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -448,3 +466,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/AccountResponse.php b/sdks/php/src/Model/AccountResponse.php index 3fb1a1869..e92d69cb7 100644 --- a/sdks/php/src/Model/AccountResponse.php +++ b/sdks/php/src/Model/AccountResponse.php @@ -1,11 +1,14 @@ */ -class AccountResponse implements ModelInterface, ArrayAccess, JsonSerializable +class AccountResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account_id' => 'string', 'email_address' => 'string', @@ -67,16 +69,16 @@ class AccountResponse implements ModelInterface, ArrayAccess, JsonSerializable 'role_code' => 'string', 'team_id' => 'string', 'locale' => 'string', - 'usage' => '\Dropbox\Sign\Model\AccountResponseUsage', + 'usage' => '\Dropbox\Sign\Model\AccountResponseUsage' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account_id' => null, 'email_address' => null, @@ -88,14 +90,14 @@ class AccountResponse implements ModelInterface, ArrayAccess, JsonSerializable 'role_code' => null, 'team_id' => null, 'locale' => null, - 'usage' => null, + 'usage' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'account_id' => false, 'email_address' => false, @@ -107,14 +109,14 @@ class AccountResponse implements ModelInterface, ArrayAccess, JsonSerializable 'role_code' => true, 'team_id' => true, 'locale' => true, - 'usage' => false, + 'usage' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -139,6 +141,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -148,7 +152,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -158,7 +162,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -167,6 +171,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -175,6 +182,9 @@ 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 { @@ -198,7 +208,7 @@ public function isNullableSetToNull(string $property): bool 'role_code' => 'role_code', 'team_id' => 'team_id', 'locale' => 'locale', - 'usage' => 'usage', + 'usage' => 'usage' ]; /** @@ -217,7 +227,7 @@ public function isNullableSetToNull(string $property): bool 'role_code' => 'setRoleCode', 'team_id' => 'setTeamId', 'locale' => 'setLocale', - 'usage' => 'setUsage', + 'usage' => 'setUsage' ]; /** @@ -236,7 +246,7 @@ public function isNullableSetToNull(string $property): bool 'role_code' => 'getRoleCode', 'team_id' => 'getTeamId', 'locale' => 'getLocale', - 'usage' => 'getUsage', + 'usage' => 'getUsage' ]; /** @@ -280,6 +290,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -290,10 +301,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('account_id', $data ?? [], null); $this->setIfExists('email_address', $data ?? [], null); @@ -308,33 +319,34 @@ public function __construct(array $data = null) $this->setIfExists('usage', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): AccountResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): AccountResponse { /** @var AccountResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, AccountResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -351,7 +363,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -365,6 +379,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets account_id * @@ -382,10 +397,10 @@ public function getAccountId() * * @return self */ - public function setAccountId(?string $account_id) + public function setAccountId($account_id) { if (is_null($account_id)) { - throw new InvalidArgumentException('non-nullable account_id cannot be null'); + throw new \InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -405,14 +420,14 @@ public function getEmailAddress() /** * Sets email_address * - * @param string|null $email_address the email address associated with the Account + * @param string|null $email_address The email address associated with the Account. * * @return self */ - public function setEmailAddress(?string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -432,14 +447,14 @@ public function getIsLocked() /** * Sets is_locked * - * @param bool|null $is_locked returns `true` if the user has been locked out of their account by a team admin + * @param bool|null $is_locked Returns `true` if the user has been locked out of their account by a team admin. * * @return self */ - public function setIsLocked(?bool $is_locked) + public function setIsLocked($is_locked) { if (is_null($is_locked)) { - throw new InvalidArgumentException('non-nullable is_locked cannot be null'); + throw new \InvalidArgumentException('non-nullable is_locked cannot be null'); } $this->container['is_locked'] = $is_locked; @@ -459,14 +474,14 @@ public function getIsPaidHs() /** * Sets is_paid_hs * - * @param bool|null $is_paid_hs returns `true` if the user has a paid Dropbox Sign account + * @param bool|null $is_paid_hs Returns `true` if the user has a paid Dropbox Sign account. * * @return self */ - public function setIsPaidHs(?bool $is_paid_hs) + public function setIsPaidHs($is_paid_hs) { if (is_null($is_paid_hs)) { - throw new InvalidArgumentException('non-nullable is_paid_hs cannot be null'); + throw new \InvalidArgumentException('non-nullable is_paid_hs cannot be null'); } $this->container['is_paid_hs'] = $is_paid_hs; @@ -486,14 +501,14 @@ public function getIsPaidHf() /** * Sets is_paid_hf * - * @param bool|null $is_paid_hf returns `true` if the user has a paid HelloFax account + * @param bool|null $is_paid_hf Returns `true` if the user has a paid HelloFax account. * * @return self */ - public function setIsPaidHf(?bool $is_paid_hf) + public function setIsPaidHf($is_paid_hf) { if (is_null($is_paid_hf)) { - throw new InvalidArgumentException('non-nullable is_paid_hf cannot be null'); + throw new \InvalidArgumentException('non-nullable is_paid_hf cannot be null'); } $this->container['is_paid_hf'] = $is_paid_hf; @@ -517,10 +532,10 @@ public function getQuotas() * * @return self */ - public function setQuotas(?AccountResponseQuotas $quotas) + public function setQuotas($quotas) { if (is_null($quotas)) { - throw new InvalidArgumentException('non-nullable quotas cannot be null'); + throw new \InvalidArgumentException('non-nullable quotas cannot be null'); } $this->container['quotas'] = $quotas; @@ -540,17 +555,17 @@ public function getCallbackUrl() /** * Sets callback_url * - * @param string|null $callback_url the URL that Dropbox Sign events will `POST` to + * @param string|null $callback_url The URL that Dropbox Sign events will `POST` to. * * @return self */ - public function setCallbackUrl(?string $callback_url) + public function setCallbackUrl($callback_url) { if (is_null($callback_url)) { array_push($this->openAPINullablesSetToNull, 'callback_url'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('callback_url', $nullablesSetToNull); + $index = array_search('callback_url', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -574,17 +589,17 @@ public function getRoleCode() /** * Sets role_code * - * @param string|null $role_code the membership role for the team + * @param string|null $role_code The membership role for the team. * * @return self */ - public function setRoleCode(?string $role_code) + public function setRoleCode($role_code) { if (is_null($role_code)) { array_push($this->openAPINullablesSetToNull, 'role_code'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('role_code', $nullablesSetToNull); + $index = array_search('role_code', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -608,17 +623,17 @@ public function getTeamId() /** * Sets team_id * - * @param string|null $team_id the id of the team account belongs to + * @param string|null $team_id The id of the team account belongs to. * * @return self */ - public function setTeamId(?string $team_id) + public function setTeamId($team_id) { if (is_null($team_id)) { array_push($this->openAPINullablesSetToNull, 'team_id'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('team_id', $nullablesSetToNull); + $index = array_search('team_id', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -646,13 +661,13 @@ public function getLocale() * * @return self */ - public function setLocale(?string $locale) + public function setLocale($locale) { if (is_null($locale)) { array_push($this->openAPINullablesSetToNull, 'locale'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('locale', $nullablesSetToNull); + $index = array_search('locale', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -680,22 +695,23 @@ public function getUsage() * * @return self */ - public function setUsage(?AccountResponseUsage $usage) + public function setUsage($usage) { if (is_null($usage)) { - throw new InvalidArgumentException('non-nullable usage cannot be null'); + throw new \InvalidArgumentException('non-nullable usage cannot be null'); } $this->container['usage'] = $usage; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -704,11 +720,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -719,8 +735,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -733,9 +751,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -743,12 +763,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -777,3 +797,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/AccountResponseQuotas.php b/sdks/php/src/Model/AccountResponseQuotas.php index 85d004055..1c752db2f 100644 --- a/sdks/php/src/Model/AccountResponseQuotas.php +++ b/sdks/php/src/Model/AccountResponseQuotas.php @@ -1,11 +1,14 @@ */ -class AccountResponseQuotas implements ModelInterface, ArrayAccess, JsonSerializable +class AccountResponseQuotas implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountResponseQuotas'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'api_signature_requests_left' => 'int', 'documents_left' => 'int', 'templates_total' => 'int', 'templates_left' => 'int', 'sms_verifications_left' => 'int', - 'num_fax_pages_left' => 'int', + 'num_fax_pages_left' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'api_signature_requests_left' => null, 'documents_left' => null, 'templates_total' => null, 'templates_left' => null, 'sms_verifications_left' => null, - 'num_fax_pages_left' => null, + 'num_fax_pages_left' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'api_signature_requests_left' => true, 'documents_left' => true, 'templates_total' => true, 'templates_left' => true, 'sms_verifications_left' => true, - 'num_fax_pages_left' => true, + 'num_fax_pages_left' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -124,6 +127,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -133,7 +138,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -143,7 +148,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -152,6 +157,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -160,6 +168,9 @@ 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 { @@ -178,7 +189,7 @@ public function isNullableSetToNull(string $property): bool 'templates_total' => 'templates_total', 'templates_left' => 'templates_left', 'sms_verifications_left' => 'sms_verifications_left', - 'num_fax_pages_left' => 'num_fax_pages_left', + 'num_fax_pages_left' => 'num_fax_pages_left' ]; /** @@ -192,7 +203,7 @@ public function isNullableSetToNull(string $property): bool 'templates_total' => 'setTemplatesTotal', 'templates_left' => 'setTemplatesLeft', 'sms_verifications_left' => 'setSmsVerificationsLeft', - 'num_fax_pages_left' => 'setNumFaxPagesLeft', + 'num_fax_pages_left' => 'setNumFaxPagesLeft' ]; /** @@ -206,7 +217,7 @@ public function isNullableSetToNull(string $property): bool 'templates_total' => 'getTemplatesTotal', 'templates_left' => 'getTemplatesLeft', 'sms_verifications_left' => 'getSmsVerificationsLeft', - 'num_fax_pages_left' => 'getNumFaxPagesLeft', + 'num_fax_pages_left' => 'getNumFaxPagesLeft' ]; /** @@ -250,6 +261,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -260,10 +272,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('api_signature_requests_left', $data ?? [], null); $this->setIfExists('documents_left', $data ?? [], null); @@ -273,33 +285,34 @@ public function __construct(array $data = null) $this->setIfExists('num_fax_pages_left', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): AccountResponseQuotas { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): AccountResponseQuotas { /** @var AccountResponseQuotas */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, AccountResponseQuotas::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -316,7 +329,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -330,6 +345,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets api_signature_requests_left * @@ -343,17 +359,17 @@ public function getApiSignatureRequestsLeft() /** * Sets api_signature_requests_left * - * @param int|null $api_signature_requests_left API signature requests remaining + * @param int|null $api_signature_requests_left API signature requests remaining. * * @return self */ - public function setApiSignatureRequestsLeft(?int $api_signature_requests_left) + public function setApiSignatureRequestsLeft($api_signature_requests_left) { if (is_null($api_signature_requests_left)) { array_push($this->openAPINullablesSetToNull, 'api_signature_requests_left'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('api_signature_requests_left', $nullablesSetToNull); + $index = array_search('api_signature_requests_left', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -377,17 +393,17 @@ public function getDocumentsLeft() /** * Sets documents_left * - * @param int|null $documents_left signature requests remaining + * @param int|null $documents_left Signature requests remaining. * * @return self */ - public function setDocumentsLeft(?int $documents_left) + public function setDocumentsLeft($documents_left) { if (is_null($documents_left)) { array_push($this->openAPINullablesSetToNull, 'documents_left'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('documents_left', $nullablesSetToNull); + $index = array_search('documents_left', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -411,17 +427,17 @@ public function getTemplatesTotal() /** * Sets templates_total * - * @param int|null $templates_total total API templates allowed + * @param int|null $templates_total Total API templates allowed. * * @return self */ - public function setTemplatesTotal(?int $templates_total) + public function setTemplatesTotal($templates_total) { if (is_null($templates_total)) { array_push($this->openAPINullablesSetToNull, 'templates_total'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('templates_total', $nullablesSetToNull); + $index = array_search('templates_total', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -445,17 +461,17 @@ public function getTemplatesLeft() /** * Sets templates_left * - * @param int|null $templates_left API templates remaining + * @param int|null $templates_left API templates remaining. * * @return self */ - public function setTemplatesLeft(?int $templates_left) + public function setTemplatesLeft($templates_left) { if (is_null($templates_left)) { array_push($this->openAPINullablesSetToNull, 'templates_left'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('templates_left', $nullablesSetToNull); + $index = array_search('templates_left', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -479,17 +495,17 @@ public function getSmsVerificationsLeft() /** * Sets sms_verifications_left * - * @param int|null $sms_verifications_left SMS verifications remaining + * @param int|null $sms_verifications_left SMS verifications remaining. * * @return self */ - public function setSmsVerificationsLeft(?int $sms_verifications_left) + public function setSmsVerificationsLeft($sms_verifications_left) { if (is_null($sms_verifications_left)) { array_push($this->openAPINullablesSetToNull, 'sms_verifications_left'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('sms_verifications_left', $nullablesSetToNull); + $index = array_search('sms_verifications_left', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -517,13 +533,13 @@ public function getNumFaxPagesLeft() * * @return self */ - public function setNumFaxPagesLeft(?int $num_fax_pages_left) + public function setNumFaxPagesLeft($num_fax_pages_left) { if (is_null($num_fax_pages_left)) { array_push($this->openAPINullablesSetToNull, 'num_fax_pages_left'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('num_fax_pages_left', $nullablesSetToNull); + $index = array_search('num_fax_pages_left', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -533,13 +549,14 @@ public function setNumFaxPagesLeft(?int $num_fax_pages_left) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -548,11 +565,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -563,8 +580,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -577,9 +596,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -587,12 +608,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -621,3 +642,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/AccountResponseUsage.php b/sdks/php/src/Model/AccountResponseUsage.php index 94eb509e7..896b69a0f 100644 --- a/sdks/php/src/Model/AccountResponseUsage.php +++ b/sdks/php/src/Model/AccountResponseUsage.php @@ -1,11 +1,14 @@ */ -class AccountResponseUsage implements ModelInterface, ArrayAccess, JsonSerializable +class AccountResponseUsage implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountResponseUsage'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'fax_pages_sent' => 'int', + 'fax_pages_sent' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'fax_pages_sent' => null, + 'fax_pages_sent' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'fax_pages_sent' => true, + 'fax_pages_sent' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -109,6 +112,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -118,7 +123,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -128,7 +133,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -137,6 +142,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -145,6 +153,9 @@ 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 { @@ -158,7 +169,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'fax_pages_sent' => 'fax_pages_sent', + 'fax_pages_sent' => 'fax_pages_sent' ]; /** @@ -167,7 +178,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'fax_pages_sent' => 'setFaxPagesSent', + 'fax_pages_sent' => 'setFaxPagesSent' ]; /** @@ -176,7 +187,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'fax_pages_sent' => 'getFaxPagesSent', + 'fax_pages_sent' => 'getFaxPagesSent' ]; /** @@ -220,6 +231,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -230,41 +242,42 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('fax_pages_sent', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): AccountResponseUsage { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): AccountResponseUsage { /** @var AccountResponseUsage */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, AccountResponseUsage::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -281,7 +294,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -295,6 +310,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets fax_pages_sent * @@ -312,13 +328,13 @@ public function getFaxPagesSent() * * @return self */ - public function setFaxPagesSent(?int $fax_pages_sent) + public function setFaxPagesSent($fax_pages_sent) { if (is_null($fax_pages_sent)) { array_push($this->openAPINullablesSetToNull, 'fax_pages_sent'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('fax_pages_sent', $nullablesSetToNull); + $index = array_search('fax_pages_sent', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -328,13 +344,14 @@ public function setFaxPagesSent(?int $fax_pages_sent) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -343,11 +360,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -358,8 +375,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -372,9 +391,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -382,12 +403,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -416,3 +437,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/AccountUpdateRequest.php b/sdks/php/src/Model/AccountUpdateRequest.php index 34a65c498..dbc433b2e 100644 --- a/sdks/php/src/Model/AccountUpdateRequest.php +++ b/sdks/php/src/Model/AccountUpdateRequest.php @@ -1,11 +1,14 @@ */ -class AccountUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class AccountUpdateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountUpdateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account_id' => 'string', 'callback_url' => 'string', - 'locale' => 'string', + 'locale' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account_id' => null, 'callback_url' => null, - 'locale' => null, + 'locale' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'account_id' => true, 'callback_url' => false, - 'locale' => false, + 'locale' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'account_id' => 'account_id', 'callback_url' => 'callback_url', - 'locale' => 'locale', + 'locale' => 'locale' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'account_id' => 'setAccountId', 'callback_url' => 'setCallbackUrl', - 'locale' => 'setLocale', + 'locale' => 'setLocale' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'account_id' => 'getAccountId', 'callback_url' => 'getCallbackUrl', - 'locale' => 'getLocale', + 'locale' => 'getLocale' ]; /** @@ -232,6 +242,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -242,43 +253,44 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('account_id', $data ?? [], null); $this->setIfExists('callback_url', $data ?? [], null); $this->setIfExists('locale', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): AccountUpdateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): AccountUpdateRequest { /** @var AccountUpdateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, AccountUpdateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -295,7 +307,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -309,6 +323,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets account_id * @@ -326,13 +341,13 @@ public function getAccountId() * * @return self */ - public function setAccountId(?string $account_id) + public function setAccountId($account_id) { if (is_null($account_id)) { array_push($this->openAPINullablesSetToNull, 'account_id'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('account_id', $nullablesSetToNull); + $index = array_search('account_id', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -356,14 +371,14 @@ public function getCallbackUrl() /** * Sets callback_url * - * @param string|null $callback_url the URL that Dropbox Sign should POST events to + * @param string|null $callback_url The URL that Dropbox Sign should POST events to. * * @return self */ - public function setCallbackUrl(?string $callback_url) + public function setCallbackUrl($callback_url) { if (is_null($callback_url)) { - throw new InvalidArgumentException('non-nullable callback_url cannot be null'); + throw new \InvalidArgumentException('non-nullable callback_url cannot be null'); } $this->container['callback_url'] = $callback_url; @@ -387,22 +402,23 @@ public function getLocale() * * @return self */ - public function setLocale(?string $locale) + public function setLocale($locale) { if (is_null($locale)) { - throw new InvalidArgumentException('non-nullable locale cannot be null'); + throw new \InvalidArgumentException('non-nullable locale cannot be null'); } $this->container['locale'] = $locale; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -411,11 +427,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -426,8 +442,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -440,9 +458,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -450,12 +470,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -484,3 +504,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/AccountVerifyRequest.php b/sdks/php/src/Model/AccountVerifyRequest.php index d8731ea40..5451b6068 100644 --- a/sdks/php/src/Model/AccountVerifyRequest.php +++ b/sdks/php/src/Model/AccountVerifyRequest.php @@ -1,11 +1,14 @@ */ -class AccountVerifyRequest implements ModelInterface, ArrayAccess, JsonSerializable +class AccountVerifyRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountVerifyRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'email_address' => 'string', + 'email_address' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'email_address' => 'email', + 'email_address' => 'email' ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'email_address' => false, + 'email_address' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -109,6 +111,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -118,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -128,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -137,6 +141,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -145,6 +152,9 @@ 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 { @@ -158,7 +168,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'email_address' => 'email_address', + 'email_address' => 'email_address' ]; /** @@ -167,7 +177,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'email_address' => 'setEmailAddress', + 'email_address' => 'setEmailAddress' ]; /** @@ -176,7 +186,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'email_address' => 'getEmailAddress', + 'email_address' => 'getEmailAddress' ]; /** @@ -220,6 +230,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -230,41 +241,42 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('email_address', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): AccountVerifyRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): AccountVerifyRequest { /** @var AccountVerifyRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, AccountVerifyRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -300,6 +312,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets email_address * @@ -313,26 +326,27 @@ public function getEmailAddress() /** * Sets email_address * - * @param string $email_address email address to run the verification for + * @param string $email_address Email address to run the verification for. * * @return self */ - public function setEmailAddress(string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -341,11 +355,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -356,8 +370,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -370,9 +386,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -380,12 +398,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -414,3 +432,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/AccountVerifyResponse.php b/sdks/php/src/Model/AccountVerifyResponse.php index f8f6a65e5..351b0dfcd 100644 --- a/sdks/php/src/Model/AccountVerifyResponse.php +++ b/sdks/php/src/Model/AccountVerifyResponse.php @@ -1,11 +1,14 @@ */ -class AccountVerifyResponse implements ModelInterface, ArrayAccess, JsonSerializable +class AccountVerifyResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountVerifyResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account' => '\Dropbox\Sign\Model\AccountVerifyResponseAccount', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'account' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'account' => 'account', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'account' => 'setAccount', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'account' => 'getAccount', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('account', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): AccountVerifyResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): AccountVerifyResponse { /** @var AccountVerifyResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, AccountVerifyResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -288,7 +300,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -302,6 +316,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets account * @@ -319,10 +334,10 @@ public function getAccount() * * @return self */ - public function setAccount(?AccountVerifyResponseAccount $account) + public function setAccount($account) { if (is_null($account)) { - throw new InvalidArgumentException('non-nullable account cannot be null'); + throw new \InvalidArgumentException('non-nullable account cannot be null'); } $this->container['account'] = $account; @@ -342,26 +357,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -370,11 +386,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -385,8 +401,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -399,9 +417,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -409,12 +429,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -443,3 +463,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/AccountVerifyResponseAccount.php b/sdks/php/src/Model/AccountVerifyResponseAccount.php index 34a1de5e9..c03652637 100644 --- a/sdks/php/src/Model/AccountVerifyResponseAccount.php +++ b/sdks/php/src/Model/AccountVerifyResponseAccount.php @@ -1,11 +1,14 @@ */ -class AccountVerifyResponseAccount implements ModelInterface, ArrayAccess, JsonSerializable +class AccountVerifyResponseAccount implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountVerifyResponseAccount'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'email_address' => 'string', + 'email_address' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'email_address' => null, + 'email_address' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'email_address' => false, + 'email_address' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -109,6 +111,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -118,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -128,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -137,6 +141,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -145,6 +152,9 @@ 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 { @@ -158,7 +168,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'email_address' => 'email_address', + 'email_address' => 'email_address' ]; /** @@ -167,7 +177,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'email_address' => 'setEmailAddress', + 'email_address' => 'setEmailAddress' ]; /** @@ -176,7 +186,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'email_address' => 'getEmailAddress', + 'email_address' => 'getEmailAddress' ]; /** @@ -220,6 +230,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -230,41 +241,42 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('email_address', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): AccountVerifyResponseAccount { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): AccountVerifyResponseAccount { /** @var AccountVerifyResponseAccount */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, AccountVerifyResponseAccount::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -281,7 +293,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -295,6 +309,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets email_address * @@ -308,26 +323,27 @@ public function getEmailAddress() /** * Sets email_address * - * @param string|null $email_address the email address associated with the Account + * @param string|null $email_address The email address associated with the Account. * * @return self */ - public function setEmailAddress(?string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -336,11 +352,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -351,8 +367,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -365,9 +383,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -375,12 +395,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -409,3 +429,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/ApiAppCreateRequest.php b/sdks/php/src/Model/ApiAppCreateRequest.php index d31444091..66d1ae727 100644 --- a/sdks/php/src/Model/ApiAppCreateRequest.php +++ b/sdks/php/src/Model/ApiAppCreateRequest.php @@ -1,11 +1,14 @@ */ -class ApiAppCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class ApiAppCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiAppCreateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'domains' => 'string[]', 'name' => 'string', @@ -64,16 +65,16 @@ class ApiAppCreateRequest implements ModelInterface, ArrayAccess, JsonSerializab 'custom_logo_file' => '\SplFileObject', 'oauth' => '\Dropbox\Sign\Model\SubOAuth', 'options' => '\Dropbox\Sign\Model\SubOptions', - 'white_labeling_options' => '\Dropbox\Sign\Model\SubWhiteLabelingOptions', + 'white_labeling_options' => '\Dropbox\Sign\Model\SubWhiteLabelingOptions' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'domains' => null, 'name' => null, @@ -81,14 +82,14 @@ class ApiAppCreateRequest implements ModelInterface, ArrayAccess, JsonSerializab 'custom_logo_file' => 'binary', 'oauth' => null, 'options' => null, - 'white_labeling_options' => null, + 'white_labeling_options' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'domains' => false, 'name' => false, @@ -96,14 +97,14 @@ class ApiAppCreateRequest implements ModelInterface, ArrayAccess, JsonSerializab 'custom_logo_file' => false, 'oauth' => false, 'options' => false, - 'white_labeling_options' => false, + 'white_labeling_options' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -128,6 +129,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -137,7 +140,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -147,7 +150,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -156,6 +159,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -164,6 +170,9 @@ 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 { @@ -183,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'custom_logo_file' => 'custom_logo_file', 'oauth' => 'oauth', 'options' => 'options', - 'white_labeling_options' => 'white_labeling_options', + 'white_labeling_options' => 'white_labeling_options' ]; /** @@ -198,7 +207,7 @@ public function isNullableSetToNull(string $property): bool 'custom_logo_file' => 'setCustomLogoFile', 'oauth' => 'setOauth', 'options' => 'setOptions', - 'white_labeling_options' => 'setWhiteLabelingOptions', + 'white_labeling_options' => 'setWhiteLabelingOptions' ]; /** @@ -213,7 +222,7 @@ public function isNullableSetToNull(string $property): bool 'custom_logo_file' => 'getCustomLogoFile', 'oauth' => 'getOauth', 'options' => 'getOptions', - 'white_labeling_options' => 'getWhiteLabelingOptions', + 'white_labeling_options' => 'getWhiteLabelingOptions' ]; /** @@ -257,6 +266,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -267,10 +277,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('domains', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -281,33 +291,34 @@ public function __construct(array $data = null) $this->setIfExists('white_labeling_options', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): ApiAppCreateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): ApiAppCreateRequest { /** @var ApiAppCreateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, ApiAppCreateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -329,11 +340,11 @@ public function listInvalidProperties() if ($this->container['domains'] === null) { $invalidProperties[] = "'domains' can't be null"; } - if (count($this->container['domains']) > 2) { + if ((count($this->container['domains']) > 2)) { $invalidProperties[] = "invalid value for 'domains', number of items must be less than or equal to 2."; } - if (count($this->container['domains']) < 1) { + if ((count($this->container['domains']) < 1)) { $invalidProperties[] = "invalid value for 'domains', number of items must be greater than or equal to 1."; } @@ -354,6 +365,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets domains * @@ -367,21 +379,21 @@ public function getDomains() /** * Sets domains * - * @param string[] $domains the domain names the ApiApp will be associated with + * @param string[] $domains The domain names the ApiApp will be associated with. * * @return self */ - public function setDomains(array $domains) + public function setDomains($domains) { if (is_null($domains)) { - throw new InvalidArgumentException('non-nullable domains cannot be null'); + throw new \InvalidArgumentException('non-nullable domains cannot be null'); } - if (count($domains) > 2) { - throw new InvalidArgumentException('invalid value for $domains when calling ApiAppCreateRequest., number of items must be less than or equal to 2.'); + if ((count($domains) > 2)) { + throw new \InvalidArgumentException('invalid value for $domains when calling ApiAppCreateRequest., number of items must be less than or equal to 2.'); } - if (count($domains) < 1) { - throw new InvalidArgumentException('invalid length for $domains when calling ApiAppCreateRequest., number of items must be greater than or equal to 1.'); + if ((count($domains) < 1)) { + throw new \InvalidArgumentException('invalid length for $domains when calling ApiAppCreateRequest., number of items must be greater than or equal to 1.'); } $this->container['domains'] = $domains; @@ -401,14 +413,14 @@ public function getName() /** * Sets name * - * @param string $name the name you want to assign to the ApiApp + * @param string $name The name you want to assign to the ApiApp. * * @return self */ - public function setName(string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -428,14 +440,14 @@ public function getCallbackUrl() /** * Sets callback_url * - * @param string|null $callback_url the URL at which the ApiApp should receive event callbacks + * @param string|null $callback_url The URL at which the ApiApp should receive event callbacks. * * @return self */ - public function setCallbackUrl(?string $callback_url) + public function setCallbackUrl($callback_url) { if (is_null($callback_url)) { - throw new InvalidArgumentException('non-nullable callback_url cannot be null'); + throw new \InvalidArgumentException('non-nullable callback_url cannot be null'); } $this->container['callback_url'] = $callback_url; @@ -445,7 +457,7 @@ public function setCallbackUrl(?string $callback_url) /** * Gets custom_logo_file * - * @return SplFileObject|null + * @return \SplFileObject|null */ public function getCustomLogoFile() { @@ -455,14 +467,14 @@ public function getCustomLogoFile() /** * Sets custom_logo_file * - * @param SplFileObject|null $custom_logo_file An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) + * @param \SplFileObject|null $custom_logo_file An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) * * @return self */ - public function setCustomLogoFile(?SplFileObject $custom_logo_file) + public function setCustomLogoFile($custom_logo_file) { if (is_null($custom_logo_file)) { - throw new InvalidArgumentException('non-nullable custom_logo_file cannot be null'); + throw new \InvalidArgumentException('non-nullable custom_logo_file cannot be null'); } $this->container['custom_logo_file'] = $custom_logo_file; @@ -486,10 +498,10 @@ public function getOauth() * * @return self */ - public function setOauth(?SubOAuth $oauth) + public function setOauth($oauth) { if (is_null($oauth)) { - throw new InvalidArgumentException('non-nullable oauth cannot be null'); + throw new \InvalidArgumentException('non-nullable oauth cannot be null'); } $this->container['oauth'] = $oauth; @@ -513,10 +525,10 @@ public function getOptions() * * @return self */ - public function setOptions(?SubOptions $options) + public function setOptions($options) { if (is_null($options)) { - throw new InvalidArgumentException('non-nullable options cannot be null'); + throw new \InvalidArgumentException('non-nullable options cannot be null'); } $this->container['options'] = $options; @@ -540,22 +552,23 @@ public function getWhiteLabelingOptions() * * @return self */ - public function setWhiteLabelingOptions(?SubWhiteLabelingOptions $white_labeling_options) + public function setWhiteLabelingOptions($white_labeling_options) { if (is_null($white_labeling_options)) { - throw new InvalidArgumentException('non-nullable white_labeling_options cannot be null'); + throw new \InvalidArgumentException('non-nullable white_labeling_options cannot be null'); } $this->container['white_labeling_options'] = $white_labeling_options; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -564,11 +577,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -579,8 +592,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -593,9 +608,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -603,12 +620,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -637,3 +654,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/ApiAppGetResponse.php b/sdks/php/src/Model/ApiAppGetResponse.php index f95c2b6e0..8e8320af8 100644 --- a/sdks/php/src/Model/ApiAppGetResponse.php +++ b/sdks/php/src/Model/ApiAppGetResponse.php @@ -1,11 +1,14 @@ */ -class ApiAppGetResponse implements ModelInterface, ArrayAccess, JsonSerializable +class ApiAppGetResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiAppGetResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'api_app' => '\Dropbox\Sign\Model\ApiAppResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'api_app' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'api_app' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'api_app' => 'api_app', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'api_app' => 'setApiApp', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'api_app' => 'getApiApp', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('api_app', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): ApiAppGetResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): ApiAppGetResponse { /** @var ApiAppGetResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, ApiAppGetResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,6 +319,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets api_app * @@ -324,10 +337,10 @@ public function getApiApp() * * @return self */ - public function setApiApp(ApiAppResponse $api_app) + public function setApiApp($api_app) { if (is_null($api_app)) { - throw new InvalidArgumentException('non-nullable api_app cannot be null'); + throw new \InvalidArgumentException('non-nullable api_app cannot be null'); } $this->container['api_app'] = $api_app; @@ -347,26 +360,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -375,11 +389,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,8 +404,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -404,9 +420,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -414,12 +432,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -448,3 +466,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/ApiAppListResponse.php b/sdks/php/src/Model/ApiAppListResponse.php index 44afca3c1..b062e12d7 100644 --- a/sdks/php/src/Model/ApiAppListResponse.php +++ b/sdks/php/src/Model/ApiAppListResponse.php @@ -1,11 +1,14 @@ */ -class ApiAppListResponse implements ModelInterface, ArrayAccess, JsonSerializable +class ApiAppListResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiAppListResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'api_apps' => '\Dropbox\Sign\Model\ApiAppResponse[]', 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'api_apps' => null, 'list_info' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'api_apps' => false, 'list_info' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'api_apps' => 'api_apps', 'list_info' => 'list_info', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'api_apps' => 'setApiApps', 'list_info' => 'setListInfo', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'api_apps' => 'getApiApps', 'list_info' => 'getListInfo', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -232,6 +242,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -242,43 +253,44 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('api_apps', $data ?? [], null); $this->setIfExists('list_info', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): ApiAppListResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): ApiAppListResponse { /** @var ApiAppListResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, ApiAppListResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -317,6 +329,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets api_apps * @@ -330,14 +343,14 @@ public function getApiApps() /** * Sets api_apps * - * @param ApiAppResponse[] $api_apps contains information about API Apps + * @param ApiAppResponse[] $api_apps Contains information about API Apps. * * @return self */ - public function setApiApps(array $api_apps) + public function setApiApps($api_apps) { if (is_null($api_apps)) { - throw new InvalidArgumentException('non-nullable api_apps cannot be null'); + throw new \InvalidArgumentException('non-nullable api_apps cannot be null'); } $this->container['api_apps'] = $api_apps; @@ -361,10 +374,10 @@ public function getListInfo() * * @return self */ - public function setListInfo(ListInfoResponse $list_info) + public function setListInfo($list_info) { if (is_null($list_info)) { - throw new InvalidArgumentException('non-nullable list_info cannot be null'); + throw new \InvalidArgumentException('non-nullable list_info cannot be null'); } $this->container['list_info'] = $list_info; @@ -384,26 +397,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -412,11 +426,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -427,8 +441,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -441,9 +457,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -451,12 +469,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -485,3 +503,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/ApiAppResponse.php b/sdks/php/src/Model/ApiAppResponse.php index 3e214031d..e43961965 100644 --- a/sdks/php/src/Model/ApiAppResponse.php +++ b/sdks/php/src/Model/ApiAppResponse.php @@ -1,11 +1,14 @@ */ -class ApiAppResponse implements ModelInterface, ArrayAccess, JsonSerializable +class ApiAppResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiAppResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'callback_url' => 'string', 'client_id' => 'string', @@ -67,16 +69,16 @@ class ApiAppResponse implements ModelInterface, ArrayAccess, JsonSerializable 'oauth' => '\Dropbox\Sign\Model\ApiAppResponseOAuth', 'options' => '\Dropbox\Sign\Model\ApiAppResponseOptions', 'owner_account' => '\Dropbox\Sign\Model\ApiAppResponseOwnerAccount', - 'white_labeling_options' => '\Dropbox\Sign\Model\ApiAppResponseWhiteLabelingOptions', + 'white_labeling_options' => '\Dropbox\Sign\Model\ApiAppResponseWhiteLabelingOptions' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'callback_url' => null, 'client_id' => null, @@ -87,14 +89,14 @@ class ApiAppResponse implements ModelInterface, ArrayAccess, JsonSerializable 'oauth' => null, 'options' => null, 'owner_account' => null, - 'white_labeling_options' => null, + 'white_labeling_options' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'callback_url' => true, 'client_id' => false, @@ -105,14 +107,14 @@ class ApiAppResponse implements ModelInterface, ArrayAccess, JsonSerializable 'oauth' => true, 'options' => true, 'owner_account' => false, - 'white_labeling_options' => true, + 'white_labeling_options' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -137,6 +139,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -146,7 +150,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -156,7 +160,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -165,6 +169,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -173,6 +180,9 @@ 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 { @@ -195,7 +205,7 @@ public function isNullableSetToNull(string $property): bool 'oauth' => 'oauth', 'options' => 'options', 'owner_account' => 'owner_account', - 'white_labeling_options' => 'white_labeling_options', + 'white_labeling_options' => 'white_labeling_options' ]; /** @@ -213,7 +223,7 @@ public function isNullableSetToNull(string $property): bool 'oauth' => 'setOauth', 'options' => 'setOptions', 'owner_account' => 'setOwnerAccount', - 'white_labeling_options' => 'setWhiteLabelingOptions', + 'white_labeling_options' => 'setWhiteLabelingOptions' ]; /** @@ -231,7 +241,7 @@ public function isNullableSetToNull(string $property): bool 'oauth' => 'getOauth', 'options' => 'getOptions', 'owner_account' => 'getOwnerAccount', - 'white_labeling_options' => 'getWhiteLabelingOptions', + 'white_labeling_options' => 'getWhiteLabelingOptions' ]; /** @@ -275,6 +285,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -285,10 +296,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('callback_url', $data ?? [], null); $this->setIfExists('client_id', $data ?? [], null); @@ -302,33 +313,34 @@ public function __construct(array $data = null) $this->setIfExists('white_labeling_options', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): ApiAppResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): ApiAppResponse { /** @var ApiAppResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, ApiAppResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -345,7 +357,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -359,6 +373,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets callback_url * @@ -376,13 +391,13 @@ public function getCallbackUrl() * * @return self */ - public function setCallbackUrl(?string $callback_url) + public function setCallbackUrl($callback_url) { if (is_null($callback_url)) { array_push($this->openAPINullablesSetToNull, 'callback_url'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('callback_url', $nullablesSetToNull); + $index = array_search('callback_url', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -410,10 +425,10 @@ public function getClientId() * * @return self */ - public function setClientId(?string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -437,10 +452,10 @@ public function getCreatedAt() * * @return self */ - public function setCreatedAt(?int $created_at) + public function setCreatedAt($created_at) { if (is_null($created_at)) { - throw new InvalidArgumentException('non-nullable created_at cannot be null'); + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } $this->container['created_at'] = $created_at; @@ -464,10 +479,10 @@ public function getDomains() * * @return self */ - public function setDomains(?array $domains) + public function setDomains($domains) { if (is_null($domains)) { - throw new InvalidArgumentException('non-nullable domains cannot be null'); + throw new \InvalidArgumentException('non-nullable domains cannot be null'); } $this->container['domains'] = $domains; @@ -491,10 +506,10 @@ public function getName() * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -518,10 +533,10 @@ public function getIsApproved() * * @return self */ - public function setIsApproved(?bool $is_approved) + public function setIsApproved($is_approved) { if (is_null($is_approved)) { - throw new InvalidArgumentException('non-nullable is_approved cannot be null'); + throw new \InvalidArgumentException('non-nullable is_approved cannot be null'); } $this->container['is_approved'] = $is_approved; @@ -545,13 +560,13 @@ public function getOauth() * * @return self */ - public function setOauth(?ApiAppResponseOAuth $oauth) + public function setOauth($oauth) { if (is_null($oauth)) { array_push($this->openAPINullablesSetToNull, 'oauth'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('oauth', $nullablesSetToNull); + $index = array_search('oauth', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -579,13 +594,13 @@ public function getOptions() * * @return self */ - public function setOptions(?ApiAppResponseOptions $options) + public function setOptions($options) { if (is_null($options)) { array_push($this->openAPINullablesSetToNull, 'options'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('options', $nullablesSetToNull); + $index = array_search('options', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -613,10 +628,10 @@ public function getOwnerAccount() * * @return self */ - public function setOwnerAccount(?ApiAppResponseOwnerAccount $owner_account) + public function setOwnerAccount($owner_account) { if (is_null($owner_account)) { - throw new InvalidArgumentException('non-nullable owner_account cannot be null'); + throw new \InvalidArgumentException('non-nullable owner_account cannot be null'); } $this->container['owner_account'] = $owner_account; @@ -640,13 +655,13 @@ public function getWhiteLabelingOptions() * * @return self */ - public function setWhiteLabelingOptions(?ApiAppResponseWhiteLabelingOptions $white_labeling_options) + public function setWhiteLabelingOptions($white_labeling_options) { if (is_null($white_labeling_options)) { array_push($this->openAPINullablesSetToNull, 'white_labeling_options'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('white_labeling_options', $nullablesSetToNull); + $index = array_search('white_labeling_options', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -656,13 +671,14 @@ public function setWhiteLabelingOptions(?ApiAppResponseWhiteLabelingOptions $whi return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -671,11 +687,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -686,8 +702,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -700,9 +718,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -710,12 +730,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -744,3 +764,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/ApiAppResponseOAuth.php b/sdks/php/src/Model/ApiAppResponseOAuth.php index ac2ecf08b..2e654a1ea 100644 --- a/sdks/php/src/Model/ApiAppResponseOAuth.php +++ b/sdks/php/src/Model/ApiAppResponseOAuth.php @@ -1,11 +1,14 @@ */ -class ApiAppResponseOAuth implements ModelInterface, ArrayAccess, JsonSerializable +class ApiAppResponseOAuth implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiAppResponseOAuth'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'callback_url' => 'string', 'secret' => 'string', 'scopes' => 'string[]', - 'charges_users' => 'bool', + 'charges_users' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'callback_url' => null, 'secret' => null, 'scopes' => null, - 'charges_users' => null, + 'charges_users' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'callback_url' => false, 'secret' => true, 'scopes' => false, - 'charges_users' => false, + 'charges_users' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -119,6 +121,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -128,7 +132,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +142,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,6 +151,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -155,6 +162,9 @@ 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 { @@ -171,7 +181,7 @@ public function isNullableSetToNull(string $property): bool 'callback_url' => 'callback_url', 'secret' => 'secret', 'scopes' => 'scopes', - 'charges_users' => 'charges_users', + 'charges_users' => 'charges_users' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool 'callback_url' => 'setCallbackUrl', 'secret' => 'setSecret', 'scopes' => 'setScopes', - 'charges_users' => 'setChargesUsers', + 'charges_users' => 'setChargesUsers' ]; /** @@ -195,7 +205,7 @@ public function isNullableSetToNull(string $property): bool 'callback_url' => 'getCallbackUrl', 'secret' => 'getSecret', 'scopes' => 'getScopes', - 'charges_users' => 'getChargesUsers', + 'charges_users' => 'getChargesUsers' ]; /** @@ -239,6 +249,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -249,10 +260,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('callback_url', $data ?? [], null); $this->setIfExists('secret', $data ?? [], null); @@ -260,33 +271,34 @@ public function __construct(array $data = null) $this->setIfExists('charges_users', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): ApiAppResponseOAuth { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): ApiAppResponseOAuth { /** @var ApiAppResponseOAuth */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, ApiAppResponseOAuth::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -303,7 +315,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -317,6 +331,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets callback_url * @@ -330,14 +345,14 @@ public function getCallbackUrl() /** * Sets callback_url * - * @param string|null $callback_url the app's OAuth callback URL + * @param string|null $callback_url The app's OAuth callback URL. * * @return self */ - public function setCallbackUrl(?string $callback_url) + public function setCallbackUrl($callback_url) { if (is_null($callback_url)) { - throw new InvalidArgumentException('non-nullable callback_url cannot be null'); + throw new \InvalidArgumentException('non-nullable callback_url cannot be null'); } $this->container['callback_url'] = $callback_url; @@ -357,17 +372,17 @@ public function getSecret() /** * Sets secret * - * @param string|null $secret the app's OAuth secret, or null if the app does not belong to user + * @param string|null $secret The app's OAuth secret, or null if the app does not belong to user. * * @return self */ - public function setSecret(?string $secret) + public function setSecret($secret) { if (is_null($secret)) { array_push($this->openAPINullablesSetToNull, 'secret'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('secret', $nullablesSetToNull); + $index = array_search('secret', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -391,14 +406,14 @@ public function getScopes() /** * Sets scopes * - * @param string[]|null $scopes array of OAuth scopes used by the app + * @param string[]|null $scopes Array of OAuth scopes used by the app. * * @return self */ - public function setScopes(?array $scopes) + public function setScopes($scopes) { if (is_null($scopes)) { - throw new InvalidArgumentException('non-nullable scopes cannot be null'); + throw new \InvalidArgumentException('non-nullable scopes cannot be null'); } $this->container['scopes'] = $scopes; @@ -418,26 +433,27 @@ public function getChargesUsers() /** * Sets charges_users * - * @param bool|null $charges_users boolean indicating whether the app owner or the account granting permission is billed for OAuth requests + * @param bool|null $charges_users Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests. * * @return self */ - public function setChargesUsers(?bool $charges_users) + public function setChargesUsers($charges_users) { if (is_null($charges_users)) { - throw new InvalidArgumentException('non-nullable charges_users cannot be null'); + throw new \InvalidArgumentException('non-nullable charges_users cannot be null'); } $this->container['charges_users'] = $charges_users; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -446,11 +462,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -461,8 +477,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -475,9 +493,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -485,12 +505,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -519,3 +539,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/ApiAppResponseOptions.php b/sdks/php/src/Model/ApiAppResponseOptions.php index 99c11f02a..df731ad3e 100644 --- a/sdks/php/src/Model/ApiAppResponseOptions.php +++ b/sdks/php/src/Model/ApiAppResponseOptions.php @@ -1,11 +1,14 @@ */ -class ApiAppResponseOptions implements ModelInterface, ArrayAccess, JsonSerializable +class ApiAppResponseOptions implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiAppResponseOptions'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'can_insert_everywhere' => 'bool', + 'can_insert_everywhere' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'can_insert_everywhere' => null, + 'can_insert_everywhere' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'can_insert_everywhere' => false, + 'can_insert_everywhere' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,6 +112,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -119,7 +123,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -129,7 +133,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -138,6 +142,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -146,6 +153,9 @@ 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 { @@ -159,7 +169,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'can_insert_everywhere' => 'can_insert_everywhere', + 'can_insert_everywhere' => 'can_insert_everywhere' ]; /** @@ -168,7 +178,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'can_insert_everywhere' => 'setCanInsertEverywhere', + 'can_insert_everywhere' => 'setCanInsertEverywhere' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'can_insert_everywhere' => 'getCanInsertEverywhere', + 'can_insert_everywhere' => 'getCanInsertEverywhere' ]; /** @@ -221,6 +231,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -231,41 +242,42 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('can_insert_everywhere', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): ApiAppResponseOptions { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): ApiAppResponseOptions { /** @var ApiAppResponseOptions */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, ApiAppResponseOptions::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -282,7 +294,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -296,6 +310,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets can_insert_everywhere * @@ -313,22 +328,23 @@ public function getCanInsertEverywhere() * * @return self */ - public function setCanInsertEverywhere(?bool $can_insert_everywhere) + public function setCanInsertEverywhere($can_insert_everywhere) { if (is_null($can_insert_everywhere)) { - throw new InvalidArgumentException('non-nullable can_insert_everywhere cannot be null'); + throw new \InvalidArgumentException('non-nullable can_insert_everywhere cannot be null'); } $this->container['can_insert_everywhere'] = $can_insert_everywhere; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -337,11 +353,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -352,8 +368,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -366,9 +384,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -376,12 +396,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -410,3 +430,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/ApiAppResponseOwnerAccount.php b/sdks/php/src/Model/ApiAppResponseOwnerAccount.php index ffc120960..b46a76248 100644 --- a/sdks/php/src/Model/ApiAppResponseOwnerAccount.php +++ b/sdks/php/src/Model/ApiAppResponseOwnerAccount.php @@ -1,11 +1,14 @@ */ -class ApiAppResponseOwnerAccount implements ModelInterface, ArrayAccess, JsonSerializable +class ApiAppResponseOwnerAccount implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiAppResponseOwnerAccount'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account_id' => 'string', - 'email_address' => 'string', + 'email_address' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account_id' => null, - 'email_address' => null, + 'email_address' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'account_id' => false, - 'email_address' => false, + 'email_address' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,6 +115,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -122,7 +126,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +136,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,6 +145,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -149,6 +156,9 @@ 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 { @@ -163,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'account_id' => 'account_id', - 'email_address' => 'email_address', + 'email_address' => 'email_address' ]; /** @@ -173,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'account_id' => 'setAccountId', - 'email_address' => 'setEmailAddress', + 'email_address' => 'setEmailAddress' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'account_id' => 'getAccountId', - 'email_address' => 'getEmailAddress', + 'email_address' => 'getEmailAddress' ]; /** @@ -227,6 +237,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -237,42 +248,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('account_id', $data ?? [], null); $this->setIfExists('email_address', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): ApiAppResponseOwnerAccount { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): ApiAppResponseOwnerAccount { /** @var ApiAppResponseOwnerAccount */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, ApiAppResponseOwnerAccount::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -289,7 +301,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -303,6 +317,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets account_id * @@ -320,10 +335,10 @@ public function getAccountId() * * @return self */ - public function setAccountId(?string $account_id) + public function setAccountId($account_id) { if (is_null($account_id)) { - throw new InvalidArgumentException('non-nullable account_id cannot be null'); + throw new \InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -347,22 +362,23 @@ public function getEmailAddress() * * @return self */ - public function setEmailAddress(?string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -371,11 +387,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -386,8 +402,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -400,9 +418,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -410,12 +430,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -444,3 +464,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/ApiAppResponseWhiteLabelingOptions.php b/sdks/php/src/Model/ApiAppResponseWhiteLabelingOptions.php index 95f29f5f4..39ee3623c 100644 --- a/sdks/php/src/Model/ApiAppResponseWhiteLabelingOptions.php +++ b/sdks/php/src/Model/ApiAppResponseWhiteLabelingOptions.php @@ -1,11 +1,14 @@ */ -class ApiAppResponseWhiteLabelingOptions implements ModelInterface, ArrayAccess, JsonSerializable +class ApiAppResponseWhiteLabelingOptions implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiAppResponseWhiteLabelingOptions'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'header_background_color' => 'string', 'legal_version' => 'string', @@ -71,16 +73,16 @@ class ApiAppResponseWhiteLabelingOptions implements ModelInterface, ArrayAccess, 'secondary_button_text_color' => 'string', 'secondary_button_text_color_hover' => 'string', 'text_color1' => 'string', - 'text_color2' => 'string', + 'text_color2' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'header_background_color' => null, 'legal_version' => null, @@ -95,14 +97,14 @@ class ApiAppResponseWhiteLabelingOptions implements ModelInterface, ArrayAccess, 'secondary_button_text_color' => null, 'secondary_button_text_color_hover' => null, 'text_color1' => null, - 'text_color2' => null, + 'text_color2' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'header_background_color' => false, 'legal_version' => false, @@ -117,14 +119,14 @@ class ApiAppResponseWhiteLabelingOptions implements ModelInterface, ArrayAccess, 'secondary_button_text_color' => false, 'secondary_button_text_color_hover' => false, 'text_color1' => false, - 'text_color2' => false, + 'text_color2' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -149,6 +151,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -158,7 +162,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -168,7 +172,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -177,6 +181,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -185,6 +192,9 @@ 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 { @@ -211,7 +221,7 @@ public function isNullableSetToNull(string $property): bool 'secondary_button_text_color' => 'secondary_button_text_color', 'secondary_button_text_color_hover' => 'secondary_button_text_color_hover', 'text_color1' => 'text_color1', - 'text_color2' => 'text_color2', + 'text_color2' => 'text_color2' ]; /** @@ -233,7 +243,7 @@ public function isNullableSetToNull(string $property): bool 'secondary_button_text_color' => 'setSecondaryButtonTextColor', 'secondary_button_text_color_hover' => 'setSecondaryButtonTextColorHover', 'text_color1' => 'setTextColor1', - 'text_color2' => 'setTextColor2', + 'text_color2' => 'setTextColor2' ]; /** @@ -255,7 +265,7 @@ public function isNullableSetToNull(string $property): bool 'secondary_button_text_color' => 'getSecondaryButtonTextColor', 'secondary_button_text_color_hover' => 'getSecondaryButtonTextColorHover', 'text_color1' => 'getTextColor1', - 'text_color2' => 'getTextColor2', + 'text_color2' => 'getTextColor2' ]; /** @@ -299,6 +309,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -309,10 +320,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('header_background_color', $data ?? [], null); $this->setIfExists('legal_version', $data ?? [], null); @@ -330,33 +341,34 @@ public function __construct(array $data = null) $this->setIfExists('text_color2', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): ApiAppResponseWhiteLabelingOptions { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): ApiAppResponseWhiteLabelingOptions { /** @var ApiAppResponseWhiteLabelingOptions */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, ApiAppResponseWhiteLabelingOptions::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -373,7 +385,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -387,6 +401,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets header_background_color * @@ -404,10 +419,10 @@ public function getHeaderBackgroundColor() * * @return self */ - public function setHeaderBackgroundColor(?string $header_background_color) + public function setHeaderBackgroundColor($header_background_color) { if (is_null($header_background_color)) { - throw new InvalidArgumentException('non-nullable header_background_color cannot be null'); + throw new \InvalidArgumentException('non-nullable header_background_color cannot be null'); } $this->container['header_background_color'] = $header_background_color; @@ -431,10 +446,10 @@ public function getLegalVersion() * * @return self */ - public function setLegalVersion(?string $legal_version) + public function setLegalVersion($legal_version) { if (is_null($legal_version)) { - throw new InvalidArgumentException('non-nullable legal_version cannot be null'); + throw new \InvalidArgumentException('non-nullable legal_version cannot be null'); } $this->container['legal_version'] = $legal_version; @@ -458,10 +473,10 @@ public function getLinkColor() * * @return self */ - public function setLinkColor(?string $link_color) + public function setLinkColor($link_color) { if (is_null($link_color)) { - throw new InvalidArgumentException('non-nullable link_color cannot be null'); + throw new \InvalidArgumentException('non-nullable link_color cannot be null'); } $this->container['link_color'] = $link_color; @@ -485,10 +500,10 @@ public function getPageBackgroundColor() * * @return self */ - public function setPageBackgroundColor(?string $page_background_color) + public function setPageBackgroundColor($page_background_color) { if (is_null($page_background_color)) { - throw new InvalidArgumentException('non-nullable page_background_color cannot be null'); + throw new \InvalidArgumentException('non-nullable page_background_color cannot be null'); } $this->container['page_background_color'] = $page_background_color; @@ -512,10 +527,10 @@ public function getPrimaryButtonColor() * * @return self */ - public function setPrimaryButtonColor(?string $primary_button_color) + public function setPrimaryButtonColor($primary_button_color) { if (is_null($primary_button_color)) { - throw new InvalidArgumentException('non-nullable primary_button_color cannot be null'); + throw new \InvalidArgumentException('non-nullable primary_button_color cannot be null'); } $this->container['primary_button_color'] = $primary_button_color; @@ -539,10 +554,10 @@ public function getPrimaryButtonColorHover() * * @return self */ - public function setPrimaryButtonColorHover(?string $primary_button_color_hover) + public function setPrimaryButtonColorHover($primary_button_color_hover) { if (is_null($primary_button_color_hover)) { - throw new InvalidArgumentException('non-nullable primary_button_color_hover cannot be null'); + throw new \InvalidArgumentException('non-nullable primary_button_color_hover cannot be null'); } $this->container['primary_button_color_hover'] = $primary_button_color_hover; @@ -566,10 +581,10 @@ public function getPrimaryButtonTextColor() * * @return self */ - public function setPrimaryButtonTextColor(?string $primary_button_text_color) + public function setPrimaryButtonTextColor($primary_button_text_color) { if (is_null($primary_button_text_color)) { - throw new InvalidArgumentException('non-nullable primary_button_text_color cannot be null'); + throw new \InvalidArgumentException('non-nullable primary_button_text_color cannot be null'); } $this->container['primary_button_text_color'] = $primary_button_text_color; @@ -593,10 +608,10 @@ public function getPrimaryButtonTextColorHover() * * @return self */ - public function setPrimaryButtonTextColorHover(?string $primary_button_text_color_hover) + public function setPrimaryButtonTextColorHover($primary_button_text_color_hover) { if (is_null($primary_button_text_color_hover)) { - throw new InvalidArgumentException('non-nullable primary_button_text_color_hover cannot be null'); + throw new \InvalidArgumentException('non-nullable primary_button_text_color_hover cannot be null'); } $this->container['primary_button_text_color_hover'] = $primary_button_text_color_hover; @@ -620,10 +635,10 @@ public function getSecondaryButtonColor() * * @return self */ - public function setSecondaryButtonColor(?string $secondary_button_color) + public function setSecondaryButtonColor($secondary_button_color) { if (is_null($secondary_button_color)) { - throw new InvalidArgumentException('non-nullable secondary_button_color cannot be null'); + throw new \InvalidArgumentException('non-nullable secondary_button_color cannot be null'); } $this->container['secondary_button_color'] = $secondary_button_color; @@ -647,10 +662,10 @@ public function getSecondaryButtonColorHover() * * @return self */ - public function setSecondaryButtonColorHover(?string $secondary_button_color_hover) + public function setSecondaryButtonColorHover($secondary_button_color_hover) { if (is_null($secondary_button_color_hover)) { - throw new InvalidArgumentException('non-nullable secondary_button_color_hover cannot be null'); + throw new \InvalidArgumentException('non-nullable secondary_button_color_hover cannot be null'); } $this->container['secondary_button_color_hover'] = $secondary_button_color_hover; @@ -674,10 +689,10 @@ public function getSecondaryButtonTextColor() * * @return self */ - public function setSecondaryButtonTextColor(?string $secondary_button_text_color) + public function setSecondaryButtonTextColor($secondary_button_text_color) { if (is_null($secondary_button_text_color)) { - throw new InvalidArgumentException('non-nullable secondary_button_text_color cannot be null'); + throw new \InvalidArgumentException('non-nullable secondary_button_text_color cannot be null'); } $this->container['secondary_button_text_color'] = $secondary_button_text_color; @@ -701,10 +716,10 @@ public function getSecondaryButtonTextColorHover() * * @return self */ - public function setSecondaryButtonTextColorHover(?string $secondary_button_text_color_hover) + public function setSecondaryButtonTextColorHover($secondary_button_text_color_hover) { if (is_null($secondary_button_text_color_hover)) { - throw new InvalidArgumentException('non-nullable secondary_button_text_color_hover cannot be null'); + throw new \InvalidArgumentException('non-nullable secondary_button_text_color_hover cannot be null'); } $this->container['secondary_button_text_color_hover'] = $secondary_button_text_color_hover; @@ -728,10 +743,10 @@ public function getTextColor1() * * @return self */ - public function setTextColor1(?string $text_color1) + public function setTextColor1($text_color1) { if (is_null($text_color1)) { - throw new InvalidArgumentException('non-nullable text_color1 cannot be null'); + throw new \InvalidArgumentException('non-nullable text_color1 cannot be null'); } $this->container['text_color1'] = $text_color1; @@ -755,22 +770,23 @@ public function getTextColor2() * * @return self */ - public function setTextColor2(?string $text_color2) + public function setTextColor2($text_color2) { if (is_null($text_color2)) { - throw new InvalidArgumentException('non-nullable text_color2 cannot be null'); + throw new \InvalidArgumentException('non-nullable text_color2 cannot be null'); } $this->container['text_color2'] = $text_color2; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -779,11 +795,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -794,8 +810,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -808,9 +826,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -818,12 +838,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -852,3 +872,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/ApiAppUpdateRequest.php b/sdks/php/src/Model/ApiAppUpdateRequest.php index 456d143c2..0b391b802 100644 --- a/sdks/php/src/Model/ApiAppUpdateRequest.php +++ b/sdks/php/src/Model/ApiAppUpdateRequest.php @@ -1,11 +1,14 @@ */ -class ApiAppUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class ApiAppUpdateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiAppUpdateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'callback_url' => 'string', 'custom_logo_file' => '\SplFileObject', @@ -64,16 +65,16 @@ class ApiAppUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializab 'name' => 'string', 'oauth' => '\Dropbox\Sign\Model\SubOAuth', 'options' => '\Dropbox\Sign\Model\SubOptions', - 'white_labeling_options' => '\Dropbox\Sign\Model\SubWhiteLabelingOptions', + 'white_labeling_options' => '\Dropbox\Sign\Model\SubWhiteLabelingOptions' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'callback_url' => null, 'custom_logo_file' => 'binary', @@ -81,14 +82,14 @@ class ApiAppUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializab 'name' => null, 'oauth' => null, 'options' => null, - 'white_labeling_options' => null, + 'white_labeling_options' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'callback_url' => false, 'custom_logo_file' => false, @@ -96,14 +97,14 @@ class ApiAppUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializab 'name' => false, 'oauth' => false, 'options' => false, - 'white_labeling_options' => false, + 'white_labeling_options' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -128,6 +129,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -137,7 +140,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -147,7 +150,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -156,6 +159,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -164,6 +170,9 @@ 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 { @@ -183,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'name', 'oauth' => 'oauth', 'options' => 'options', - 'white_labeling_options' => 'white_labeling_options', + 'white_labeling_options' => 'white_labeling_options' ]; /** @@ -198,7 +207,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'setName', 'oauth' => 'setOauth', 'options' => 'setOptions', - 'white_labeling_options' => 'setWhiteLabelingOptions', + 'white_labeling_options' => 'setWhiteLabelingOptions' ]; /** @@ -213,7 +222,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'getName', 'oauth' => 'getOauth', 'options' => 'getOptions', - 'white_labeling_options' => 'getWhiteLabelingOptions', + 'white_labeling_options' => 'getWhiteLabelingOptions' ]; /** @@ -257,6 +266,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -267,10 +277,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('callback_url', $data ?? [], null); $this->setIfExists('custom_logo_file', $data ?? [], null); @@ -281,33 +291,34 @@ public function __construct(array $data = null) $this->setIfExists('white_labeling_options', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): ApiAppUpdateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): ApiAppUpdateRequest { /** @var ApiAppUpdateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, ApiAppUpdateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -344,6 +355,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets callback_url * @@ -357,14 +369,14 @@ public function getCallbackUrl() /** * Sets callback_url * - * @param string|null $callback_url the URL at which the API App should receive event callbacks + * @param string|null $callback_url The URL at which the API App should receive event callbacks. * * @return self */ - public function setCallbackUrl(?string $callback_url) + public function setCallbackUrl($callback_url) { if (is_null($callback_url)) { - throw new InvalidArgumentException('non-nullable callback_url cannot be null'); + throw new \InvalidArgumentException('non-nullable callback_url cannot be null'); } $this->container['callback_url'] = $callback_url; @@ -374,7 +386,7 @@ public function setCallbackUrl(?string $callback_url) /** * Gets custom_logo_file * - * @return SplFileObject|null + * @return \SplFileObject|null */ public function getCustomLogoFile() { @@ -384,14 +396,14 @@ public function getCustomLogoFile() /** * Sets custom_logo_file * - * @param SplFileObject|null $custom_logo_file An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) + * @param \SplFileObject|null $custom_logo_file An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) * * @return self */ - public function setCustomLogoFile(?SplFileObject $custom_logo_file) + public function setCustomLogoFile($custom_logo_file) { if (is_null($custom_logo_file)) { - throw new InvalidArgumentException('non-nullable custom_logo_file cannot be null'); + throw new \InvalidArgumentException('non-nullable custom_logo_file cannot be null'); } $this->container['custom_logo_file'] = $custom_logo_file; @@ -411,18 +423,18 @@ public function getDomains() /** * Sets domains * - * @param string[]|null $domains the domain names the ApiApp will be associated with + * @param string[]|null $domains The domain names the ApiApp will be associated with. * * @return self */ - public function setDomains(?array $domains) + public function setDomains($domains) { if (is_null($domains)) { - throw new InvalidArgumentException('non-nullable domains cannot be null'); + throw new \InvalidArgumentException('non-nullable domains cannot be null'); } - if (count($domains) > 2) { - throw new InvalidArgumentException('invalid value for $domains when calling ApiAppUpdateRequest., number of items must be less than or equal to 2.'); + if ((count($domains) > 2)) { + throw new \InvalidArgumentException('invalid value for $domains when calling ApiAppUpdateRequest., number of items must be less than or equal to 2.'); } $this->container['domains'] = $domains; @@ -442,14 +454,14 @@ public function getName() /** * Sets name * - * @param string|null $name the name you want to assign to the ApiApp + * @param string|null $name The name you want to assign to the ApiApp. * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -473,10 +485,10 @@ public function getOauth() * * @return self */ - public function setOauth(?SubOAuth $oauth) + public function setOauth($oauth) { if (is_null($oauth)) { - throw new InvalidArgumentException('non-nullable oauth cannot be null'); + throw new \InvalidArgumentException('non-nullable oauth cannot be null'); } $this->container['oauth'] = $oauth; @@ -500,10 +512,10 @@ public function getOptions() * * @return self */ - public function setOptions(?SubOptions $options) + public function setOptions($options) { if (is_null($options)) { - throw new InvalidArgumentException('non-nullable options cannot be null'); + throw new \InvalidArgumentException('non-nullable options cannot be null'); } $this->container['options'] = $options; @@ -527,22 +539,23 @@ public function getWhiteLabelingOptions() * * @return self */ - public function setWhiteLabelingOptions(?SubWhiteLabelingOptions $white_labeling_options) + public function setWhiteLabelingOptions($white_labeling_options) { if (is_null($white_labeling_options)) { - throw new InvalidArgumentException('non-nullable white_labeling_options cannot be null'); + throw new \InvalidArgumentException('non-nullable white_labeling_options cannot be null'); } $this->container['white_labeling_options'] = $white_labeling_options; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -551,11 +564,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -566,8 +579,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -580,9 +595,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -590,12 +607,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -624,3 +641,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/BulkSendJobGetResponse.php b/sdks/php/src/Model/BulkSendJobGetResponse.php index 3d97f3fe5..e2b51d3dc 100644 --- a/sdks/php/src/Model/BulkSendJobGetResponse.php +++ b/sdks/php/src/Model/BulkSendJobGetResponse.php @@ -1,11 +1,14 @@ */ -class BulkSendJobGetResponse implements ModelInterface, ArrayAccess, JsonSerializable +class BulkSendJobGetResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'BulkSendJobGetResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'bulk_send_job' => '\Dropbox\Sign\Model\BulkSendJobResponse', 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', 'signature_requests' => '\Dropbox\Sign\Model\BulkSendJobGetResponseSignatureRequests[]', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'bulk_send_job' => null, 'list_info' => null, 'signature_requests' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'bulk_send_job' => false, 'list_info' => false, 'signature_requests' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -118,6 +120,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -127,7 +131,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -137,7 +141,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -146,6 +150,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -154,6 +161,9 @@ 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 { @@ -170,7 +180,7 @@ public function isNullableSetToNull(string $property): bool 'bulk_send_job' => 'bulk_send_job', 'list_info' => 'list_info', 'signature_requests' => 'signature_requests', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'bulk_send_job' => 'setBulkSendJob', 'list_info' => 'setListInfo', 'signature_requests' => 'setSignatureRequests', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -194,7 +204,7 @@ public function isNullableSetToNull(string $property): bool 'bulk_send_job' => 'getBulkSendJob', 'list_info' => 'getListInfo', 'signature_requests' => 'getSignatureRequests', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -238,6 +248,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -248,10 +259,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('bulk_send_job', $data ?? [], null); $this->setIfExists('list_info', $data ?? [], null); @@ -259,33 +270,34 @@ public function __construct(array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): BulkSendJobGetResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): BulkSendJobGetResponse { /** @var BulkSendJobGetResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, BulkSendJobGetResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -327,6 +339,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets bulk_send_job * @@ -344,10 +357,10 @@ public function getBulkSendJob() * * @return self */ - public function setBulkSendJob(BulkSendJobResponse $bulk_send_job) + public function setBulkSendJob($bulk_send_job) { if (is_null($bulk_send_job)) { - throw new InvalidArgumentException('non-nullable bulk_send_job cannot be null'); + throw new \InvalidArgumentException('non-nullable bulk_send_job cannot be null'); } $this->container['bulk_send_job'] = $bulk_send_job; @@ -371,10 +384,10 @@ public function getListInfo() * * @return self */ - public function setListInfo(ListInfoResponse $list_info) + public function setListInfo($list_info) { if (is_null($list_info)) { - throw new InvalidArgumentException('non-nullable list_info cannot be null'); + throw new \InvalidArgumentException('non-nullable list_info cannot be null'); } $this->container['list_info'] = $list_info; @@ -394,14 +407,14 @@ public function getSignatureRequests() /** * Sets signature_requests * - * @param BulkSendJobGetResponseSignatureRequests[] $signature_requests contains information about the Signature Requests sent in bulk + * @param BulkSendJobGetResponseSignatureRequests[] $signature_requests Contains information about the Signature Requests sent in bulk. * * @return self */ - public function setSignatureRequests(array $signature_requests) + public function setSignatureRequests($signature_requests) { if (is_null($signature_requests)) { - throw new InvalidArgumentException('non-nullable signature_requests cannot be null'); + throw new \InvalidArgumentException('non-nullable signature_requests cannot be null'); } $this->container['signature_requests'] = $signature_requests; @@ -421,26 +434,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -449,11 +463,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -464,8 +478,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -478,9 +494,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -488,12 +506,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -522,3 +540,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/BulkSendJobGetResponseSignatureRequests.php b/sdks/php/src/Model/BulkSendJobGetResponseSignatureRequests.php index 0781348c0..d0e45b31b 100644 --- a/sdks/php/src/Model/BulkSendJobGetResponseSignatureRequests.php +++ b/sdks/php/src/Model/BulkSendJobGetResponseSignatureRequests.php @@ -1,11 +1,14 @@ */ -class BulkSendJobGetResponseSignatureRequests implements ModelInterface, ArrayAccess, JsonSerializable +class BulkSendJobGetResponseSignatureRequests implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'BulkSendJobGetResponseSignatureRequests'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'test_mode' => 'bool', 'signature_request_id' => 'string', @@ -81,16 +83,16 @@ class BulkSendJobGetResponseSignatureRequests implements ModelInterface, ArrayAc 'attachments' => '\Dropbox\Sign\Model\SignatureRequestResponseAttachment[]', 'response_data' => '\Dropbox\Sign\Model\SignatureRequestResponseDataBase[]', 'signatures' => '\Dropbox\Sign\Model\SignatureRequestResponseSignatures[]', - 'bulk_send_job_id' => 'string', + 'bulk_send_job_id' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'test_mode' => null, 'signature_request_id' => null, @@ -116,14 +118,14 @@ class BulkSendJobGetResponseSignatureRequests implements ModelInterface, ArrayAc 'attachments' => null, 'response_data' => null, 'signatures' => null, - 'bulk_send_job_id' => null, + 'bulk_send_job_id' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'test_mode' => false, 'signature_request_id' => false, @@ -149,14 +151,14 @@ class BulkSendJobGetResponseSignatureRequests implements ModelInterface, ArrayAc 'attachments' => true, 'response_data' => true, 'signatures' => false, - 'bulk_send_job_id' => false, + 'bulk_send_job_id' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -181,6 +183,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -190,7 +194,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -200,7 +204,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -209,6 +213,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -217,6 +224,9 @@ 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 { @@ -254,7 +264,7 @@ public function isNullableSetToNull(string $property): bool 'attachments' => 'attachments', 'response_data' => 'response_data', 'signatures' => 'signatures', - 'bulk_send_job_id' => 'bulk_send_job_id', + 'bulk_send_job_id' => 'bulk_send_job_id' ]; /** @@ -287,7 +297,7 @@ public function isNullableSetToNull(string $property): bool 'attachments' => 'setAttachments', 'response_data' => 'setResponseData', 'signatures' => 'setSignatures', - 'bulk_send_job_id' => 'setBulkSendJobId', + 'bulk_send_job_id' => 'setBulkSendJobId' ]; /** @@ -320,7 +330,7 @@ public function isNullableSetToNull(string $property): bool 'attachments' => 'getAttachments', 'response_data' => 'getResponseData', 'signatures' => 'getSignatures', - 'bulk_send_job_id' => 'getBulkSendJobId', + 'bulk_send_job_id' => 'getBulkSendJobId' ]; /** @@ -364,6 +374,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -374,10 +385,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('test_mode', $data ?? [], false); $this->setIfExists('signature_request_id', $data ?? [], null); @@ -406,33 +417,34 @@ public function __construct(array $data = null) $this->setIfExists('bulk_send_job_id', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): BulkSendJobGetResponseSignatureRequests { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): BulkSendJobGetResponseSignatureRequests { /** @var BulkSendJobGetResponseSignatureRequests */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, BulkSendJobGetResponseSignatureRequests::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -449,7 +461,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -463,6 +477,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets test_mode * @@ -480,10 +495,10 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -503,14 +518,14 @@ public function getSignatureRequestId() /** * Sets signature_request_id * - * @param string|null $signature_request_id the id of the SignatureRequest + * @param string|null $signature_request_id The id of the SignatureRequest. * * @return self */ - public function setSignatureRequestId(?string $signature_request_id) + public function setSignatureRequestId($signature_request_id) { if (is_null($signature_request_id)) { - throw new InvalidArgumentException('non-nullable signature_request_id cannot be null'); + throw new \InvalidArgumentException('non-nullable signature_request_id cannot be null'); } $this->container['signature_request_id'] = $signature_request_id; @@ -530,17 +545,17 @@ public function getRequesterEmailAddress() /** * Sets requester_email_address * - * @param string|null $requester_email_address the email address of the initiator of the SignatureRequest + * @param string|null $requester_email_address The email address of the initiator of the SignatureRequest. * * @return self */ - public function setRequesterEmailAddress(?string $requester_email_address) + public function setRequesterEmailAddress($requester_email_address) { if (is_null($requester_email_address)) { array_push($this->openAPINullablesSetToNull, 'requester_email_address'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('requester_email_address', $nullablesSetToNull); + $index = array_search('requester_email_address', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -564,14 +579,14 @@ public function getTitle() /** * Sets title * - * @param string|null $title the title the specified Account uses for the SignatureRequest + * @param string|null $title The title the specified Account uses for the SignatureRequest. * * @return self */ - public function setTitle(?string $title) + public function setTitle($title) { if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); + throw new \InvalidArgumentException('non-nullable title cannot be null'); } $this->container['title'] = $title; @@ -591,14 +606,14 @@ public function getOriginalTitle() /** * Sets original_title * - * @param string|null $original_title default Label for account + * @param string|null $original_title Default Label for account. * * @return self */ - public function setOriginalTitle(?string $original_title) + public function setOriginalTitle($original_title) { if (is_null($original_title)) { - throw new InvalidArgumentException('non-nullable original_title cannot be null'); + throw new \InvalidArgumentException('non-nullable original_title cannot be null'); } $this->container['original_title'] = $original_title; @@ -618,17 +633,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject the subject in the email that was initially sent to the signers + * @param string|null $subject The subject in the email that was initially sent to the signers. * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { array_push($this->openAPINullablesSetToNull, 'subject'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('subject', $nullablesSetToNull); + $index = array_search('subject', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -652,17 +667,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message the custom message in the email that was initially sent to the signers + * @param string|null $message The custom message in the email that was initially sent to the signers. * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { array_push($this->openAPINullablesSetToNull, 'message'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('message', $nullablesSetToNull); + $index = array_search('message', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -686,14 +701,14 @@ public function getMetadata() /** * Sets metadata * - * @param array|null $metadata the metadata attached to the signature request + * @param array|null $metadata The metadata attached to the signature request. * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } $this->container['metadata'] = $metadata; @@ -713,14 +728,14 @@ public function getCreatedAt() /** * Sets created_at * - * @param int|null $created_at time the signature request was created + * @param int|null $created_at Time the signature request was created. * * @return self */ - public function setCreatedAt(?int $created_at) + public function setCreatedAt($created_at) { if (is_null($created_at)) { - throw new InvalidArgumentException('non-nullable created_at cannot be null'); + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } $this->container['created_at'] = $created_at; @@ -744,13 +759,13 @@ public function getExpiresAt() * * @return self */ - public function setExpiresAt(?int $expires_at) + 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); + $index = array_search('expires_at', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -774,14 +789,14 @@ public function getIsComplete() /** * Sets is_complete * - * @param bool|null $is_complete whether or not the SignatureRequest has been fully executed by all signers + * @param bool|null $is_complete Whether or not the SignatureRequest has been fully executed by all signers. * * @return self */ - public function setIsComplete(?bool $is_complete) + public function setIsComplete($is_complete) { if (is_null($is_complete)) { - throw new InvalidArgumentException('non-nullable is_complete cannot be null'); + throw new \InvalidArgumentException('non-nullable is_complete cannot be null'); } $this->container['is_complete'] = $is_complete; @@ -801,14 +816,14 @@ public function getIsDeclined() /** * Sets is_declined * - * @param bool|null $is_declined whether or not the SignatureRequest has been declined by a signer + * @param bool|null $is_declined Whether or not the SignatureRequest has been declined by a signer. * * @return self */ - public function setIsDeclined(?bool $is_declined) + public function setIsDeclined($is_declined) { if (is_null($is_declined)) { - throw new InvalidArgumentException('non-nullable is_declined cannot be null'); + throw new \InvalidArgumentException('non-nullable is_declined cannot be null'); } $this->container['is_declined'] = $is_declined; @@ -828,14 +843,14 @@ public function getHasError() /** * Sets has_error * - * @param bool|null $has_error whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings) + * @param bool|null $has_error Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). * * @return self */ - public function setHasError(?bool $has_error) + public function setHasError($has_error) { if (is_null($has_error)) { - throw new InvalidArgumentException('non-nullable has_error cannot be null'); + throw new \InvalidArgumentException('non-nullable has_error cannot be null'); } $this->container['has_error'] = $has_error; @@ -855,14 +870,14 @@ public function getFilesUrl() /** * Sets files_url * - * @param string|null $files_url the URL where a copy of the request's documents can be downloaded + * @param string|null $files_url The URL where a copy of the request's documents can be downloaded. * * @return self */ - public function setFilesUrl(?string $files_url) + public function setFilesUrl($files_url) { if (is_null($files_url)) { - throw new InvalidArgumentException('non-nullable files_url cannot be null'); + throw new \InvalidArgumentException('non-nullable files_url cannot be null'); } $this->container['files_url'] = $files_url; @@ -886,13 +901,13 @@ public function getSigningUrl() * * @return self */ - public function setSigningUrl(?string $signing_url) + public function setSigningUrl($signing_url) { if (is_null($signing_url)) { array_push($this->openAPINullablesSetToNull, 'signing_url'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signing_url', $nullablesSetToNull); + $index = array_search('signing_url', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -916,14 +931,14 @@ public function getDetailsUrl() /** * Sets details_url * - * @param string|null $details_url the URL where the requester and the signers can view the current status of the SignatureRequest + * @param string|null $details_url The URL where the requester and the signers can view the current status of the SignatureRequest. * * @return self */ - public function setDetailsUrl(?string $details_url) + public function setDetailsUrl($details_url) { if (is_null($details_url)) { - throw new InvalidArgumentException('non-nullable details_url cannot be null'); + throw new \InvalidArgumentException('non-nullable details_url cannot be null'); } $this->container['details_url'] = $details_url; @@ -947,10 +962,10 @@ public function getCcEmailAddresses() * * @return self */ - public function setCcEmailAddresses(?array $cc_email_addresses) + public function setCcEmailAddresses($cc_email_addresses) { if (is_null($cc_email_addresses)) { - throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + throw new \InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); } $this->container['cc_email_addresses'] = $cc_email_addresses; @@ -970,17 +985,17 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url the URL you want the signer redirected to after they successfully sign + * @param string|null $signing_redirect_url The URL you want the signer redirected to after they successfully sign. * * @return self */ - public function setSigningRedirectUrl(?string $signing_redirect_url) + public function setSigningRedirectUrl($signing_redirect_url) { if (is_null($signing_redirect_url)) { array_push($this->openAPINullablesSetToNull, 'signing_redirect_url'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signing_redirect_url', $nullablesSetToNull); + $index = array_search('signing_redirect_url', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1008,13 +1023,13 @@ public function getFinalCopyUri() * * @return self */ - public function setFinalCopyUri(?string $final_copy_uri) + public function setFinalCopyUri($final_copy_uri) { if (is_null($final_copy_uri)) { array_push($this->openAPINullablesSetToNull, 'final_copy_uri'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('final_copy_uri', $nullablesSetToNull); + $index = array_search('final_copy_uri', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1038,17 +1053,17 @@ public function getTemplateIds() /** * Sets template_ids * - * @param string[]|null $template_ids templates IDs used in this SignatureRequest (if any) + * @param string[]|null $template_ids Templates IDs used in this SignatureRequest (if any). * * @return self */ - public function setTemplateIds(?array $template_ids) + public function setTemplateIds($template_ids) { if (is_null($template_ids)) { array_push($this->openAPINullablesSetToNull, 'template_ids'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('template_ids', $nullablesSetToNull); + $index = array_search('template_ids', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1076,13 +1091,13 @@ public function getCustomFields() * * @return self */ - public function setCustomFields(?array $custom_fields) + public function setCustomFields($custom_fields) { if (is_null($custom_fields)) { array_push($this->openAPINullablesSetToNull, 'custom_fields'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('custom_fields', $nullablesSetToNull); + $index = array_search('custom_fields', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1106,17 +1121,17 @@ public function getAttachments() /** * Sets attachments * - * @param SignatureRequestResponseAttachment[]|null $attachments signer attachments + * @param SignatureRequestResponseAttachment[]|null $attachments Signer attachments. * * @return self */ - public function setAttachments(?array $attachments) + public function setAttachments($attachments) { if (is_null($attachments)) { array_push($this->openAPINullablesSetToNull, 'attachments'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('attachments', $nullablesSetToNull); + $index = array_search('attachments', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1140,17 +1155,17 @@ public function getResponseData() /** * Sets response_data * - * @param SignatureRequestResponseDataBase[]|null $response_data an array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers + * @param SignatureRequestResponseDataBase[]|null $response_data An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. * * @return self */ - public function setResponseData(?array $response_data) + public function setResponseData($response_data) { if (is_null($response_data)) { array_push($this->openAPINullablesSetToNull, 'response_data'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('response_data', $nullablesSetToNull); + $index = array_search('response_data', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1174,14 +1189,14 @@ public function getSignatures() /** * Sets signatures * - * @param SignatureRequestResponseSignatures[]|null $signatures an array of signature objects, 1 for each signer + * @param SignatureRequestResponseSignatures[]|null $signatures An array of signature objects, 1 for each signer. * * @return self */ - public function setSignatures(?array $signatures) + public function setSignatures($signatures) { if (is_null($signatures)) { - throw new InvalidArgumentException('non-nullable signatures cannot be null'); + throw new \InvalidArgumentException('non-nullable signatures cannot be null'); } $this->container['signatures'] = $signatures; @@ -1201,26 +1216,27 @@ public function getBulkSendJobId() /** * Sets bulk_send_job_id * - * @param string|null $bulk_send_job_id the id of the BulkSendJob + * @param string|null $bulk_send_job_id The id of the BulkSendJob. * * @return self */ - public function setBulkSendJobId(?string $bulk_send_job_id) + public function setBulkSendJobId($bulk_send_job_id) { if (is_null($bulk_send_job_id)) { - throw new InvalidArgumentException('non-nullable bulk_send_job_id cannot be null'); + throw new \InvalidArgumentException('non-nullable bulk_send_job_id cannot be null'); } $this->container['bulk_send_job_id'] = $bulk_send_job_id; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1229,11 +1245,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1244,8 +1260,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1258,9 +1276,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1268,12 +1288,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1302,3 +1322,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/BulkSendJobListResponse.php b/sdks/php/src/Model/BulkSendJobListResponse.php index 8420c469f..e4a655b36 100644 --- a/sdks/php/src/Model/BulkSendJobListResponse.php +++ b/sdks/php/src/Model/BulkSendJobListResponse.php @@ -1,11 +1,14 @@ */ -class BulkSendJobListResponse implements ModelInterface, ArrayAccess, JsonSerializable +class BulkSendJobListResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'BulkSendJobListResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'bulk_send_jobs' => '\Dropbox\Sign\Model\BulkSendJobResponse[]', 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'bulk_send_jobs' => null, 'list_info' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'bulk_send_jobs' => false, 'list_info' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'bulk_send_jobs' => 'bulk_send_jobs', 'list_info' => 'list_info', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'bulk_send_jobs' => 'setBulkSendJobs', 'list_info' => 'setListInfo', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'bulk_send_jobs' => 'getBulkSendJobs', 'list_info' => 'getListInfo', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -232,6 +242,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -242,43 +253,44 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('bulk_send_jobs', $data ?? [], null); $this->setIfExists('list_info', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): BulkSendJobListResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): BulkSendJobListResponse { /** @var BulkSendJobListResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, BulkSendJobListResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -317,6 +329,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets bulk_send_jobs * @@ -330,14 +343,14 @@ public function getBulkSendJobs() /** * Sets bulk_send_jobs * - * @param BulkSendJobResponse[] $bulk_send_jobs contains a list of BulkSendJobs that the API caller has access to + * @param BulkSendJobResponse[] $bulk_send_jobs Contains a list of BulkSendJobs that the API caller has access to. * * @return self */ - public function setBulkSendJobs(array $bulk_send_jobs) + public function setBulkSendJobs($bulk_send_jobs) { if (is_null($bulk_send_jobs)) { - throw new InvalidArgumentException('non-nullable bulk_send_jobs cannot be null'); + throw new \InvalidArgumentException('non-nullable bulk_send_jobs cannot be null'); } $this->container['bulk_send_jobs'] = $bulk_send_jobs; @@ -361,10 +374,10 @@ public function getListInfo() * * @return self */ - public function setListInfo(ListInfoResponse $list_info) + public function setListInfo($list_info) { if (is_null($list_info)) { - throw new InvalidArgumentException('non-nullable list_info cannot be null'); + throw new \InvalidArgumentException('non-nullable list_info cannot be null'); } $this->container['list_info'] = $list_info; @@ -384,26 +397,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -412,11 +426,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -427,8 +441,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -441,9 +457,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -451,12 +469,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -485,3 +503,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/BulkSendJobResponse.php b/sdks/php/src/Model/BulkSendJobResponse.php index fcd66e120..36e4ef304 100644 --- a/sdks/php/src/Model/BulkSendJobResponse.php +++ b/sdks/php/src/Model/BulkSendJobResponse.php @@ -1,11 +1,14 @@ */ -class BulkSendJobResponse implements ModelInterface, ArrayAccess, JsonSerializable +class BulkSendJobResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'BulkSendJobResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'bulk_send_job_id' => 'string', 'total' => 'int', 'is_creator' => 'bool', - 'created_at' => 'int', + 'created_at' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'bulk_send_job_id' => null, 'total' => null, 'is_creator' => null, - 'created_at' => null, + 'created_at' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'bulk_send_job_id' => true, 'total' => false, 'is_creator' => false, - 'created_at' => false, + 'created_at' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -119,6 +121,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -128,7 +132,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +142,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,6 +151,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -155,6 +162,9 @@ 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 { @@ -171,7 +181,7 @@ public function isNullableSetToNull(string $property): bool 'bulk_send_job_id' => 'bulk_send_job_id', 'total' => 'total', 'is_creator' => 'is_creator', - 'created_at' => 'created_at', + 'created_at' => 'created_at' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool 'bulk_send_job_id' => 'setBulkSendJobId', 'total' => 'setTotal', 'is_creator' => 'setIsCreator', - 'created_at' => 'setCreatedAt', + 'created_at' => 'setCreatedAt' ]; /** @@ -195,7 +205,7 @@ public function isNullableSetToNull(string $property): bool 'bulk_send_job_id' => 'getBulkSendJobId', 'total' => 'getTotal', 'is_creator' => 'getIsCreator', - 'created_at' => 'getCreatedAt', + 'created_at' => 'getCreatedAt' ]; /** @@ -239,6 +249,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -249,10 +260,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('bulk_send_job_id', $data ?? [], null); $this->setIfExists('total', $data ?? [], null); @@ -260,33 +271,34 @@ public function __construct(array $data = null) $this->setIfExists('created_at', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): BulkSendJobResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): BulkSendJobResponse { /** @var BulkSendJobResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, BulkSendJobResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -303,7 +315,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -317,6 +331,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets bulk_send_job_id * @@ -330,17 +345,17 @@ public function getBulkSendJobId() /** * Sets bulk_send_job_id * - * @param string|null $bulk_send_job_id the id of the BulkSendJob + * @param string|null $bulk_send_job_id The id of the BulkSendJob. * * @return self */ - public function setBulkSendJobId(?string $bulk_send_job_id) + public function setBulkSendJobId($bulk_send_job_id) { if (is_null($bulk_send_job_id)) { array_push($this->openAPINullablesSetToNull, 'bulk_send_job_id'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('bulk_send_job_id', $nullablesSetToNull); + $index = array_search('bulk_send_job_id', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -364,14 +379,14 @@ public function getTotal() /** * Sets total * - * @param int|null $total the total amount of Signature Requests queued for sending + * @param int|null $total The total amount of Signature Requests queued for sending. * * @return self */ - public function setTotal(?int $total) + public function setTotal($total) { if (is_null($total)) { - throw new InvalidArgumentException('non-nullable total cannot be null'); + throw new \InvalidArgumentException('non-nullable total cannot be null'); } $this->container['total'] = $total; @@ -391,14 +406,14 @@ public function getIsCreator() /** * Sets is_creator * - * @param bool|null $is_creator true if you are the owner of this BulkSendJob, false if it's been shared with you by a team member + * @param bool|null $is_creator True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. * * @return self */ - public function setIsCreator(?bool $is_creator) + public function setIsCreator($is_creator) { if (is_null($is_creator)) { - throw new InvalidArgumentException('non-nullable is_creator cannot be null'); + throw new \InvalidArgumentException('non-nullable is_creator cannot be null'); } $this->container['is_creator'] = $is_creator; @@ -418,26 +433,27 @@ public function getCreatedAt() /** * Sets created_at * - * @param int|null $created_at time that the BulkSendJob was created + * @param int|null $created_at Time that the BulkSendJob was created. * * @return self */ - public function setCreatedAt(?int $created_at) + public function setCreatedAt($created_at) { if (is_null($created_at)) { - throw new InvalidArgumentException('non-nullable created_at cannot be null'); + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } $this->container['created_at'] = $created_at; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -446,11 +462,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -461,8 +477,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -475,9 +493,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -485,12 +505,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -519,3 +539,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/BulkSendJobSendResponse.php b/sdks/php/src/Model/BulkSendJobSendResponse.php index 7797e84c7..a1a53f1e0 100644 --- a/sdks/php/src/Model/BulkSendJobSendResponse.php +++ b/sdks/php/src/Model/BulkSendJobSendResponse.php @@ -1,11 +1,14 @@ */ -class BulkSendJobSendResponse implements ModelInterface, ArrayAccess, JsonSerializable +class BulkSendJobSendResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'BulkSendJobSendResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'bulk_send_job' => '\Dropbox\Sign\Model\BulkSendJobResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'bulk_send_job' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'bulk_send_job' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'bulk_send_job' => 'bulk_send_job', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'bulk_send_job' => 'setBulkSendJob', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'bulk_send_job' => 'getBulkSendJob', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('bulk_send_job', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): BulkSendJobSendResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): BulkSendJobSendResponse { /** @var BulkSendJobSendResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, BulkSendJobSendResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,6 +319,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets bulk_send_job * @@ -324,10 +337,10 @@ public function getBulkSendJob() * * @return self */ - public function setBulkSendJob(BulkSendJobResponse $bulk_send_job) + public function setBulkSendJob($bulk_send_job) { if (is_null($bulk_send_job)) { - throw new InvalidArgumentException('non-nullable bulk_send_job cannot be null'); + throw new \InvalidArgumentException('non-nullable bulk_send_job cannot be null'); } $this->container['bulk_send_job'] = $bulk_send_job; @@ -347,26 +360,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -375,11 +389,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,8 +404,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -404,9 +420,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -414,12 +432,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -448,3 +466,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/EmbeddedEditUrlRequest.php b/sdks/php/src/Model/EmbeddedEditUrlRequest.php index b4992a4c8..bbb27b657 100644 --- a/sdks/php/src/Model/EmbeddedEditUrlRequest.php +++ b/sdks/php/src/Model/EmbeddedEditUrlRequest.php @@ -1,11 +1,14 @@ */ -class EmbeddedEditUrlRequest implements ModelInterface, ArrayAccess, JsonSerializable +class EmbeddedEditUrlRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EmbeddedEditUrlRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'allow_edit_ccs' => 'bool', 'cc_roles' => 'string[]', @@ -66,16 +68,16 @@ class EmbeddedEditUrlRequest implements ModelInterface, ArrayAccess, JsonSeriali 'preview_only' => 'bool', 'show_preview' => 'bool', 'show_progress_stepper' => 'bool', - 'test_mode' => 'bool', + 'test_mode' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'allow_edit_ccs' => null, 'cc_roles' => null, @@ -86,14 +88,14 @@ class EmbeddedEditUrlRequest implements ModelInterface, ArrayAccess, JsonSeriali 'preview_only' => null, 'show_preview' => null, 'show_progress_stepper' => null, - 'test_mode' => null, + 'test_mode' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'allow_edit_ccs' => false, 'cc_roles' => false, @@ -104,14 +106,14 @@ class EmbeddedEditUrlRequest implements ModelInterface, ArrayAccess, JsonSeriali 'preview_only' => false, 'show_preview' => false, 'show_progress_stepper' => false, - 'test_mode' => false, + 'test_mode' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -136,6 +138,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -145,7 +149,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -155,7 +159,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -164,6 +168,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -172,6 +179,9 @@ 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 { @@ -194,7 +204,7 @@ public function isNullableSetToNull(string $property): bool 'preview_only' => 'preview_only', 'show_preview' => 'show_preview', 'show_progress_stepper' => 'show_progress_stepper', - 'test_mode' => 'test_mode', + 'test_mode' => 'test_mode' ]; /** @@ -212,7 +222,7 @@ public function isNullableSetToNull(string $property): bool 'preview_only' => 'setPreviewOnly', 'show_preview' => 'setShowPreview', 'show_progress_stepper' => 'setShowProgressStepper', - 'test_mode' => 'setTestMode', + 'test_mode' => 'setTestMode' ]; /** @@ -230,7 +240,7 @@ public function isNullableSetToNull(string $property): bool 'preview_only' => 'getPreviewOnly', 'show_preview' => 'getShowPreview', 'show_progress_stepper' => 'getShowProgressStepper', - 'test_mode' => 'getTestMode', + 'test_mode' => 'getTestMode' ]; /** @@ -274,6 +284,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -284,10 +295,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('allow_edit_ccs', $data ?? [], false); $this->setIfExists('cc_roles', $data ?? [], null); @@ -301,33 +312,34 @@ public function __construct(array $data = null) $this->setIfExists('test_mode', $data ?? [], false); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): EmbeddedEditUrlRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): EmbeddedEditUrlRequest { /** @var EmbeddedEditUrlRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, EmbeddedEditUrlRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -344,7 +356,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -358,6 +372,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets allow_edit_ccs * @@ -371,14 +386,14 @@ public function getAllowEditCcs() /** * Sets allow_edit_ccs * - * @param bool|null $allow_edit_ccs this allows the requester to enable/disable to add or change CC roles when editing the template + * @param bool|null $allow_edit_ccs This allows the requester to enable/disable to add or change CC roles when editing the template. * * @return self */ - public function setAllowEditCcs(?bool $allow_edit_ccs) + public function setAllowEditCcs($allow_edit_ccs) { if (is_null($allow_edit_ccs)) { - throw new InvalidArgumentException('non-nullable allow_edit_ccs cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_edit_ccs cannot be null'); } $this->container['allow_edit_ccs'] = $allow_edit_ccs; @@ -402,10 +417,10 @@ public function getCcRoles() * * @return self */ - public function setCcRoles(?array $cc_roles) + public function setCcRoles($cc_roles) { if (is_null($cc_roles)) { - throw new InvalidArgumentException('non-nullable cc_roles cannot be null'); + throw new \InvalidArgumentException('non-nullable cc_roles cannot be null'); } $this->container['cc_roles'] = $cc_roles; @@ -429,10 +444,10 @@ public function getEditorOptions() * * @return self */ - public function setEditorOptions(?SubEditorOptions $editor_options) + public function setEditorOptions($editor_options) { if (is_null($editor_options)) { - throw new InvalidArgumentException('non-nullable editor_options cannot be null'); + throw new \InvalidArgumentException('non-nullable editor_options cannot be null'); } $this->container['editor_options'] = $editor_options; @@ -452,14 +467,14 @@ public function getForceSignerRoles() /** * Sets force_signer_roles * - * @param bool|null $force_signer_roles provide users the ability to review/edit the template signer roles + * @param bool|null $force_signer_roles Provide users the ability to review/edit the template signer roles. * * @return self */ - public function setForceSignerRoles(?bool $force_signer_roles) + public function setForceSignerRoles($force_signer_roles) { if (is_null($force_signer_roles)) { - throw new InvalidArgumentException('non-nullable force_signer_roles cannot be null'); + throw new \InvalidArgumentException('non-nullable force_signer_roles cannot be null'); } $this->container['force_signer_roles'] = $force_signer_roles; @@ -479,14 +494,14 @@ public function getForceSubjectMessage() /** * Sets force_subject_message * - * @param bool|null $force_subject_message provide users the ability to review/edit the template subject and message + * @param bool|null $force_subject_message Provide users the ability to review/edit the template subject and message. * * @return self */ - public function setForceSubjectMessage(?bool $force_subject_message) + public function setForceSubjectMessage($force_subject_message) { if (is_null($force_subject_message)) { - throw new InvalidArgumentException('non-nullable force_subject_message cannot be null'); + throw new \InvalidArgumentException('non-nullable force_subject_message cannot be null'); } $this->container['force_subject_message'] = $force_subject_message; @@ -510,10 +525,10 @@ public function getMergeFields() * * @return self */ - public function setMergeFields(?array $merge_fields) + public function setMergeFields($merge_fields) { if (is_null($merge_fields)) { - throw new InvalidArgumentException('non-nullable merge_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable merge_fields cannot be null'); } $this->container['merge_fields'] = $merge_fields; @@ -537,10 +552,10 @@ public function getPreviewOnly() * * @return self */ - public function setPreviewOnly(?bool $preview_only) + public function setPreviewOnly($preview_only) { if (is_null($preview_only)) { - throw new InvalidArgumentException('non-nullable preview_only cannot be null'); + throw new \InvalidArgumentException('non-nullable preview_only cannot be null'); } $this->container['preview_only'] = $preview_only; @@ -560,14 +575,14 @@ public function getShowPreview() /** * Sets show_preview * - * @param bool|null $show_preview this allows the requester to enable the editor/preview experience + * @param bool|null $show_preview This allows the requester to enable the editor/preview experience. * * @return self */ - public function setShowPreview(?bool $show_preview) + public function setShowPreview($show_preview) { if (is_null($show_preview)) { - throw new InvalidArgumentException('non-nullable show_preview cannot be null'); + throw new \InvalidArgumentException('non-nullable show_preview cannot be null'); } $this->container['show_preview'] = $show_preview; @@ -587,14 +602,14 @@ public function getShowProgressStepper() /** * Sets show_progress_stepper * - * @param bool|null $show_progress_stepper when only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden + * @param bool|null $show_progress_stepper When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * * @return self */ - public function setShowProgressStepper(?bool $show_progress_stepper) + public function setShowProgressStepper($show_progress_stepper) { if (is_null($show_progress_stepper)) { - throw new InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); + throw new \InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); } $this->container['show_progress_stepper'] = $show_progress_stepper; @@ -618,22 +633,23 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -642,11 +658,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -657,8 +673,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -671,9 +689,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -681,12 +701,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -715,3 +735,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/EmbeddedEditUrlResponse.php b/sdks/php/src/Model/EmbeddedEditUrlResponse.php index 88320ef63..cba27fa36 100644 --- a/sdks/php/src/Model/EmbeddedEditUrlResponse.php +++ b/sdks/php/src/Model/EmbeddedEditUrlResponse.php @@ -1,11 +1,14 @@ */ -class EmbeddedEditUrlResponse implements ModelInterface, ArrayAccess, JsonSerializable +class EmbeddedEditUrlResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EmbeddedEditUrlResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'embedded' => '\Dropbox\Sign\Model\EmbeddedEditUrlResponseEmbedded', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'embedded' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'embedded' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'embedded' => 'embedded', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'embedded' => 'setEmbedded', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'embedded' => 'getEmbedded', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('embedded', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): EmbeddedEditUrlResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): EmbeddedEditUrlResponse { /** @var EmbeddedEditUrlResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, EmbeddedEditUrlResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,6 +319,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets embedded * @@ -324,10 +337,10 @@ public function getEmbedded() * * @return self */ - public function setEmbedded(EmbeddedEditUrlResponseEmbedded $embedded) + public function setEmbedded($embedded) { if (is_null($embedded)) { - throw new InvalidArgumentException('non-nullable embedded cannot be null'); + throw new \InvalidArgumentException('non-nullable embedded cannot be null'); } $this->container['embedded'] = $embedded; @@ -347,26 +360,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -375,11 +389,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,8 +404,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -404,9 +420,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -414,12 +432,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -448,3 +466,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/EmbeddedEditUrlResponseEmbedded.php b/sdks/php/src/Model/EmbeddedEditUrlResponseEmbedded.php index 0ef35374f..036857d8e 100644 --- a/sdks/php/src/Model/EmbeddedEditUrlResponseEmbedded.php +++ b/sdks/php/src/Model/EmbeddedEditUrlResponseEmbedded.php @@ -1,11 +1,14 @@ */ -class EmbeddedEditUrlResponseEmbedded implements ModelInterface, ArrayAccess, JsonSerializable +class EmbeddedEditUrlResponseEmbedded implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EmbeddedEditUrlResponseEmbedded'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'edit_url' => 'string', - 'expires_at' => 'int', + 'expires_at' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'edit_url' => null, - 'expires_at' => null, + 'expires_at' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'edit_url' => false, - 'expires_at' => false, + 'expires_at' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,6 +115,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -122,7 +126,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +136,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,6 +145,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -149,6 +156,9 @@ 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 { @@ -163,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'edit_url' => 'edit_url', - 'expires_at' => 'expires_at', + 'expires_at' => 'expires_at' ]; /** @@ -173,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'edit_url' => 'setEditUrl', - 'expires_at' => 'setExpiresAt', + 'expires_at' => 'setExpiresAt' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'edit_url' => 'getEditUrl', - 'expires_at' => 'getExpiresAt', + 'expires_at' => 'getExpiresAt' ]; /** @@ -227,6 +237,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -237,42 +248,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('edit_url', $data ?? [], null); $this->setIfExists('expires_at', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): EmbeddedEditUrlResponseEmbedded { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): EmbeddedEditUrlResponseEmbedded { /** @var EmbeddedEditUrlResponseEmbedded */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, EmbeddedEditUrlResponseEmbedded::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -289,7 +301,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -303,6 +317,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets edit_url * @@ -316,14 +331,14 @@ public function getEditUrl() /** * Sets edit_url * - * @param string|null $edit_url a template url that can be opened in an iFrame + * @param string|null $edit_url A template url that can be opened in an iFrame. * * @return self */ - public function setEditUrl(?string $edit_url) + public function setEditUrl($edit_url) { if (is_null($edit_url)) { - throw new InvalidArgumentException('non-nullable edit_url cannot be null'); + throw new \InvalidArgumentException('non-nullable edit_url cannot be null'); } $this->container['edit_url'] = $edit_url; @@ -343,26 +358,27 @@ public function getExpiresAt() /** * Sets expires_at * - * @param int|null $expires_at the specific time that the the `edit_url` link expires, in epoch + * @param int|null $expires_at The specific time that the the `edit_url` link expires, in epoch. * * @return self */ - public function setExpiresAt(?int $expires_at) + public function setExpiresAt($expires_at) { if (is_null($expires_at)) { - throw new InvalidArgumentException('non-nullable expires_at cannot be null'); + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); } $this->container['expires_at'] = $expires_at; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -371,11 +387,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -386,8 +402,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -400,9 +418,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -410,12 +430,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -444,3 +464,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/EmbeddedSignUrlResponse.php b/sdks/php/src/Model/EmbeddedSignUrlResponse.php index 4f91647aa..d9d552cc1 100644 --- a/sdks/php/src/Model/EmbeddedSignUrlResponse.php +++ b/sdks/php/src/Model/EmbeddedSignUrlResponse.php @@ -1,11 +1,14 @@ */ -class EmbeddedSignUrlResponse implements ModelInterface, ArrayAccess, JsonSerializable +class EmbeddedSignUrlResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EmbeddedSignUrlResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'embedded' => '\Dropbox\Sign\Model\EmbeddedSignUrlResponseEmbedded', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'embedded' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'embedded' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'embedded' => 'embedded', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'embedded' => 'setEmbedded', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'embedded' => 'getEmbedded', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('embedded', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): EmbeddedSignUrlResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): EmbeddedSignUrlResponse { /** @var EmbeddedSignUrlResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, EmbeddedSignUrlResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,6 +319,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets embedded * @@ -324,10 +337,10 @@ public function getEmbedded() * * @return self */ - public function setEmbedded(EmbeddedSignUrlResponseEmbedded $embedded) + public function setEmbedded($embedded) { if (is_null($embedded)) { - throw new InvalidArgumentException('non-nullable embedded cannot be null'); + throw new \InvalidArgumentException('non-nullable embedded cannot be null'); } $this->container['embedded'] = $embedded; @@ -347,26 +360,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -375,11 +389,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,8 +404,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -404,9 +420,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -414,12 +432,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -448,3 +466,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/EmbeddedSignUrlResponseEmbedded.php b/sdks/php/src/Model/EmbeddedSignUrlResponseEmbedded.php index f8b6619ba..7e3514a84 100644 --- a/sdks/php/src/Model/EmbeddedSignUrlResponseEmbedded.php +++ b/sdks/php/src/Model/EmbeddedSignUrlResponseEmbedded.php @@ -1,11 +1,14 @@ */ -class EmbeddedSignUrlResponseEmbedded implements ModelInterface, ArrayAccess, JsonSerializable +class EmbeddedSignUrlResponseEmbedded implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EmbeddedSignUrlResponseEmbedded'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'sign_url' => 'string', - 'expires_at' => 'int', + 'expires_at' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'sign_url' => null, - 'expires_at' => null, + 'expires_at' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'sign_url' => false, - 'expires_at' => false, + 'expires_at' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,6 +115,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -122,7 +126,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +136,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,6 +145,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -149,6 +156,9 @@ 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 { @@ -163,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'sign_url' => 'sign_url', - 'expires_at' => 'expires_at', + 'expires_at' => 'expires_at' ]; /** @@ -173,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'sign_url' => 'setSignUrl', - 'expires_at' => 'setExpiresAt', + 'expires_at' => 'setExpiresAt' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'sign_url' => 'getSignUrl', - 'expires_at' => 'getExpiresAt', + 'expires_at' => 'getExpiresAt' ]; /** @@ -227,6 +237,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -237,42 +248,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('sign_url', $data ?? [], null); $this->setIfExists('expires_at', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): EmbeddedSignUrlResponseEmbedded { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): EmbeddedSignUrlResponseEmbedded { /** @var EmbeddedSignUrlResponseEmbedded */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, EmbeddedSignUrlResponseEmbedded::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -289,7 +301,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -303,6 +317,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets sign_url * @@ -316,14 +331,14 @@ public function getSignUrl() /** * Sets sign_url * - * @param string|null $sign_url a signature url that can be opened in an iFrame + * @param string|null $sign_url A signature url that can be opened in an iFrame. * * @return self */ - public function setSignUrl(?string $sign_url) + public function setSignUrl($sign_url) { if (is_null($sign_url)) { - throw new InvalidArgumentException('non-nullable sign_url cannot be null'); + throw new \InvalidArgumentException('non-nullable sign_url cannot be null'); } $this->container['sign_url'] = $sign_url; @@ -343,26 +358,27 @@ public function getExpiresAt() /** * Sets expires_at * - * @param int|null $expires_at the specific time that the the `sign_url` link expires, in epoch + * @param int|null $expires_at The specific time that the the `sign_url` link expires, in epoch. * * @return self */ - public function setExpiresAt(?int $expires_at) + public function setExpiresAt($expires_at) { if (is_null($expires_at)) { - throw new InvalidArgumentException('non-nullable expires_at cannot be null'); + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); } $this->container['expires_at'] = $expires_at; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -371,11 +387,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -386,8 +402,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -400,9 +418,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -410,12 +430,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -444,3 +464,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/ErrorResponse.php b/sdks/php/src/Model/ErrorResponse.php index 081ed78c0..c6aaa9919 100644 --- a/sdks/php/src/Model/ErrorResponse.php +++ b/sdks/php/src/Model/ErrorResponse.php @@ -1,11 +1,14 @@ */ -class ErrorResponse implements ModelInterface, ArrayAccess, JsonSerializable +class ErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ErrorResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'error' => '\Dropbox\Sign\Model\ErrorResponseError', + 'error' => '\Dropbox\Sign\Model\ErrorResponseError' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'error' => null, + 'error' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'error' => false, + 'error' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -109,6 +111,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -118,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -128,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -137,6 +141,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -145,6 +152,9 @@ 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 { @@ -158,7 +168,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'error' => 'error', + 'error' => 'error' ]; /** @@ -167,7 +177,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'error' => 'setError', + 'error' => 'setError' ]; /** @@ -176,7 +186,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'error' => 'getError', + 'error' => 'getError' ]; /** @@ -220,6 +230,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -230,41 +241,42 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('error', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): ErrorResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): ErrorResponse { /** @var ErrorResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, ErrorResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -300,6 +312,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets error * @@ -317,22 +330,23 @@ public function getError() * * @return self */ - public function setError(ErrorResponseError $error) + public function setError($error) { if (is_null($error)) { - throw new InvalidArgumentException('non-nullable error cannot be null'); + throw new \InvalidArgumentException('non-nullable error cannot be null'); } $this->container['error'] = $error; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -341,11 +355,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -356,8 +370,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -370,9 +386,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -380,12 +398,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -414,3 +432,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/ErrorResponseError.php b/sdks/php/src/Model/ErrorResponseError.php index 60981920d..3d9fbe577 100644 --- a/sdks/php/src/Model/ErrorResponseError.php +++ b/sdks/php/src/Model/ErrorResponseError.php @@ -1,11 +1,14 @@ */ -class ErrorResponseError implements ModelInterface, ArrayAccess, JsonSerializable +class ErrorResponseError implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ErrorResponseError'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'error_msg' => 'string', 'error_name' => 'string', - 'error_path' => 'string', + 'error_path' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'error_msg' => null, 'error_name' => null, - 'error_path' => null, + 'error_path' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'error_msg' => false, 'error_name' => false, - 'error_path' => false, + 'error_path' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -116,6 +118,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -125,7 +129,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +139,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,6 +148,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -152,6 +159,9 @@ 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 { @@ -167,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'error_msg' => 'error_msg', 'error_name' => 'error_name', - 'error_path' => 'error_path', + 'error_path' => 'error_path' ]; /** @@ -178,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'error_msg' => 'setErrorMsg', 'error_name' => 'setErrorName', - 'error_path' => 'setErrorPath', + 'error_path' => 'setErrorPath' ]; /** @@ -189,7 +199,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'error_msg' => 'getErrorMsg', 'error_name' => 'getErrorName', - 'error_path' => 'getErrorPath', + 'error_path' => 'getErrorPath' ]; /** @@ -233,6 +243,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -243,43 +254,44 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('error_msg', $data ?? [], null); $this->setIfExists('error_name', $data ?? [], null); $this->setIfExists('error_path', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): ErrorResponseError { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): ErrorResponseError { /** @var ErrorResponseError */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, ErrorResponseError::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -318,6 +330,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets error_msg * @@ -331,14 +344,14 @@ public function getErrorMsg() /** * Sets error_msg * - * @param string $error_msg message describing an error + * @param string $error_msg Message describing an error. * * @return self */ - public function setErrorMsg(string $error_msg) + public function setErrorMsg($error_msg) { if (is_null($error_msg)) { - throw new InvalidArgumentException('non-nullable error_msg cannot be null'); + throw new \InvalidArgumentException('non-nullable error_msg cannot be null'); } $this->container['error_msg'] = $error_msg; @@ -358,14 +371,14 @@ public function getErrorName() /** * Sets error_name * - * @param string $error_name name of the error + * @param string $error_name Name of the error. * * @return self */ - public function setErrorName(string $error_name) + public function setErrorName($error_name) { if (is_null($error_name)) { - throw new InvalidArgumentException('non-nullable error_name cannot be null'); + throw new \InvalidArgumentException('non-nullable error_name cannot be null'); } $this->container['error_name'] = $error_name; @@ -385,26 +398,27 @@ public function getErrorPath() /** * Sets error_path * - * @param string|null $error_path path at which an error occurred + * @param string|null $error_path Path at which an error occurred. * * @return self */ - public function setErrorPath(?string $error_path) + public function setErrorPath($error_path) { if (is_null($error_path)) { - throw new InvalidArgumentException('non-nullable error_path cannot be null'); + throw new \InvalidArgumentException('non-nullable error_path cannot be null'); } $this->container['error_path'] = $error_path; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -413,11 +427,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -428,8 +442,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -442,9 +458,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -452,12 +470,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -486,3 +504,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/EventCallbackRequest.php b/sdks/php/src/Model/EventCallbackRequest.php index 35c806b2d..1d572df2a 100644 --- a/sdks/php/src/Model/EventCallbackRequest.php +++ b/sdks/php/src/Model/EventCallbackRequest.php @@ -1,11 +1,14 @@ */ -class EventCallbackRequest implements ModelInterface, ArrayAccess, JsonSerializable +class EventCallbackRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EventCallbackRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'event' => '\Dropbox\Sign\Model\EventCallbackRequestEvent', 'account' => '\Dropbox\Sign\Model\AccountResponse', 'signature_request' => '\Dropbox\Sign\Model\SignatureRequestResponse', - 'template' => '\Dropbox\Sign\Model\TemplateResponse', + 'template' => '\Dropbox\Sign\Model\TemplateResponse' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'event' => null, 'account' => null, 'signature_request' => null, - 'template' => null, + 'template' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'event' => false, 'account' => false, 'signature_request' => false, - 'template' => false, + 'template' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -118,6 +120,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -127,7 +131,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -137,7 +141,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -146,6 +150,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -154,6 +161,9 @@ 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 { @@ -170,7 +180,7 @@ public function isNullableSetToNull(string $property): bool 'event' => 'event', 'account' => 'account', 'signature_request' => 'signature_request', - 'template' => 'template', + 'template' => 'template' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'event' => 'setEvent', 'account' => 'setAccount', 'signature_request' => 'setSignatureRequest', - 'template' => 'setTemplate', + 'template' => 'setTemplate' ]; /** @@ -194,7 +204,7 @@ public function isNullableSetToNull(string $property): bool 'event' => 'getEvent', 'account' => 'getAccount', 'signature_request' => 'getSignatureRequest', - 'template' => 'getTemplate', + 'template' => 'getTemplate' ]; /** @@ -238,6 +248,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -248,10 +259,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('event', $data ?? [], null); $this->setIfExists('account', $data ?? [], null); @@ -259,33 +270,34 @@ public function __construct(array $data = null) $this->setIfExists('template', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): EventCallbackRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): EventCallbackRequest { /** @var EventCallbackRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, EventCallbackRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -321,6 +333,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets event * @@ -338,10 +351,10 @@ public function getEvent() * * @return self */ - public function setEvent(EventCallbackRequestEvent $event) + public function setEvent($event) { if (is_null($event)) { - throw new InvalidArgumentException('non-nullable event cannot be null'); + throw new \InvalidArgumentException('non-nullable event cannot be null'); } $this->container['event'] = $event; @@ -365,10 +378,10 @@ public function getAccount() * * @return self */ - public function setAccount(?AccountResponse $account) + public function setAccount($account) { if (is_null($account)) { - throw new InvalidArgumentException('non-nullable account cannot be null'); + throw new \InvalidArgumentException('non-nullable account cannot be null'); } $this->container['account'] = $account; @@ -392,10 +405,10 @@ public function getSignatureRequest() * * @return self */ - public function setSignatureRequest(?SignatureRequestResponse $signature_request) + public function setSignatureRequest($signature_request) { if (is_null($signature_request)) { - throw new InvalidArgumentException('non-nullable signature_request cannot be null'); + throw new \InvalidArgumentException('non-nullable signature_request cannot be null'); } $this->container['signature_request'] = $signature_request; @@ -419,22 +432,23 @@ public function getTemplate() * * @return self */ - public function setTemplate(?TemplateResponse $template) + public function setTemplate($template) { if (is_null($template)) { - throw new InvalidArgumentException('non-nullable template cannot be null'); + throw new \InvalidArgumentException('non-nullable template cannot be null'); } $this->container['template'] = $template; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -443,11 +457,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -458,8 +472,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -472,9 +488,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -482,12 +500,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -516,3 +534,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/EventCallbackRequestEvent.php b/sdks/php/src/Model/EventCallbackRequestEvent.php index 36d99c767..7b896b7cf 100644 --- a/sdks/php/src/Model/EventCallbackRequestEvent.php +++ b/sdks/php/src/Model/EventCallbackRequestEvent.php @@ -1,11 +1,14 @@ */ -class EventCallbackRequestEvent implements ModelInterface, ArrayAccess, JsonSerializable +class EventCallbackRequestEvent implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EventCallbackRequestEvent'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'event_time' => 'string', 'event_type' => 'string', 'event_hash' => 'string', - 'event_metadata' => '\Dropbox\Sign\Model\EventCallbackRequestEventMetadata', + 'event_metadata' => '\Dropbox\Sign\Model\EventCallbackRequestEventMetadata' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'event_time' => null, 'event_type' => null, 'event_hash' => null, - 'event_metadata' => null, + 'event_metadata' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'event_time' => false, 'event_type' => false, 'event_hash' => false, - 'event_metadata' => false, + 'event_metadata' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -119,6 +121,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -128,7 +132,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +142,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,6 +151,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -155,6 +162,9 @@ 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 { @@ -171,7 +181,7 @@ public function isNullableSetToNull(string $property): bool 'event_time' => 'event_time', 'event_type' => 'event_type', 'event_hash' => 'event_hash', - 'event_metadata' => 'event_metadata', + 'event_metadata' => 'event_metadata' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool 'event_time' => 'setEventTime', 'event_type' => 'setEventType', 'event_hash' => 'setEventHash', - 'event_metadata' => 'setEventMetadata', + 'event_metadata' => 'setEventMetadata' ]; /** @@ -195,7 +205,7 @@ public function isNullableSetToNull(string $property): bool 'event_time' => 'getEventTime', 'event_type' => 'getEventType', 'event_hash' => 'getEventHash', - 'event_metadata' => 'getEventMetadata', + 'event_metadata' => 'getEventMetadata' ]; /** @@ -307,10 +317,10 @@ public function getEventTypeAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('event_time', $data ?? [], null); $this->setIfExists('event_type', $data ?? [], null); @@ -318,33 +328,34 @@ public function __construct(array $data = null) $this->setIfExists('event_metadata', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): EventCallbackRequestEvent { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): EventCallbackRequestEvent { /** @var EventCallbackRequestEvent */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, EventCallbackRequestEvent::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -395,6 +406,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets event_time * @@ -408,14 +420,14 @@ public function getEventTime() /** * Sets event_time * - * @param string $event_time time the event was created (using Unix time) + * @param string $event_time Time the event was created (using Unix time). * * @return self */ - public function setEventTime(string $event_time) + public function setEventTime($event_time) { if (is_null($event_time)) { - throw new InvalidArgumentException('non-nullable event_time cannot be null'); + throw new \InvalidArgumentException('non-nullable event_time cannot be null'); } $this->container['event_time'] = $event_time; @@ -435,18 +447,18 @@ public function getEventType() /** * Sets event_type * - * @param string $event_type type of callback event that was triggered + * @param string $event_type Type of callback event that was triggered. * * @return self */ - public function setEventType(string $event_type) + public function setEventType($event_type) { if (is_null($event_type)) { - throw new InvalidArgumentException('non-nullable event_type cannot be null'); + throw new \InvalidArgumentException('non-nullable event_type cannot be null'); } $allowedValues = $this->getEventTypeAllowableValues(); if (!in_array($event_type, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'event_type', must be one of '%s'", $event_type, @@ -472,14 +484,14 @@ public function getEventHash() /** * Sets event_hash * - * @param string $event_hash generated hash used to verify source of event data + * @param string $event_hash Generated hash used to verify source of event data. * * @return self */ - public function setEventHash(string $event_hash) + public function setEventHash($event_hash) { if (is_null($event_hash)) { - throw new InvalidArgumentException('non-nullable event_hash cannot be null'); + throw new \InvalidArgumentException('non-nullable event_hash cannot be null'); } $this->container['event_hash'] = $event_hash; @@ -503,22 +515,23 @@ public function getEventMetadata() * * @return self */ - public function setEventMetadata(?EventCallbackRequestEventMetadata $event_metadata) + public function setEventMetadata($event_metadata) { if (is_null($event_metadata)) { - throw new InvalidArgumentException('non-nullable event_metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable event_metadata cannot be null'); } $this->container['event_metadata'] = $event_metadata; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -527,11 +540,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -542,8 +555,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -556,9 +571,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -566,12 +583,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -600,3 +617,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/EventCallbackRequestEventMetadata.php b/sdks/php/src/Model/EventCallbackRequestEventMetadata.php index c0d665c8c..5ccd8ea85 100644 --- a/sdks/php/src/Model/EventCallbackRequestEventMetadata.php +++ b/sdks/php/src/Model/EventCallbackRequestEventMetadata.php @@ -1,11 +1,14 @@ */ -class EventCallbackRequestEventMetadata implements ModelInterface, ArrayAccess, JsonSerializable +class EventCallbackRequestEventMetadata implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EventCallbackRequestEventMetadata'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'related_signature_id' => 'string', 'reported_for_account_id' => 'string', 'reported_for_app_id' => 'string', - 'event_message' => 'string', + 'event_message' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'related_signature_id' => null, 'reported_for_account_id' => null, 'reported_for_app_id' => null, - 'event_message' => null, + 'event_message' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'related_signature_id' => true, 'reported_for_account_id' => true, 'reported_for_app_id' => true, - 'event_message' => true, + 'event_message' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -118,6 +121,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -127,7 +132,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -137,7 +142,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -146,6 +151,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -154,6 +162,9 @@ 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 { @@ -170,7 +181,7 @@ public function isNullableSetToNull(string $property): bool 'related_signature_id' => 'related_signature_id', 'reported_for_account_id' => 'reported_for_account_id', 'reported_for_app_id' => 'reported_for_app_id', - 'event_message' => 'event_message', + 'event_message' => 'event_message' ]; /** @@ -182,7 +193,7 @@ public function isNullableSetToNull(string $property): bool 'related_signature_id' => 'setRelatedSignatureId', 'reported_for_account_id' => 'setReportedForAccountId', 'reported_for_app_id' => 'setReportedForAppId', - 'event_message' => 'setEventMessage', + 'event_message' => 'setEventMessage' ]; /** @@ -194,7 +205,7 @@ public function isNullableSetToNull(string $property): bool 'related_signature_id' => 'getRelatedSignatureId', 'reported_for_account_id' => 'getReportedForAccountId', 'reported_for_app_id' => 'getReportedForAppId', - 'event_message' => 'getEventMessage', + 'event_message' => 'getEventMessage' ]; /** @@ -238,6 +249,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -248,10 +260,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('related_signature_id', $data ?? [], null); $this->setIfExists('reported_for_account_id', $data ?? [], null); @@ -259,33 +271,34 @@ public function __construct(array $data = null) $this->setIfExists('event_message', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): EventCallbackRequestEventMetadata { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): EventCallbackRequestEventMetadata { /** @var EventCallbackRequestEventMetadata */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, EventCallbackRequestEventMetadata::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -302,7 +315,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -316,6 +331,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets related_signature_id * @@ -333,13 +349,13 @@ public function getRelatedSignatureId() * * @return self */ - public function setRelatedSignatureId(?string $related_signature_id) + public function setRelatedSignatureId($related_signature_id) { if (is_null($related_signature_id)) { array_push($this->openAPINullablesSetToNull, 'related_signature_id'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('related_signature_id', $nullablesSetToNull); + $index = array_search('related_signature_id', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -363,17 +379,17 @@ public function getReportedForAccountId() /** * Sets reported_for_account_id * - * @param string|null $reported_for_account_id account ID the event was reported for + * @param string|null $reported_for_account_id Account ID the event was reported for. * * @return self */ - public function setReportedForAccountId(?string $reported_for_account_id) + public function setReportedForAccountId($reported_for_account_id) { if (is_null($reported_for_account_id)) { array_push($this->openAPINullablesSetToNull, 'reported_for_account_id'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('reported_for_account_id', $nullablesSetToNull); + $index = array_search('reported_for_account_id', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -397,17 +413,17 @@ public function getReportedForAppId() /** * Sets reported_for_app_id * - * @param string|null $reported_for_app_id app ID the event was reported for + * @param string|null $reported_for_app_id App ID the event was reported for. * * @return self */ - public function setReportedForAppId(?string $reported_for_app_id) + public function setReportedForAppId($reported_for_app_id) { if (is_null($reported_for_app_id)) { array_push($this->openAPINullablesSetToNull, 'reported_for_app_id'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('reported_for_app_id', $nullablesSetToNull); + $index = array_search('reported_for_app_id', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -431,17 +447,17 @@ public function getEventMessage() /** * Sets event_message * - * @param string|null $event_message message about a declined or failed (due to error) signature flow + * @param string|null $event_message Message about a declined or failed (due to error) signature flow. * * @return self */ - public function setEventMessage(?string $event_message) + public function setEventMessage($event_message) { if (is_null($event_message)) { array_push($this->openAPINullablesSetToNull, 'event_message'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('event_message', $nullablesSetToNull); + $index = array_search('event_message', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -451,13 +467,14 @@ public function setEventMessage(?string $event_message) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -466,11 +483,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -481,8 +498,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -495,9 +514,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -505,12 +526,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -539,3 +560,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/FaxGetResponse.php b/sdks/php/src/Model/FaxGetResponse.php index 232943492..a763081cd 100644 --- a/sdks/php/src/Model/FaxGetResponse.php +++ b/sdks/php/src/Model/FaxGetResponse.php @@ -1,11 +1,14 @@ */ -class FaxGetResponse implements ModelInterface, ArrayAccess, JsonSerializable +class FaxGetResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxGetResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'fax' => '\Dropbox\Sign\Model\FaxResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'fax' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'fax' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'fax' => 'fax', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'fax' => 'setFax', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'fax' => 'getFax', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('fax', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): FaxGetResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): FaxGetResponse { /** @var FaxGetResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, FaxGetResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,6 +319,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets fax * @@ -324,10 +337,10 @@ public function getFax() * * @return self */ - public function setFax(FaxResponse $fax) + public function setFax($fax) { if (is_null($fax)) { - throw new InvalidArgumentException('non-nullable fax cannot be null'); + throw new \InvalidArgumentException('non-nullable fax cannot be null'); } $this->container['fax'] = $fax; @@ -347,26 +360,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -375,11 +389,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,8 +404,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -404,9 +420,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -414,12 +432,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -448,3 +466,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/FaxLineAddUserRequest.php b/sdks/php/src/Model/FaxLineAddUserRequest.php index 837f4885d..cc238cbe2 100644 --- a/sdks/php/src/Model/FaxLineAddUserRequest.php +++ b/sdks/php/src/Model/FaxLineAddUserRequest.php @@ -1,11 +1,14 @@ */ -class FaxLineAddUserRequest implements ModelInterface, ArrayAccess, JsonSerializable +class FaxLineAddUserRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxLineAddUserRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'number' => 'string', 'account_id' => 'string', - 'email_address' => 'string', + 'email_address' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'number' => null, 'account_id' => null, - 'email_address' => 'email', + 'email_address' => 'email' ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'number' => false, 'account_id' => false, - 'email_address' => false, + 'email_address' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'number' => 'number', 'account_id' => 'account_id', - 'email_address' => 'email_address', + 'email_address' => 'email_address' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'number' => 'setNumber', 'account_id' => 'setAccountId', - 'email_address' => 'setEmailAddress', + 'email_address' => 'setEmailAddress' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'number' => 'getNumber', 'account_id' => 'getAccountId', - 'email_address' => 'getEmailAddress', + 'email_address' => 'getEmailAddress' ]; /** @@ -232,6 +242,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -242,43 +253,44 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('number', $data ?? [], null); $this->setIfExists('account_id', $data ?? [], null); $this->setIfExists('email_address', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): FaxLineAddUserRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): FaxLineAddUserRequest { /** @var FaxLineAddUserRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, FaxLineAddUserRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -314,6 +326,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets number * @@ -331,10 +344,10 @@ public function getNumber() * * @return self */ - public function setNumber(string $number) + public function setNumber($number) { if (is_null($number)) { - throw new InvalidArgumentException('non-nullable number cannot be null'); + throw new \InvalidArgumentException('non-nullable number cannot be null'); } $this->container['number'] = $number; @@ -358,10 +371,10 @@ public function getAccountId() * * @return self */ - public function setAccountId(?string $account_id) + public function setAccountId($account_id) { if (is_null($account_id)) { - throw new InvalidArgumentException('non-nullable account_id cannot be null'); + throw new \InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -385,22 +398,23 @@ public function getEmailAddress() * * @return self */ - public function setEmailAddress(?string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -409,11 +423,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -424,8 +438,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -438,9 +454,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -448,12 +466,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -482,3 +500,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/FaxLineAreaCodeGetCountryEnum.php b/sdks/php/src/Model/FaxLineAreaCodeGetCountryEnum.php index 1b96f68c7..e8ae6d6c2 100644 --- a/sdks/php/src/Model/FaxLineAreaCodeGetCountryEnum.php +++ b/sdks/php/src/Model/FaxLineAreaCodeGetCountryEnum.php @@ -1,11 +1,14 @@ */ -class FaxLineAreaCodeGetResponse implements ModelInterface, ArrayAccess, JsonSerializable +class FaxLineAreaCodeGetResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxLineAreaCodeGetResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'area_codes' => 'int[]', + 'area_codes' => 'int[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'area_codes' => null, + 'area_codes' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'area_codes' => false, + 'area_codes' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -109,6 +111,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -118,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -128,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -137,6 +141,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -145,6 +152,9 @@ 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 { @@ -158,7 +168,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'area_codes' => 'area_codes', + 'area_codes' => 'area_codes' ]; /** @@ -167,7 +177,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'area_codes' => 'setAreaCodes', + 'area_codes' => 'setAreaCodes' ]; /** @@ -176,7 +186,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'area_codes' => 'getAreaCodes', + 'area_codes' => 'getAreaCodes' ]; /** @@ -220,6 +230,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -230,41 +241,42 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('area_codes', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): FaxLineAreaCodeGetResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): FaxLineAreaCodeGetResponse { /** @var FaxLineAreaCodeGetResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, FaxLineAreaCodeGetResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -300,6 +312,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets area_codes * @@ -317,22 +330,23 @@ public function getAreaCodes() * * @return self */ - public function setAreaCodes(array $area_codes) + public function setAreaCodes($area_codes) { if (is_null($area_codes)) { - throw new InvalidArgumentException('non-nullable area_codes cannot be null'); + throw new \InvalidArgumentException('non-nullable area_codes cannot be null'); } $this->container['area_codes'] = $area_codes; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -341,11 +355,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -356,8 +370,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -370,9 +386,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -380,12 +398,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -414,3 +432,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/FaxLineAreaCodeGetStateEnum.php b/sdks/php/src/Model/FaxLineAreaCodeGetStateEnum.php index db4f35fd0..88768271f 100644 --- a/sdks/php/src/Model/FaxLineAreaCodeGetStateEnum.php +++ b/sdks/php/src/Model/FaxLineAreaCodeGetStateEnum.php @@ -1,11 +1,14 @@ */ -class FaxLineCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class FaxLineCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxLineCreateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'area_code' => 'int', 'country' => 'string', 'city' => 'string', - 'account_id' => 'string', + 'account_id' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'area_code' => null, 'country' => null, 'city' => null, - 'account_id' => null, + 'account_id' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'area_code' => false, 'country' => false, 'city' => false, - 'account_id' => false, + 'account_id' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -118,6 +120,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -127,7 +131,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -137,7 +141,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -146,6 +150,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -154,6 +161,9 @@ 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 { @@ -170,7 +180,7 @@ public function isNullableSetToNull(string $property): bool 'area_code' => 'area_code', 'country' => 'country', 'city' => 'city', - 'account_id' => 'account_id', + 'account_id' => 'account_id' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'area_code' => 'setAreaCode', 'country' => 'setCountry', 'city' => 'setCity', - 'account_id' => 'setAccountId', + 'account_id' => 'setAccountId' ]; /** @@ -194,7 +204,7 @@ public function isNullableSetToNull(string $property): bool 'area_code' => 'getAreaCode', 'country' => 'getCountry', 'city' => 'getCity', - 'account_id' => 'getAccountId', + 'account_id' => 'getAccountId' ]; /** @@ -266,10 +276,10 @@ public function getCountryAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('area_code', $data ?? [], null); $this->setIfExists('country', $data ?? [], null); @@ -277,33 +287,34 @@ public function __construct(array $data = null) $this->setIfExists('account_id', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): FaxLineCreateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): FaxLineCreateRequest { /** @var FaxLineCreateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, FaxLineCreateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -351,6 +362,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets area_code * @@ -368,10 +380,10 @@ public function getAreaCode() * * @return self */ - public function setAreaCode(int $area_code) + public function setAreaCode($area_code) { if (is_null($area_code)) { - throw new InvalidArgumentException('non-nullable area_code cannot be null'); + throw new \InvalidArgumentException('non-nullable area_code cannot be null'); } $this->container['area_code'] = $area_code; @@ -395,14 +407,14 @@ public function getCountry() * * @return self */ - public function setCountry(string $country) + public function setCountry($country) { if (is_null($country)) { - throw new InvalidArgumentException('non-nullable country cannot be null'); + throw new \InvalidArgumentException('non-nullable country cannot be null'); } $allowedValues = $this->getCountryAllowableValues(); if (!in_array($country, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'country', must be one of '%s'", $country, @@ -432,10 +444,10 @@ public function getCity() * * @return self */ - public function setCity(?string $city) + public function setCity($city) { if (is_null($city)) { - throw new InvalidArgumentException('non-nullable city cannot be null'); + throw new \InvalidArgumentException('non-nullable city cannot be null'); } $this->container['city'] = $city; @@ -459,22 +471,23 @@ public function getAccountId() * * @return self */ - public function setAccountId(?string $account_id) + public function setAccountId($account_id) { if (is_null($account_id)) { - throw new InvalidArgumentException('non-nullable account_id cannot be null'); + throw new \InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -483,11 +496,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -498,8 +511,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -512,9 +527,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -522,12 +539,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -556,3 +573,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/FaxLineDeleteRequest.php b/sdks/php/src/Model/FaxLineDeleteRequest.php index 9426ce2af..8c44c1156 100644 --- a/sdks/php/src/Model/FaxLineDeleteRequest.php +++ b/sdks/php/src/Model/FaxLineDeleteRequest.php @@ -1,11 +1,14 @@ */ -class FaxLineDeleteRequest implements ModelInterface, ArrayAccess, JsonSerializable +class FaxLineDeleteRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxLineDeleteRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'number' => 'string', + 'number' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'number' => null, + 'number' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'number' => false, + 'number' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -109,6 +111,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -118,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -128,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -137,6 +141,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -145,6 +152,9 @@ 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 { @@ -158,7 +168,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'number' => 'number', + 'number' => 'number' ]; /** @@ -167,7 +177,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'number' => 'setNumber', + 'number' => 'setNumber' ]; /** @@ -176,7 +186,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'number' => 'getNumber', + 'number' => 'getNumber' ]; /** @@ -220,6 +230,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -230,41 +241,42 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('number', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): FaxLineDeleteRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): FaxLineDeleteRequest { /** @var FaxLineDeleteRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, FaxLineDeleteRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -300,6 +312,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets number * @@ -317,22 +330,23 @@ public function getNumber() * * @return self */ - public function setNumber(string $number) + public function setNumber($number) { if (is_null($number)) { - throw new InvalidArgumentException('non-nullable number cannot be null'); + throw new \InvalidArgumentException('non-nullable number cannot be null'); } $this->container['number'] = $number; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -341,11 +355,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -356,8 +370,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -370,9 +386,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -380,12 +398,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -414,3 +432,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/FaxLineListResponse.php b/sdks/php/src/Model/FaxLineListResponse.php index 1b32ad49c..f8aaa4f89 100644 --- a/sdks/php/src/Model/FaxLineListResponse.php +++ b/sdks/php/src/Model/FaxLineListResponse.php @@ -1,11 +1,14 @@ */ -class FaxLineListResponse implements ModelInterface, ArrayAccess, JsonSerializable +class FaxLineListResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxLineListResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', 'fax_lines' => '\Dropbox\Sign\Model\FaxLineResponseFaxLine[]', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'list_info' => null, 'fax_lines' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'list_info' => false, 'fax_lines' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'list_info' => 'list_info', 'fax_lines' => 'fax_lines', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'list_info' => 'setListInfo', 'fax_lines' => 'setFaxLines', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'list_info' => 'getListInfo', 'fax_lines' => 'getFaxLines', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -232,6 +242,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -242,43 +253,44 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('list_info', $data ?? [], null); $this->setIfExists('fax_lines', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): FaxLineListResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): FaxLineListResponse { /** @var FaxLineListResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, FaxLineListResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -317,6 +329,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets list_info * @@ -334,10 +347,10 @@ public function getListInfo() * * @return self */ - public function setListInfo(ListInfoResponse $list_info) + public function setListInfo($list_info) { if (is_null($list_info)) { - throw new InvalidArgumentException('non-nullable list_info cannot be null'); + throw new \InvalidArgumentException('non-nullable list_info cannot be null'); } $this->container['list_info'] = $list_info; @@ -361,10 +374,10 @@ public function getFaxLines() * * @return self */ - public function setFaxLines(array $fax_lines) + public function setFaxLines($fax_lines) { if (is_null($fax_lines)) { - throw new InvalidArgumentException('non-nullable fax_lines cannot be null'); + throw new \InvalidArgumentException('non-nullable fax_lines cannot be null'); } $this->container['fax_lines'] = $fax_lines; @@ -388,22 +401,23 @@ public function getWarnings() * * @return self */ - public function setWarnings(?WarningResponse $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -412,11 +426,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -427,8 +441,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -441,9 +457,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -451,12 +469,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -485,3 +503,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/FaxLineRemoveUserRequest.php b/sdks/php/src/Model/FaxLineRemoveUserRequest.php index 560b147e7..5e9a5fbb2 100644 --- a/sdks/php/src/Model/FaxLineRemoveUserRequest.php +++ b/sdks/php/src/Model/FaxLineRemoveUserRequest.php @@ -1,11 +1,14 @@ */ -class FaxLineRemoveUserRequest implements ModelInterface, ArrayAccess, JsonSerializable +class FaxLineRemoveUserRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxLineRemoveUserRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'number' => 'string', 'account_id' => 'string', - 'email_address' => 'string', + 'email_address' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'number' => null, 'account_id' => null, - 'email_address' => 'email', + 'email_address' => 'email' ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'number' => false, 'account_id' => false, - 'email_address' => false, + 'email_address' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'number' => 'number', 'account_id' => 'account_id', - 'email_address' => 'email_address', + 'email_address' => 'email_address' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'number' => 'setNumber', 'account_id' => 'setAccountId', - 'email_address' => 'setEmailAddress', + 'email_address' => 'setEmailAddress' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'number' => 'getNumber', 'account_id' => 'getAccountId', - 'email_address' => 'getEmailAddress', + 'email_address' => 'getEmailAddress' ]; /** @@ -232,6 +242,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -242,43 +253,44 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('number', $data ?? [], null); $this->setIfExists('account_id', $data ?? [], null); $this->setIfExists('email_address', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): FaxLineRemoveUserRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): FaxLineRemoveUserRequest { /** @var FaxLineRemoveUserRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, FaxLineRemoveUserRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -314,6 +326,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets number * @@ -331,10 +344,10 @@ public function getNumber() * * @return self */ - public function setNumber(string $number) + public function setNumber($number) { if (is_null($number)) { - throw new InvalidArgumentException('non-nullable number cannot be null'); + throw new \InvalidArgumentException('non-nullable number cannot be null'); } $this->container['number'] = $number; @@ -358,10 +371,10 @@ public function getAccountId() * * @return self */ - public function setAccountId(?string $account_id) + public function setAccountId($account_id) { if (is_null($account_id)) { - throw new InvalidArgumentException('non-nullable account_id cannot be null'); + throw new \InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -385,22 +398,23 @@ public function getEmailAddress() * * @return self */ - public function setEmailAddress(?string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -409,11 +423,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -424,8 +438,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -438,9 +454,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -448,12 +466,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -482,3 +500,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/FaxLineResponse.php b/sdks/php/src/Model/FaxLineResponse.php index c30616f6c..d2dce3560 100644 --- a/sdks/php/src/Model/FaxLineResponse.php +++ b/sdks/php/src/Model/FaxLineResponse.php @@ -1,11 +1,14 @@ */ -class FaxLineResponse implements ModelInterface, ArrayAccess, JsonSerializable +class FaxLineResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxLineResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'fax_line' => '\Dropbox\Sign\Model\FaxLineResponseFaxLine', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'fax_line' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'fax_line' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'fax_line' => 'fax_line', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'fax_line' => 'setFaxLine', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'fax_line' => 'getFaxLine', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('fax_line', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): FaxLineResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): FaxLineResponse { /** @var FaxLineResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, FaxLineResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,6 +319,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets fax_line * @@ -324,10 +337,10 @@ public function getFaxLine() * * @return self */ - public function setFaxLine(FaxLineResponseFaxLine $fax_line) + public function setFaxLine($fax_line) { if (is_null($fax_line)) { - throw new InvalidArgumentException('non-nullable fax_line cannot be null'); + throw new \InvalidArgumentException('non-nullable fax_line cannot be null'); } $this->container['fax_line'] = $fax_line; @@ -351,22 +364,23 @@ public function getWarnings() * * @return self */ - public function setWarnings(?WarningResponse $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -375,11 +389,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,8 +404,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -404,9 +420,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -414,12 +432,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -448,3 +466,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/FaxLineResponseFaxLine.php b/sdks/php/src/Model/FaxLineResponseFaxLine.php index 4a3fe8fa7..a83ccd74c 100644 --- a/sdks/php/src/Model/FaxLineResponseFaxLine.php +++ b/sdks/php/src/Model/FaxLineResponseFaxLine.php @@ -1,11 +1,14 @@ */ -class FaxLineResponseFaxLine implements ModelInterface, ArrayAccess, JsonSerializable +class FaxLineResponseFaxLine implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxLineResponseFaxLine'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'number' => 'string', 'created_at' => 'int', 'updated_at' => 'int', - 'accounts' => '\Dropbox\Sign\Model\AccountResponse[]', + 'accounts' => '\Dropbox\Sign\Model\AccountResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'number' => null, 'created_at' => null, 'updated_at' => null, - 'accounts' => null, + 'accounts' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'number' => false, 'created_at' => false, 'updated_at' => false, - 'accounts' => false, + 'accounts' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -118,6 +120,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -127,7 +131,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -137,7 +141,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -146,6 +150,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -154,6 +161,9 @@ 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 { @@ -170,7 +180,7 @@ public function isNullableSetToNull(string $property): bool 'number' => 'number', 'created_at' => 'created_at', 'updated_at' => 'updated_at', - 'accounts' => 'accounts', + 'accounts' => 'accounts' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'number' => 'setNumber', 'created_at' => 'setCreatedAt', 'updated_at' => 'setUpdatedAt', - 'accounts' => 'setAccounts', + 'accounts' => 'setAccounts' ]; /** @@ -194,7 +204,7 @@ public function isNullableSetToNull(string $property): bool 'number' => 'getNumber', 'created_at' => 'getCreatedAt', 'updated_at' => 'getUpdatedAt', - 'accounts' => 'getAccounts', + 'accounts' => 'getAccounts' ]; /** @@ -238,6 +248,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -248,10 +259,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('number', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); @@ -259,33 +270,34 @@ public function __construct(array $data = null) $this->setIfExists('accounts', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): FaxLineResponseFaxLine { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): FaxLineResponseFaxLine { /** @var FaxLineResponseFaxLine */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, FaxLineResponseFaxLine::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -302,7 +314,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -316,6 +330,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets number * @@ -333,10 +348,10 @@ public function getNumber() * * @return self */ - public function setNumber(?string $number) + public function setNumber($number) { if (is_null($number)) { - throw new InvalidArgumentException('non-nullable number cannot be null'); + throw new \InvalidArgumentException('non-nullable number cannot be null'); } $this->container['number'] = $number; @@ -360,10 +375,10 @@ public function getCreatedAt() * * @return self */ - public function setCreatedAt(?int $created_at) + public function setCreatedAt($created_at) { if (is_null($created_at)) { - throw new InvalidArgumentException('non-nullable created_at cannot be null'); + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } $this->container['created_at'] = $created_at; @@ -387,10 +402,10 @@ public function getUpdatedAt() * * @return self */ - public function setUpdatedAt(?int $updated_at) + public function setUpdatedAt($updated_at) { if (is_null($updated_at)) { - throw new InvalidArgumentException('non-nullable updated_at cannot be null'); + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); } $this->container['updated_at'] = $updated_at; @@ -414,22 +429,23 @@ public function getAccounts() * * @return self */ - public function setAccounts(?array $accounts) + public function setAccounts($accounts) { if (is_null($accounts)) { - throw new InvalidArgumentException('non-nullable accounts cannot be null'); + throw new \InvalidArgumentException('non-nullable accounts cannot be null'); } $this->container['accounts'] = $accounts; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -438,11 +454,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -453,8 +469,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -467,9 +485,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -477,12 +497,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -511,3 +531,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/FaxListResponse.php b/sdks/php/src/Model/FaxListResponse.php index 21e89d342..77cbc79a1 100644 --- a/sdks/php/src/Model/FaxListResponse.php +++ b/sdks/php/src/Model/FaxListResponse.php @@ -1,11 +1,14 @@ */ -class FaxListResponse implements ModelInterface, ArrayAccess, JsonSerializable +class FaxListResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxListResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'faxes' => '\Dropbox\Sign\Model\FaxResponse[]', - 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', + 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'faxes' => null, - 'list_info' => null, + 'list_info' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'faxes' => false, - 'list_info' => false, + 'list_info' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'faxes' => 'faxes', - 'list_info' => 'list_info', + 'list_info' => 'list_info' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'faxes' => 'setFaxes', - 'list_info' => 'setListInfo', + 'list_info' => 'setListInfo' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'faxes' => 'getFaxes', - 'list_info' => 'getListInfo', + 'list_info' => 'getListInfo' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('faxes', $data ?? [], null); $this->setIfExists('list_info', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): FaxListResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): FaxListResponse { /** @var FaxListResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, FaxListResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -310,6 +322,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets faxes * @@ -327,10 +340,10 @@ public function getFaxes() * * @return self */ - public function setFaxes(array $faxes) + public function setFaxes($faxes) { if (is_null($faxes)) { - throw new InvalidArgumentException('non-nullable faxes cannot be null'); + throw new \InvalidArgumentException('non-nullable faxes cannot be null'); } $this->container['faxes'] = $faxes; @@ -354,22 +367,23 @@ public function getListInfo() * * @return self */ - public function setListInfo(ListInfoResponse $list_info) + public function setListInfo($list_info) { if (is_null($list_info)) { - throw new InvalidArgumentException('non-nullable list_info cannot be null'); + throw new \InvalidArgumentException('non-nullable list_info cannot be null'); } $this->container['list_info'] = $list_info; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -378,11 +392,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -393,8 +407,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -407,9 +423,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -417,12 +435,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -451,3 +469,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/FaxResponse.php b/sdks/php/src/Model/FaxResponse.php index 9471ccc8a..b262c70a7 100644 --- a/sdks/php/src/Model/FaxResponse.php +++ b/sdks/php/src/Model/FaxResponse.php @@ -1,11 +1,14 @@ */ -class FaxResponse implements ModelInterface, ArrayAccess, JsonSerializable +class FaxResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'fax_id' => 'string', 'title' => 'string', @@ -67,16 +69,16 @@ class FaxResponse implements ModelInterface, ArrayAccess, JsonSerializable 'transmissions' => '\Dropbox\Sign\Model\FaxResponseTransmission[]', 'subject' => 'string', 'message' => 'string', - 'final_copy_uri' => 'string', + 'final_copy_uri' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'fax_id' => null, 'title' => null, @@ -88,14 +90,14 @@ class FaxResponse implements ModelInterface, ArrayAccess, JsonSerializable 'transmissions' => null, 'subject' => null, 'message' => null, - 'final_copy_uri' => null, + 'final_copy_uri' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'fax_id' => false, 'title' => false, @@ -107,14 +109,14 @@ class FaxResponse implements ModelInterface, ArrayAccess, JsonSerializable 'transmissions' => false, 'subject' => true, 'message' => true, - 'final_copy_uri' => true, + 'final_copy_uri' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -139,6 +141,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -148,7 +152,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -158,7 +162,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -167,6 +171,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -175,6 +182,9 @@ 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 { @@ -198,7 +208,7 @@ public function isNullableSetToNull(string $property): bool 'transmissions' => 'transmissions', 'subject' => 'subject', 'message' => 'message', - 'final_copy_uri' => 'final_copy_uri', + 'final_copy_uri' => 'final_copy_uri' ]; /** @@ -217,7 +227,7 @@ public function isNullableSetToNull(string $property): bool 'transmissions' => 'setTransmissions', 'subject' => 'setSubject', 'message' => 'setMessage', - 'final_copy_uri' => 'setFinalCopyUri', + 'final_copy_uri' => 'setFinalCopyUri' ]; /** @@ -236,7 +246,7 @@ public function isNullableSetToNull(string $property): bool 'transmissions' => 'getTransmissions', 'subject' => 'getSubject', 'message' => 'getMessage', - 'final_copy_uri' => 'getFinalCopyUri', + 'final_copy_uri' => 'getFinalCopyUri' ]; /** @@ -280,6 +290,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -290,10 +301,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('fax_id', $data ?? [], null); $this->setIfExists('title', $data ?? [], null); @@ -308,33 +319,34 @@ public function __construct(array $data = null) $this->setIfExists('final_copy_uri', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): FaxResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): FaxResponse { /** @var FaxResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, FaxResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -391,6 +403,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets fax_id * @@ -408,10 +421,10 @@ public function getFaxId() * * @return self */ - public function setFaxId(string $fax_id) + public function setFaxId($fax_id) { if (is_null($fax_id)) { - throw new InvalidArgumentException('non-nullable fax_id cannot be null'); + throw new \InvalidArgumentException('non-nullable fax_id cannot be null'); } $this->container['fax_id'] = $fax_id; @@ -435,10 +448,10 @@ public function getTitle() * * @return self */ - public function setTitle(string $title) + public function setTitle($title) { if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); + throw new \InvalidArgumentException('non-nullable title cannot be null'); } $this->container['title'] = $title; @@ -462,10 +475,10 @@ public function getOriginalTitle() * * @return self */ - public function setOriginalTitle(string $original_title) + public function setOriginalTitle($original_title) { if (is_null($original_title)) { - throw new InvalidArgumentException('non-nullable original_title cannot be null'); + throw new \InvalidArgumentException('non-nullable original_title cannot be null'); } $this->container['original_title'] = $original_title; @@ -489,10 +502,10 @@ public function getMetadata() * * @return self */ - public function setMetadata(array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } $this->container['metadata'] = $metadata; @@ -516,10 +529,10 @@ public function getCreatedAt() * * @return self */ - public function setCreatedAt(int $created_at) + public function setCreatedAt($created_at) { if (is_null($created_at)) { - throw new InvalidArgumentException('non-nullable created_at cannot be null'); + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } $this->container['created_at'] = $created_at; @@ -543,10 +556,10 @@ public function getSender() * * @return self */ - public function setSender(string $sender) + public function setSender($sender) { if (is_null($sender)) { - throw new InvalidArgumentException('non-nullable sender cannot be null'); + throw new \InvalidArgumentException('non-nullable sender cannot be null'); } $this->container['sender'] = $sender; @@ -570,10 +583,10 @@ public function getFilesUrl() * * @return self */ - public function setFilesUrl(string $files_url) + public function setFilesUrl($files_url) { if (is_null($files_url)) { - throw new InvalidArgumentException('non-nullable files_url cannot be null'); + throw new \InvalidArgumentException('non-nullable files_url cannot be null'); } $this->container['files_url'] = $files_url; @@ -597,10 +610,10 @@ public function getTransmissions() * * @return self */ - public function setTransmissions(array $transmissions) + public function setTransmissions($transmissions) { if (is_null($transmissions)) { - throw new InvalidArgumentException('non-nullable transmissions cannot be null'); + throw new \InvalidArgumentException('non-nullable transmissions cannot be null'); } $this->container['transmissions'] = $transmissions; @@ -624,13 +637,13 @@ public function getSubject() * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { array_push($this->openAPINullablesSetToNull, 'subject'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('subject', $nullablesSetToNull); + $index = array_search('subject', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -658,13 +671,13 @@ public function getMessage() * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { array_push($this->openAPINullablesSetToNull, 'message'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('message', $nullablesSetToNull); + $index = array_search('message', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -692,13 +705,13 @@ public function getFinalCopyUri() * * @return self */ - public function setFinalCopyUri(?string $final_copy_uri) + public function setFinalCopyUri($final_copy_uri) { if (is_null($final_copy_uri)) { array_push($this->openAPINullablesSetToNull, 'final_copy_uri'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('final_copy_uri', $nullablesSetToNull); + $index = array_search('final_copy_uri', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -708,13 +721,14 @@ public function setFinalCopyUri(?string $final_copy_uri) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -723,11 +737,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -738,8 +752,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -752,9 +768,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -762,12 +780,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -796,3 +814,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/FaxResponseTransmission.php b/sdks/php/src/Model/FaxResponseTransmission.php index 8c30b8ad5..f4196408f 100644 --- a/sdks/php/src/Model/FaxResponseTransmission.php +++ b/sdks/php/src/Model/FaxResponseTransmission.php @@ -1,11 +1,14 @@ */ -class FaxResponseTransmission implements ModelInterface, ArrayAccess, JsonSerializable +class FaxResponseTransmission implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxResponseTransmission'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'recipient' => 'string', 'status_code' => 'string', - 'sent_at' => 'int', + 'sent_at' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'recipient' => null, 'status_code' => null, - 'sent_at' => null, + 'sent_at' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'recipient' => false, 'status_code' => false, - 'sent_at' => false, + 'sent_at' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'recipient' => 'recipient', 'status_code' => 'status_code', - 'sent_at' => 'sent_at', + 'sent_at' => 'sent_at' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'recipient' => 'setRecipient', 'status_code' => 'setStatusCode', - 'sent_at' => 'setSentAt', + 'sent_at' => 'setSentAt' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'recipient' => 'getRecipient', 'status_code' => 'getStatusCode', - 'sent_at' => 'getSentAt', + 'sent_at' => 'getSentAt' ]; /** @@ -270,43 +280,44 @@ public function getStatusCodeAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('recipient', $data ?? [], null); $this->setIfExists('status_code', $data ?? [], null); $this->setIfExists('sent_at', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): FaxResponseTransmission { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): FaxResponseTransmission { /** @var FaxResponseTransmission */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, FaxResponseTransmission::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -354,6 +365,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets recipient * @@ -371,10 +383,10 @@ public function getRecipient() * * @return self */ - public function setRecipient(string $recipient) + public function setRecipient($recipient) { if (is_null($recipient)) { - throw new InvalidArgumentException('non-nullable recipient cannot be null'); + throw new \InvalidArgumentException('non-nullable recipient cannot be null'); } $this->container['recipient'] = $recipient; @@ -398,14 +410,14 @@ public function getStatusCode() * * @return self */ - public function setStatusCode(string $status_code) + public function setStatusCode($status_code) { if (is_null($status_code)) { - throw new InvalidArgumentException('non-nullable status_code cannot be null'); + throw new \InvalidArgumentException('non-nullable status_code cannot be null'); } $allowedValues = $this->getStatusCodeAllowableValues(); if (!in_array($status_code, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'status_code', must be one of '%s'", $status_code, @@ -435,22 +447,23 @@ public function getSentAt() * * @return self */ - public function setSentAt(?int $sent_at) + public function setSentAt($sent_at) { if (is_null($sent_at)) { - throw new InvalidArgumentException('non-nullable sent_at cannot be null'); + throw new \InvalidArgumentException('non-nullable sent_at cannot be null'); } $this->container['sent_at'] = $sent_at; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -459,11 +472,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -474,8 +487,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -488,9 +503,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -498,12 +515,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -532,3 +549,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/FaxSendRequest.php b/sdks/php/src/Model/FaxSendRequest.php index 6124050b3..bf99eed0c 100644 --- a/sdks/php/src/Model/FaxSendRequest.php +++ b/sdks/php/src/Model/FaxSendRequest.php @@ -1,11 +1,14 @@ */ -class FaxSendRequest implements ModelInterface, ArrayAccess, JsonSerializable +class FaxSendRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxSendRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'recipient' => 'string', 'sender' => 'string', @@ -66,16 +67,16 @@ class FaxSendRequest implements ModelInterface, ArrayAccess, JsonSerializable 'cover_page_to' => 'string', 'cover_page_from' => 'string', 'cover_page_message' => 'string', - 'title' => 'string', + 'title' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'recipient' => null, 'sender' => null, @@ -85,14 +86,14 @@ class FaxSendRequest implements ModelInterface, ArrayAccess, JsonSerializable 'cover_page_to' => null, 'cover_page_from' => null, 'cover_page_message' => null, - 'title' => null, + 'title' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'recipient' => false, 'sender' => false, @@ -102,14 +103,14 @@ class FaxSendRequest implements ModelInterface, ArrayAccess, JsonSerializable 'cover_page_to' => false, 'cover_page_from' => false, 'cover_page_message' => false, - 'title' => false, + 'title' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -134,6 +135,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -143,7 +146,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -153,7 +156,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -162,6 +165,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -170,6 +176,9 @@ 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 { @@ -191,7 +200,7 @@ public function isNullableSetToNull(string $property): bool 'cover_page_to' => 'cover_page_to', 'cover_page_from' => 'cover_page_from', 'cover_page_message' => 'cover_page_message', - 'title' => 'title', + 'title' => 'title' ]; /** @@ -208,7 +217,7 @@ public function isNullableSetToNull(string $property): bool 'cover_page_to' => 'setCoverPageTo', 'cover_page_from' => 'setCoverPageFrom', 'cover_page_message' => 'setCoverPageMessage', - 'title' => 'setTitle', + 'title' => 'setTitle' ]; /** @@ -225,7 +234,7 @@ public function isNullableSetToNull(string $property): bool 'cover_page_to' => 'getCoverPageTo', 'cover_page_from' => 'getCoverPageFrom', 'cover_page_message' => 'getCoverPageMessage', - 'title' => 'getTitle', + 'title' => 'getTitle' ]; /** @@ -269,6 +278,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -279,10 +289,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('recipient', $data ?? [], null); $this->setIfExists('sender', $data ?? [], null); @@ -295,33 +305,34 @@ public function __construct(array $data = null) $this->setIfExists('title', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): FaxSendRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): FaxSendRequest { /** @var FaxSendRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, FaxSendRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -357,6 +368,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets recipient * @@ -374,10 +386,10 @@ public function getRecipient() * * @return self */ - public function setRecipient(string $recipient) + public function setRecipient($recipient) { if (is_null($recipient)) { - throw new InvalidArgumentException('non-nullable recipient cannot be null'); + throw new \InvalidArgumentException('non-nullable recipient cannot be null'); } $this->container['recipient'] = $recipient; @@ -401,10 +413,10 @@ public function getSender() * * @return self */ - public function setSender(?string $sender) + public function setSender($sender) { if (is_null($sender)) { - throw new InvalidArgumentException('non-nullable sender cannot be null'); + throw new \InvalidArgumentException('non-nullable sender cannot be null'); } $this->container['sender'] = $sender; @@ -414,7 +426,7 @@ public function setSender(?string $sender) /** * Gets files * - * @return SplFileObject[]|null + * @return \SplFileObject[]|null */ public function getFiles() { @@ -424,14 +436,14 @@ public function getFiles() /** * Sets files * - * @param SplFileObject[]|null $files use `files[]` to indicate the uploaded file(s) to fax This endpoint requires either **files** or **file_urls[]**, but not both + * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to fax This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles(?array $files) + public function setFiles($files) { if (is_null($files)) { - throw new InvalidArgumentException('non-nullable files cannot be null'); + throw new \InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -451,14 +463,14 @@ public function getFileUrls() /** * Sets file_urls * - * @param string[]|null $file_urls use `file_urls[]` to have Dropbox Fax download the file(s) to fax This endpoint requires either **files** or **file_urls[]**, but not both + * @param string[]|null $file_urls Use `file_urls[]` to have Dropbox Fax download the file(s) to fax This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFileUrls(?array $file_urls) + public function setFileUrls($file_urls) { if (is_null($file_urls)) { - throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -482,10 +494,10 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -509,10 +521,10 @@ public function getCoverPageTo() * * @return self */ - public function setCoverPageTo(?string $cover_page_to) + public function setCoverPageTo($cover_page_to) { if (is_null($cover_page_to)) { - throw new InvalidArgumentException('non-nullable cover_page_to cannot be null'); + throw new \InvalidArgumentException('non-nullable cover_page_to cannot be null'); } $this->container['cover_page_to'] = $cover_page_to; @@ -536,10 +548,10 @@ public function getCoverPageFrom() * * @return self */ - public function setCoverPageFrom(?string $cover_page_from) + public function setCoverPageFrom($cover_page_from) { if (is_null($cover_page_from)) { - throw new InvalidArgumentException('non-nullable cover_page_from cannot be null'); + throw new \InvalidArgumentException('non-nullable cover_page_from cannot be null'); } $this->container['cover_page_from'] = $cover_page_from; @@ -563,10 +575,10 @@ public function getCoverPageMessage() * * @return self */ - public function setCoverPageMessage(?string $cover_page_message) + public function setCoverPageMessage($cover_page_message) { if (is_null($cover_page_message)) { - throw new InvalidArgumentException('non-nullable cover_page_message cannot be null'); + throw new \InvalidArgumentException('non-nullable cover_page_message cannot be null'); } $this->container['cover_page_message'] = $cover_page_message; @@ -590,22 +602,23 @@ public function getTitle() * * @return self */ - public function setTitle(?string $title) + public function setTitle($title) { if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); + throw new \InvalidArgumentException('non-nullable title cannot be null'); } $this->container['title'] = $title; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -614,11 +627,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -629,8 +642,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -643,9 +658,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -653,12 +670,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -687,3 +704,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/FileResponse.php b/sdks/php/src/Model/FileResponse.php index 3ebdc3378..df7fc7185 100644 --- a/sdks/php/src/Model/FileResponse.php +++ b/sdks/php/src/Model/FileResponse.php @@ -1,11 +1,14 @@ */ -class FileResponse implements ModelInterface, ArrayAccess, JsonSerializable +class FileResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FileResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'file_url' => 'string', - 'expires_at' => 'int', + 'expires_at' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'file_url' => null, - 'expires_at' => null, + 'expires_at' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'file_url' => false, - 'expires_at' => false, + 'expires_at' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'file_url' => 'file_url', - 'expires_at' => 'expires_at', + 'expires_at' => 'expires_at' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'file_url' => 'setFileUrl', - 'expires_at' => 'setExpiresAt', + 'expires_at' => 'setExpiresAt' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'file_url' => 'getFileUrl', - 'expires_at' => 'getExpiresAt', + 'expires_at' => 'getExpiresAt' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('file_url', $data ?? [], null); $this->setIfExists('expires_at', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): FileResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): FileResponse { /** @var FileResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, FileResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -310,6 +322,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets file_url * @@ -323,14 +336,14 @@ public function getFileUrl() /** * Sets file_url * - * @param string $file_url URL to the file + * @param string $file_url URL to the file. * * @return self */ - public function setFileUrl(string $file_url) + public function setFileUrl($file_url) { if (is_null($file_url)) { - throw new InvalidArgumentException('non-nullable file_url cannot be null'); + throw new \InvalidArgumentException('non-nullable file_url cannot be null'); } $this->container['file_url'] = $file_url; @@ -350,26 +363,27 @@ public function getExpiresAt() /** * Sets expires_at * - * @param int $expires_at when the link expires + * @param int $expires_at When the link expires. * * @return self */ - public function setExpiresAt(int $expires_at) + public function setExpiresAt($expires_at) { if (is_null($expires_at)) { - throw new InvalidArgumentException('non-nullable expires_at cannot be null'); + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); } $this->container['expires_at'] = $expires_at; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -378,11 +392,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -393,8 +407,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -407,9 +423,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -417,12 +435,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -451,3 +469,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/FileResponseDataUri.php b/sdks/php/src/Model/FileResponseDataUri.php index 474e8a73d..8164ba6fe 100644 --- a/sdks/php/src/Model/FileResponseDataUri.php +++ b/sdks/php/src/Model/FileResponseDataUri.php @@ -1,11 +1,14 @@ */ -class FileResponseDataUri implements ModelInterface, ArrayAccess, JsonSerializable +class FileResponseDataUri implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FileResponseDataUri'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'data_uri' => 'string', + 'data_uri' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'data_uri' => null, + 'data_uri' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'data_uri' => false, + 'data_uri' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -109,6 +111,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -118,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -128,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -137,6 +141,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -145,6 +152,9 @@ 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 { @@ -158,7 +168,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'data_uri' => 'data_uri', + 'data_uri' => 'data_uri' ]; /** @@ -167,7 +177,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'data_uri' => 'setDataUri', + 'data_uri' => 'setDataUri' ]; /** @@ -176,7 +186,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'data_uri' => 'getDataUri', + 'data_uri' => 'getDataUri' ]; /** @@ -220,6 +230,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -230,41 +241,42 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('data_uri', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): FileResponseDataUri { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): FileResponseDataUri { /** @var FileResponseDataUri */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, FileResponseDataUri::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -300,6 +312,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets data_uri * @@ -313,26 +326,27 @@ public function getDataUri() /** * Sets data_uri * - * @param string $data_uri file as base64 encoded string + * @param string $data_uri File as base64 encoded string. * * @return self */ - public function setDataUri(string $data_uri) + public function setDataUri($data_uri) { if (is_null($data_uri)) { - throw new InvalidArgumentException('non-nullable data_uri cannot be null'); + throw new \InvalidArgumentException('non-nullable data_uri cannot be null'); } $this->container['data_uri'] = $data_uri; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -341,11 +355,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -356,8 +370,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -370,9 +386,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -380,12 +398,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -414,3 +432,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/ListInfoResponse.php b/sdks/php/src/Model/ListInfoResponse.php index 623284e41..4f5deecc3 100644 --- a/sdks/php/src/Model/ListInfoResponse.php +++ b/sdks/php/src/Model/ListInfoResponse.php @@ -1,11 +1,14 @@ */ -class ListInfoResponse implements ModelInterface, ArrayAccess, JsonSerializable +class ListInfoResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListInfoResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'num_pages' => 'int', 'num_results' => 'int', 'page' => 'int', - 'page_size' => 'int', + 'page_size' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'num_pages' => null, 'num_results' => null, 'page' => null, - 'page_size' => null, + 'page_size' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'num_pages' => false, 'num_results' => true, 'page' => false, - 'page_size' => false, + 'page_size' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -119,6 +121,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -128,7 +132,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +142,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,6 +151,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -155,6 +162,9 @@ 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 { @@ -171,7 +181,7 @@ public function isNullableSetToNull(string $property): bool 'num_pages' => 'num_pages', 'num_results' => 'num_results', 'page' => 'page', - 'page_size' => 'page_size', + 'page_size' => 'page_size' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool 'num_pages' => 'setNumPages', 'num_results' => 'setNumResults', 'page' => 'setPage', - 'page_size' => 'setPageSize', + 'page_size' => 'setPageSize' ]; /** @@ -195,7 +205,7 @@ public function isNullableSetToNull(string $property): bool 'num_pages' => 'getNumPages', 'num_results' => 'getNumResults', 'page' => 'getPage', - 'page_size' => 'getPageSize', + 'page_size' => 'getPageSize' ]; /** @@ -239,6 +249,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -249,10 +260,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('num_pages', $data ?? [], null); $this->setIfExists('num_results', $data ?? [], null); @@ -260,33 +271,34 @@ public function __construct(array $data = null) $this->setIfExists('page_size', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): ListInfoResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): ListInfoResponse { /** @var ListInfoResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, ListInfoResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -303,7 +315,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -317,6 +331,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets num_pages * @@ -330,14 +345,14 @@ public function getNumPages() /** * Sets num_pages * - * @param int|null $num_pages total number of pages available + * @param int|null $num_pages Total number of pages available. * * @return self */ - public function setNumPages(?int $num_pages) + public function setNumPages($num_pages) { if (is_null($num_pages)) { - throw new InvalidArgumentException('non-nullable num_pages cannot be null'); + throw new \InvalidArgumentException('non-nullable num_pages cannot be null'); } $this->container['num_pages'] = $num_pages; @@ -357,17 +372,17 @@ public function getNumResults() /** * Sets num_results * - * @param int|null $num_results total number of objects available + * @param int|null $num_results Total number of objects available. * * @return self */ - public function setNumResults(?int $num_results) + public function setNumResults($num_results) { if (is_null($num_results)) { array_push($this->openAPINullablesSetToNull, 'num_results'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('num_results', $nullablesSetToNull); + $index = array_search('num_results', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -391,14 +406,14 @@ public function getPage() /** * Sets page * - * @param int|null $page number of the page being returned + * @param int|null $page Number of the page being returned. * * @return self */ - public function setPage(?int $page) + public function setPage($page) { if (is_null($page)) { - throw new InvalidArgumentException('non-nullable page cannot be null'); + throw new \InvalidArgumentException('non-nullable page cannot be null'); } $this->container['page'] = $page; @@ -418,26 +433,27 @@ public function getPageSize() /** * Sets page_size * - * @param int|null $page_size objects returned per page + * @param int|null $page_size Objects returned per page. * * @return self */ - public function setPageSize(?int $page_size) + public function setPageSize($page_size) { if (is_null($page_size)) { - throw new InvalidArgumentException('non-nullable page_size cannot be null'); + throw new \InvalidArgumentException('non-nullable page_size cannot be null'); } $this->container['page_size'] = $page_size; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -446,11 +462,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -461,8 +477,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -475,9 +493,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -485,12 +505,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -519,3 +539,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/ModelInterface.php b/sdks/php/src/Model/ModelInterface.php index 0bc2f212e..331da6275 100644 --- a/sdks/php/src/Model/ModelInterface.php +++ b/sdks/php/src/Model/ModelInterface.php @@ -1,11 +1,14 @@ */ -class OAuthTokenGenerateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class OAuthTokenGenerateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OAuthTokenGenerateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'client_id' => 'string', 'client_secret' => 'string', 'code' => 'string', 'grant_type' => 'string', - 'state' => 'string', + 'state' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'client_id' => null, 'client_secret' => null, 'code' => null, 'grant_type' => null, - 'state' => null, + 'state' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'client_id' => false, 'client_secret' => false, 'code' => false, 'grant_type' => false, - 'state' => false, + 'state' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -121,6 +123,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -130,7 +134,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -140,7 +144,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -149,6 +153,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -157,6 +164,9 @@ 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 { @@ -174,7 +184,7 @@ public function isNullableSetToNull(string $property): bool 'client_secret' => 'client_secret', 'code' => 'code', 'grant_type' => 'grant_type', - 'state' => 'state', + 'state' => 'state' ]; /** @@ -187,7 +197,7 @@ public function isNullableSetToNull(string $property): bool 'client_secret' => 'setClientSecret', 'code' => 'setCode', 'grant_type' => 'setGrantType', - 'state' => 'setState', + 'state' => 'setState' ]; /** @@ -200,7 +210,7 @@ public function isNullableSetToNull(string $property): bool 'client_secret' => 'getClientSecret', 'code' => 'getCode', 'grant_type' => 'getGrantType', - 'state' => 'getState', + 'state' => 'getState' ]; /** @@ -244,6 +254,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -254,10 +265,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('client_id', $data ?? [], null); $this->setIfExists('client_secret', $data ?? [], null); @@ -266,33 +277,34 @@ public function __construct(array $data = null) $this->setIfExists('state', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): OAuthTokenGenerateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): OAuthTokenGenerateRequest { /** @var OAuthTokenGenerateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, OAuthTokenGenerateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -340,6 +352,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets client_id * @@ -353,14 +366,14 @@ public function getClientId() /** * Sets client_id * - * @param string $client_id the client id of the app requesting authorization + * @param string $client_id The client id of the app requesting authorization. * * @return self */ - public function setClientId(string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -380,14 +393,14 @@ public function getClientSecret() /** * Sets client_secret * - * @param string $client_secret the secret token of your app + * @param string $client_secret The secret token of your app. * * @return self */ - public function setClientSecret(string $client_secret) + public function setClientSecret($client_secret) { if (is_null($client_secret)) { - throw new InvalidArgumentException('non-nullable client_secret cannot be null'); + throw new \InvalidArgumentException('non-nullable client_secret cannot be null'); } $this->container['client_secret'] = $client_secret; @@ -407,14 +420,14 @@ public function getCode() /** * Sets code * - * @param string $code the code passed to your callback when the user granted access + * @param string $code The code passed to your callback when the user granted access. * * @return self */ - public function setCode(string $code) + public function setCode($code) { if (is_null($code)) { - throw new InvalidArgumentException('non-nullable code cannot be null'); + throw new \InvalidArgumentException('non-nullable code cannot be null'); } $this->container['code'] = $code; @@ -434,14 +447,14 @@ public function getGrantType() /** * Sets grant_type * - * @param string $grant_type when generating a new token use `authorization_code` + * @param string $grant_type When generating a new token use `authorization_code`. * * @return self */ - public function setGrantType(string $grant_type) + public function setGrantType($grant_type) { if (is_null($grant_type)) { - throw new InvalidArgumentException('non-nullable grant_type cannot be null'); + throw new \InvalidArgumentException('non-nullable grant_type cannot be null'); } $this->container['grant_type'] = $grant_type; @@ -461,26 +474,27 @@ public function getState() /** * Sets state * - * @param string $state same as the state you specified earlier + * @param string $state Same as the state you specified earlier. * * @return self */ - public function setState(string $state) + public function setState($state) { if (is_null($state)) { - throw new InvalidArgumentException('non-nullable state cannot be null'); + throw new \InvalidArgumentException('non-nullable state cannot be null'); } $this->container['state'] = $state; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -489,11 +503,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -504,8 +518,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -518,9 +534,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -528,12 +546,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -562,3 +580,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/OAuthTokenRefreshRequest.php b/sdks/php/src/Model/OAuthTokenRefreshRequest.php index 11cf05a3b..db7285ad1 100644 --- a/sdks/php/src/Model/OAuthTokenRefreshRequest.php +++ b/sdks/php/src/Model/OAuthTokenRefreshRequest.php @@ -1,11 +1,14 @@ */ -class OAuthTokenRefreshRequest implements ModelInterface, ArrayAccess, JsonSerializable +class OAuthTokenRefreshRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OAuthTokenRefreshRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'grant_type' => 'string', 'refresh_token' => 'string', 'client_id' => 'string', - 'client_secret' => 'string', + 'client_secret' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'grant_type' => null, 'refresh_token' => null, 'client_id' => null, - 'client_secret' => null, + 'client_secret' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'grant_type' => false, 'refresh_token' => false, 'client_id' => false, - 'client_secret' => false, + 'client_secret' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -118,6 +120,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -127,7 +131,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -137,7 +141,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -146,6 +150,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -154,6 +161,9 @@ 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 { @@ -170,7 +180,7 @@ public function isNullableSetToNull(string $property): bool 'grant_type' => 'grant_type', 'refresh_token' => 'refresh_token', 'client_id' => 'client_id', - 'client_secret' => 'client_secret', + 'client_secret' => 'client_secret' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'grant_type' => 'setGrantType', 'refresh_token' => 'setRefreshToken', 'client_id' => 'setClientId', - 'client_secret' => 'setClientSecret', + 'client_secret' => 'setClientSecret' ]; /** @@ -194,7 +204,7 @@ public function isNullableSetToNull(string $property): bool 'grant_type' => 'getGrantType', 'refresh_token' => 'getRefreshToken', 'client_id' => 'getClientId', - 'client_secret' => 'getClientSecret', + 'client_secret' => 'getClientSecret' ]; /** @@ -238,6 +248,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -248,10 +259,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('grant_type', $data ?? [], 'refresh_token'); $this->setIfExists('refresh_token', $data ?? [], null); @@ -259,33 +270,34 @@ public function __construct(array $data = null) $this->setIfExists('client_secret', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): OAuthTokenRefreshRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): OAuthTokenRefreshRequest { /** @var OAuthTokenRefreshRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, OAuthTokenRefreshRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -324,6 +336,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets grant_type * @@ -337,14 +350,14 @@ public function getGrantType() /** * Sets grant_type * - * @param string $grant_type when refreshing an existing token use `refresh_token` + * @param string $grant_type When refreshing an existing token use `refresh_token`. * * @return self */ - public function setGrantType(string $grant_type) + public function setGrantType($grant_type) { if (is_null($grant_type)) { - throw new InvalidArgumentException('non-nullable grant_type cannot be null'); + throw new \InvalidArgumentException('non-nullable grant_type cannot be null'); } $this->container['grant_type'] = $grant_type; @@ -364,14 +377,14 @@ public function getRefreshToken() /** * Sets refresh_token * - * @param string $refresh_token the token provided when you got the expired access token + * @param string $refresh_token The token provided when you got the expired access token. * * @return self */ - public function setRefreshToken(string $refresh_token) + public function setRefreshToken($refresh_token) { if (is_null($refresh_token)) { - throw new InvalidArgumentException('non-nullable refresh_token cannot be null'); + throw new \InvalidArgumentException('non-nullable refresh_token cannot be null'); } $this->container['refresh_token'] = $refresh_token; @@ -395,10 +408,10 @@ public function getClientId() * * @return self */ - public function setClientId(?string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -422,22 +435,23 @@ public function getClientSecret() * * @return self */ - public function setClientSecret(?string $client_secret) + public function setClientSecret($client_secret) { if (is_null($client_secret)) { - throw new InvalidArgumentException('non-nullable client_secret cannot be null'); + throw new \InvalidArgumentException('non-nullable client_secret cannot be null'); } $this->container['client_secret'] = $client_secret; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -446,11 +460,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -461,8 +475,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -475,9 +491,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -485,12 +503,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -519,3 +537,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/OAuthTokenResponse.php b/sdks/php/src/Model/OAuthTokenResponse.php index 8c83de78e..ab2e311f4 100644 --- a/sdks/php/src/Model/OAuthTokenResponse.php +++ b/sdks/php/src/Model/OAuthTokenResponse.php @@ -1,11 +1,14 @@ */ -class OAuthTokenResponse implements ModelInterface, ArrayAccess, JsonSerializable +class OAuthTokenResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OAuthTokenResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'access_token' => 'string', 'token_type' => 'string', 'refresh_token' => 'string', 'expires_in' => 'int', - 'state' => 'string', + 'state' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'access_token' => null, 'token_type' => null, 'refresh_token' => null, 'expires_in' => null, - 'state' => null, + 'state' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'access_token' => false, 'token_type' => false, 'refresh_token' => false, 'expires_in' => false, - 'state' => true, + 'state' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -121,6 +123,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -130,7 +134,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -140,7 +144,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -149,6 +153,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -157,6 +164,9 @@ 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 { @@ -174,7 +184,7 @@ public function isNullableSetToNull(string $property): bool 'token_type' => 'token_type', 'refresh_token' => 'refresh_token', 'expires_in' => 'expires_in', - 'state' => 'state', + 'state' => 'state' ]; /** @@ -187,7 +197,7 @@ public function isNullableSetToNull(string $property): bool 'token_type' => 'setTokenType', 'refresh_token' => 'setRefreshToken', 'expires_in' => 'setExpiresIn', - 'state' => 'setState', + 'state' => 'setState' ]; /** @@ -200,7 +210,7 @@ public function isNullableSetToNull(string $property): bool 'token_type' => 'getTokenType', 'refresh_token' => 'getRefreshToken', 'expires_in' => 'getExpiresIn', - 'state' => 'getState', + 'state' => 'getState' ]; /** @@ -244,6 +254,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -254,10 +265,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('access_token', $data ?? [], null); $this->setIfExists('token_type', $data ?? [], null); @@ -266,33 +277,34 @@ public function __construct(array $data = null) $this->setIfExists('state', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): OAuthTokenResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): OAuthTokenResponse { /** @var OAuthTokenResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, OAuthTokenResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -309,7 +321,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -323,6 +337,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets access_token * @@ -340,10 +355,10 @@ public function getAccessToken() * * @return self */ - public function setAccessToken(?string $access_token) + public function setAccessToken($access_token) { if (is_null($access_token)) { - throw new InvalidArgumentException('non-nullable access_token cannot be null'); + throw new \InvalidArgumentException('non-nullable access_token cannot be null'); } $this->container['access_token'] = $access_token; @@ -367,10 +382,10 @@ public function getTokenType() * * @return self */ - public function setTokenType(?string $token_type) + public function setTokenType($token_type) { if (is_null($token_type)) { - throw new InvalidArgumentException('non-nullable token_type cannot be null'); + throw new \InvalidArgumentException('non-nullable token_type cannot be null'); } $this->container['token_type'] = $token_type; @@ -394,10 +409,10 @@ public function getRefreshToken() * * @return self */ - public function setRefreshToken(?string $refresh_token) + public function setRefreshToken($refresh_token) { if (is_null($refresh_token)) { - throw new InvalidArgumentException('non-nullable refresh_token cannot be null'); + throw new \InvalidArgumentException('non-nullable refresh_token cannot be null'); } $this->container['refresh_token'] = $refresh_token; @@ -421,10 +436,10 @@ public function getExpiresIn() * * @return self */ - public function setExpiresIn(?int $expires_in) + public function setExpiresIn($expires_in) { if (is_null($expires_in)) { - throw new InvalidArgumentException('non-nullable expires_in cannot be null'); + throw new \InvalidArgumentException('non-nullable expires_in cannot be null'); } $this->container['expires_in'] = $expires_in; @@ -448,13 +463,13 @@ public function getState() * * @return self */ - public function setState(?string $state) + public function setState($state) { if (is_null($state)) { array_push($this->openAPINullablesSetToNull, 'state'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('state', $nullablesSetToNull); + $index = array_search('state', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -464,13 +479,14 @@ public function setState(?string $state) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -479,11 +495,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -494,8 +510,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -508,9 +526,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -518,12 +538,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -552,3 +572,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/ReportCreateRequest.php b/sdks/php/src/Model/ReportCreateRequest.php index 58029634b..42995e896 100644 --- a/sdks/php/src/Model/ReportCreateRequest.php +++ b/sdks/php/src/Model/ReportCreateRequest.php @@ -1,11 +1,14 @@ */ -class ReportCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class ReportCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ReportCreateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'end_date' => 'string', 'report_type' => 'string[]', - 'start_date' => 'string', + 'start_date' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'end_date' => null, 'report_type' => null, - 'start_date' => null, + 'start_date' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'end_date' => false, 'report_type' => false, - 'start_date' => false, + 'start_date' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'end_date' => 'end_date', 'report_type' => 'report_type', - 'start_date' => 'start_date', + 'start_date' => 'start_date' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'end_date' => 'setEndDate', 'report_type' => 'setReportType', - 'start_date' => 'setStartDate', + 'start_date' => 'setStartDate' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'end_date' => 'getEndDate', 'report_type' => 'getReportType', - 'start_date' => 'getStartDate', + 'start_date' => 'getStartDate' ]; /** @@ -258,43 +268,44 @@ public function getReportTypeAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('end_date', $data ?? [], null); $this->setIfExists('report_type', $data ?? [], null); $this->setIfExists('start_date', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): ReportCreateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): ReportCreateRequest { /** @var ReportCreateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, ReportCreateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,11 +330,11 @@ public function listInvalidProperties() if ($this->container['report_type'] === null) { $invalidProperties[] = "'report_type' can't be null"; } - if (count($this->container['report_type']) > 2) { + if ((count($this->container['report_type']) > 2)) { $invalidProperties[] = "invalid value for 'report_type', number of items must be less than or equal to 2."; } - if (count($this->container['report_type']) < 1) { + if ((count($this->container['report_type']) < 1)) { $invalidProperties[] = "invalid value for 'report_type', number of items must be greater than or equal to 1."; } @@ -344,6 +355,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets end_date * @@ -357,14 +369,14 @@ public function getEndDate() /** * Sets end_date * - * @param string $end_date the (inclusive) end date for the report data in `MM/DD/YYYY` format + * @param string $end_date The (inclusive) end date for the report data in `MM/DD/YYYY` format. * * @return self */ - public function setEndDate(string $end_date) + public function setEndDate($end_date) { if (is_null($end_date)) { - throw new InvalidArgumentException('non-nullable end_date cannot be null'); + throw new \InvalidArgumentException('non-nullable end_date cannot be null'); } $this->container['end_date'] = $end_date; @@ -388,14 +400,14 @@ public function getReportType() * * @return self */ - public function setReportType(array $report_type) + public function setReportType($report_type) { if (is_null($report_type)) { - throw new InvalidArgumentException('non-nullable report_type cannot be null'); + throw new \InvalidArgumentException('non-nullable report_type cannot be null'); } $allowedValues = $this->getReportTypeAllowableValues(); if (array_diff($report_type, $allowedValues)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value for 'report_type', must be one of '%s'", implode("', '", $allowedValues) @@ -403,11 +415,11 @@ public function setReportType(array $report_type) ); } - if (count($report_type) > 2) { - throw new InvalidArgumentException('invalid value for $report_type when calling ReportCreateRequest., number of items must be less than or equal to 2.'); + if ((count($report_type) > 2)) { + throw new \InvalidArgumentException('invalid value for $report_type when calling ReportCreateRequest., number of items must be less than or equal to 2.'); } - if (count($report_type) < 1) { - throw new InvalidArgumentException('invalid length for $report_type when calling ReportCreateRequest., number of items must be greater than or equal to 1.'); + if ((count($report_type) < 1)) { + throw new \InvalidArgumentException('invalid length for $report_type when calling ReportCreateRequest., number of items must be greater than or equal to 1.'); } $this->container['report_type'] = $report_type; @@ -427,26 +439,27 @@ public function getStartDate() /** * Sets start_date * - * @param string $start_date the (inclusive) start date for the report data in `MM/DD/YYYY` format + * @param string $start_date The (inclusive) start date for the report data in `MM/DD/YYYY` format. * * @return self */ - public function setStartDate(string $start_date) + public function setStartDate($start_date) { if (is_null($start_date)) { - throw new InvalidArgumentException('non-nullable start_date cannot be null'); + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); } $this->container['start_date'] = $start_date; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -455,11 +468,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -470,8 +483,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -484,9 +499,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -494,12 +511,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -528,3 +545,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/ReportCreateResponse.php b/sdks/php/src/Model/ReportCreateResponse.php index 415406e3c..5ba20adf4 100644 --- a/sdks/php/src/Model/ReportCreateResponse.php +++ b/sdks/php/src/Model/ReportCreateResponse.php @@ -1,11 +1,14 @@ */ -class ReportCreateResponse implements ModelInterface, ArrayAccess, JsonSerializable +class ReportCreateResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ReportCreateResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'report' => '\Dropbox\Sign\Model\ReportResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'report' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'report' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'report' => 'report', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'report' => 'setReport', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'report' => 'getReport', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('report', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): ReportCreateResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): ReportCreateResponse { /** @var ReportCreateResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, ReportCreateResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,6 +319,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets report * @@ -324,10 +337,10 @@ public function getReport() * * @return self */ - public function setReport(ReportResponse $report) + public function setReport($report) { if (is_null($report)) { - throw new InvalidArgumentException('non-nullable report cannot be null'); + throw new \InvalidArgumentException('non-nullable report cannot be null'); } $this->container['report'] = $report; @@ -347,26 +360,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -375,11 +389,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,8 +404,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -404,9 +420,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -414,12 +432,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -448,3 +466,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/ReportResponse.php b/sdks/php/src/Model/ReportResponse.php index c2d024ca1..6ffa90c81 100644 --- a/sdks/php/src/Model/ReportResponse.php +++ b/sdks/php/src/Model/ReportResponse.php @@ -1,11 +1,14 @@ */ -class ReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +class ReportResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ReportResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'success' => 'string', 'start_date' => 'string', 'end_date' => 'string', - 'report_type' => 'string[]', + 'report_type' => 'string[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'success' => null, 'start_date' => null, 'end_date' => null, - 'report_type' => null, + 'report_type' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'success' => false, 'start_date' => false, 'end_date' => false, - 'report_type' => false, + 'report_type' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -119,6 +121,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -128,7 +132,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +142,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,6 +151,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -155,6 +162,9 @@ 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 { @@ -171,7 +181,7 @@ public function isNullableSetToNull(string $property): bool 'success' => 'success', 'start_date' => 'start_date', 'end_date' => 'end_date', - 'report_type' => 'report_type', + 'report_type' => 'report_type' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool 'success' => 'setSuccess', 'start_date' => 'setStartDate', 'end_date' => 'setEndDate', - 'report_type' => 'setReportType', + 'report_type' => 'setReportType' ]; /** @@ -195,7 +205,7 @@ public function isNullableSetToNull(string $property): bool 'success' => 'getSuccess', 'start_date' => 'getStartDate', 'end_date' => 'getEndDate', - 'report_type' => 'getReportType', + 'report_type' => 'getReportType' ]; /** @@ -265,10 +275,10 @@ public function getReportTypeAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('success', $data ?? [], null); $this->setIfExists('start_date', $data ?? [], null); @@ -276,33 +286,34 @@ public function __construct(array $data = null) $this->setIfExists('report_type', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): ReportResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): ReportResponse { /** @var ReportResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, ReportResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,7 +330,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -333,6 +346,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets success * @@ -350,10 +364,10 @@ public function getSuccess() * * @return self */ - public function setSuccess(?string $success) + public function setSuccess($success) { if (is_null($success)) { - throw new InvalidArgumentException('non-nullable success cannot be null'); + throw new \InvalidArgumentException('non-nullable success cannot be null'); } $this->container['success'] = $success; @@ -373,14 +387,14 @@ public function getStartDate() /** * Sets start_date * - * @param string|null $start_date the (inclusive) start date for the report data in MM/DD/YYYY format + * @param string|null $start_date The (inclusive) start date for the report data in MM/DD/YYYY format. * * @return self */ - public function setStartDate(?string $start_date) + public function setStartDate($start_date) { if (is_null($start_date)) { - throw new InvalidArgumentException('non-nullable start_date cannot be null'); + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); } $this->container['start_date'] = $start_date; @@ -400,14 +414,14 @@ public function getEndDate() /** * Sets end_date * - * @param string|null $end_date the (inclusive) end date for the report data in MM/DD/YYYY format + * @param string|null $end_date The (inclusive) end date for the report data in MM/DD/YYYY format. * * @return self */ - public function setEndDate(?string $end_date) + public function setEndDate($end_date) { if (is_null($end_date)) { - throw new InvalidArgumentException('non-nullable end_date cannot be null'); + throw new \InvalidArgumentException('non-nullable end_date cannot be null'); } $this->container['end_date'] = $end_date; @@ -431,14 +445,14 @@ public function getReportType() * * @return self */ - public function setReportType(?array $report_type) + public function setReportType($report_type) { if (is_null($report_type)) { - throw new InvalidArgumentException('non-nullable report_type cannot be null'); + throw new \InvalidArgumentException('non-nullable report_type cannot be null'); } $allowedValues = $this->getReportTypeAllowableValues(); if (array_diff($report_type, $allowedValues)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value for 'report_type', must be one of '%s'", implode("', '", $allowedValues) @@ -449,13 +463,14 @@ public function setReportType(?array $report_type) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -464,11 +479,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -479,8 +494,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -493,9 +510,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -503,12 +522,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -537,3 +556,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.php index 9c5947fec..da74a6fb9 100644 --- a/sdks/php/src/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.php @@ -1,11 +1,14 @@ */ -class SignatureRequestBulkCreateEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestBulkCreateEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestBulkCreateEmbeddedWithTemplateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template_ids' => 'string[]', 'client_id' => 'string', @@ -70,16 +71,16 @@ class SignatureRequestBulkCreateEmbeddedWithTemplateRequest implements ModelInte 'signing_redirect_url' => 'string', 'subject' => 'string', 'test_mode' => 'bool', - 'title' => 'string', + 'title' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template_ids' => null, 'client_id' => null, @@ -93,14 +94,14 @@ class SignatureRequestBulkCreateEmbeddedWithTemplateRequest implements ModelInte 'signing_redirect_url' => null, 'subject' => null, 'test_mode' => null, - 'title' => null, + 'title' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'template_ids' => false, 'client_id' => false, @@ -114,14 +115,14 @@ class SignatureRequestBulkCreateEmbeddedWithTemplateRequest implements ModelInte 'signing_redirect_url' => false, 'subject' => false, 'test_mode' => false, - 'title' => false, + 'title' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -146,6 +147,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -155,7 +158,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -165,7 +168,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -174,6 +177,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -182,6 +188,9 @@ 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 { @@ -207,7 +216,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'signing_redirect_url', 'subject' => 'subject', 'test_mode' => 'test_mode', - 'title' => 'title', + 'title' => 'title' ]; /** @@ -228,7 +237,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'setSigningRedirectUrl', 'subject' => 'setSubject', 'test_mode' => 'setTestMode', - 'title' => 'setTitle', + 'title' => 'setTitle' ]; /** @@ -249,7 +258,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'getSigningRedirectUrl', 'subject' => 'getSubject', 'test_mode' => 'getTestMode', - 'title' => 'getTitle', + 'title' => 'getTitle' ]; /** @@ -293,6 +302,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -303,10 +313,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('template_ids', $data ?? [], null); $this->setIfExists('client_id', $data ?? [], null); @@ -323,33 +333,34 @@ public function __construct(array $data = null) $this->setIfExists('title', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestBulkCreateEmbeddedWithTemplateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestBulkCreateEmbeddedWithTemplateRequest { /** @var SignatureRequestBulkCreateEmbeddedWithTemplateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestBulkCreateEmbeddedWithTemplateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -400,6 +411,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets template_ids * @@ -413,14 +425,14 @@ public function getTemplateIds() /** * Sets template_ids * - * @param string[] $template_ids use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used + * @param string[] $template_ids Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. * * @return self */ - public function setTemplateIds(array $template_ids) + public function setTemplateIds($template_ids) { if (is_null($template_ids)) { - throw new InvalidArgumentException('non-nullable template_ids cannot be null'); + throw new \InvalidArgumentException('non-nullable template_ids cannot be null'); } $this->container['template_ids'] = $template_ids; @@ -444,10 +456,10 @@ public function getClientId() * * @return self */ - public function setClientId(string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -457,7 +469,7 @@ public function setClientId(string $client_id) /** * Gets signer_file * - * @return SplFileObject|null + * @return \SplFileObject|null */ public function getSignerFile() { @@ -467,14 +479,14 @@ public function getSignerFile() /** * Sets signer_file * - * @param SplFileObject|null $signer_file `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` + * @param \SplFileObject|null $signer_file `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` * * @return self */ - public function setSignerFile(?SplFileObject $signer_file) + public function setSignerFile($signer_file) { if (is_null($signer_file)) { - throw new InvalidArgumentException('non-nullable signer_file cannot be null'); + throw new \InvalidArgumentException('non-nullable signer_file cannot be null'); } $this->container['signer_file'] = $signer_file; @@ -498,10 +510,10 @@ public function getSignerList() * * @return self */ - public function setSignerList(?array $signer_list) + public function setSignerList($signer_list) { if (is_null($signer_list)) { - throw new InvalidArgumentException('non-nullable signer_list cannot be null'); + throw new \InvalidArgumentException('non-nullable signer_list cannot be null'); } $this->container['signer_list'] = $signer_list; @@ -525,10 +537,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline(?bool $allow_decline) + public function setAllowDecline($allow_decline) { if (is_null($allow_decline)) { - throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -552,10 +564,10 @@ public function getCcs() * * @return self */ - public function setCcs(?array $ccs) + public function setCcs($ccs) { if (is_null($ccs)) { - throw new InvalidArgumentException('non-nullable ccs cannot be null'); + throw new \InvalidArgumentException('non-nullable ccs cannot be null'); } $this->container['ccs'] = $ccs; @@ -579,10 +591,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields(?array $custom_fields) + public function setCustomFields($custom_fields) { if (is_null($custom_fields)) { - throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -602,17 +614,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message the custom message in the email that will be sent to the signers + * @param string|null $message The custom message in the email that will be sent to the signers. * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { - throw new InvalidArgumentException('non-nullable message cannot be null'); + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - if (mb_strlen($message) > 5000) { - throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestBulkCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); + if ((mb_strlen($message) > 5000)) { + throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestBulkCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -637,12 +649,13 @@ public function getMetadata() * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } + $this->container['metadata'] = $metadata; return $this; @@ -661,14 +674,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign + * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. * * @return self */ - public function setSigningRedirectUrl(?string $signing_redirect_url) + public function setSigningRedirectUrl($signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -688,17 +701,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject the subject in the email that will be sent to the signers + * @param string|null $subject The subject in the email that will be sent to the signers. * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { - throw new InvalidArgumentException('non-nullable subject cannot be null'); + throw new \InvalidArgumentException('non-nullable subject cannot be null'); } - if (mb_strlen($subject) > 255) { - throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestBulkCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($subject) > 255)) { + throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestBulkCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -723,10 +736,10 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -746,30 +759,31 @@ public function getTitle() /** * Sets title * - * @param string|null $title the title you want to assign to the SignatureRequest + * @param string|null $title The title you want to assign to the SignatureRequest. * * @return self */ - public function setTitle(?string $title) + public function setTitle($title) { if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); + throw new \InvalidArgumentException('non-nullable title cannot be null'); } - if (mb_strlen($title) > 255) { - throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestBulkCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($title) > 255)) { + throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestBulkCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -778,11 +792,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -793,8 +807,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -807,9 +823,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -817,12 +835,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -851,3 +869,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestBulkSendWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestBulkSendWithTemplateRequest.php index 26092eb3f..a9bd87d1d 100644 --- a/sdks/php/src/Model/SignatureRequestBulkSendWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestBulkSendWithTemplateRequest.php @@ -1,11 +1,14 @@ */ -class SignatureRequestBulkSendWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestBulkSendWithTemplateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestBulkSendWithTemplateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template_ids' => 'string[]', 'signer_file' => '\SplFileObject', @@ -70,16 +71,16 @@ class SignatureRequestBulkSendWithTemplateRequest implements ModelInterface, Arr 'signing_redirect_url' => 'string', 'subject' => 'string', 'test_mode' => 'bool', - 'title' => 'string', + 'title' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template_ids' => null, 'signer_file' => 'binary', @@ -93,14 +94,14 @@ class SignatureRequestBulkSendWithTemplateRequest implements ModelInterface, Arr 'signing_redirect_url' => null, 'subject' => null, 'test_mode' => null, - 'title' => null, + 'title' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'template_ids' => false, 'signer_file' => false, @@ -114,14 +115,14 @@ class SignatureRequestBulkSendWithTemplateRequest implements ModelInterface, Arr 'signing_redirect_url' => false, 'subject' => false, 'test_mode' => false, - 'title' => false, + 'title' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -146,6 +147,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -155,7 +158,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -165,7 +168,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -174,6 +177,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -182,6 +188,9 @@ 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 { @@ -207,7 +216,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'signing_redirect_url', 'subject' => 'subject', 'test_mode' => 'test_mode', - 'title' => 'title', + 'title' => 'title' ]; /** @@ -228,7 +237,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'setSigningRedirectUrl', 'subject' => 'setSubject', 'test_mode' => 'setTestMode', - 'title' => 'setTitle', + 'title' => 'setTitle' ]; /** @@ -249,7 +258,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'getSigningRedirectUrl', 'subject' => 'getSubject', 'test_mode' => 'getTestMode', - 'title' => 'getTitle', + 'title' => 'getTitle' ]; /** @@ -293,6 +302,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -303,10 +313,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('template_ids', $data ?? [], null); $this->setIfExists('signer_file', $data ?? [], null); @@ -323,33 +333,34 @@ public function __construct(array $data = null) $this->setIfExists('title', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestBulkSendWithTemplateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestBulkSendWithTemplateRequest { /** @var SignatureRequestBulkSendWithTemplateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestBulkSendWithTemplateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -397,6 +408,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets template_ids * @@ -410,14 +422,14 @@ public function getTemplateIds() /** * Sets template_ids * - * @param string[] $template_ids use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used + * @param string[] $template_ids Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. * * @return self */ - public function setTemplateIds(array $template_ids) + public function setTemplateIds($template_ids) { if (is_null($template_ids)) { - throw new InvalidArgumentException('non-nullable template_ids cannot be null'); + throw new \InvalidArgumentException('non-nullable template_ids cannot be null'); } $this->container['template_ids'] = $template_ids; @@ -427,7 +439,7 @@ public function setTemplateIds(array $template_ids) /** * Gets signer_file * - * @return SplFileObject|null + * @return \SplFileObject|null */ public function getSignerFile() { @@ -437,14 +449,14 @@ public function getSignerFile() /** * Sets signer_file * - * @param SplFileObject|null $signer_file `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` + * @param \SplFileObject|null $signer_file `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` * * @return self */ - public function setSignerFile(?SplFileObject $signer_file) + public function setSignerFile($signer_file) { if (is_null($signer_file)) { - throw new InvalidArgumentException('non-nullable signer_file cannot be null'); + throw new \InvalidArgumentException('non-nullable signer_file cannot be null'); } $this->container['signer_file'] = $signer_file; @@ -468,10 +480,10 @@ public function getSignerList() * * @return self */ - public function setSignerList(?array $signer_list) + public function setSignerList($signer_list) { if (is_null($signer_list)) { - throw new InvalidArgumentException('non-nullable signer_list cannot be null'); + throw new \InvalidArgumentException('non-nullable signer_list cannot be null'); } $this->container['signer_list'] = $signer_list; @@ -495,10 +507,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline(?bool $allow_decline) + public function setAllowDecline($allow_decline) { if (is_null($allow_decline)) { - throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -522,10 +534,10 @@ public function getCcs() * * @return self */ - public function setCcs(?array $ccs) + public function setCcs($ccs) { if (is_null($ccs)) { - throw new InvalidArgumentException('non-nullable ccs cannot be null'); + throw new \InvalidArgumentException('non-nullable ccs cannot be null'); } $this->container['ccs'] = $ccs; @@ -549,10 +561,10 @@ public function getClientId() * * @return self */ - public function setClientId(?string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -576,10 +588,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields(?array $custom_fields) + public function setCustomFields($custom_fields) { if (is_null($custom_fields)) { - throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -599,17 +611,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message the custom message in the email that will be sent to the signers + * @param string|null $message The custom message in the email that will be sent to the signers. * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { - throw new InvalidArgumentException('non-nullable message cannot be null'); + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - if (mb_strlen($message) > 5000) { - throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestBulkSendWithTemplateRequest., must be smaller than or equal to 5000.'); + if ((mb_strlen($message) > 5000)) { + throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestBulkSendWithTemplateRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -634,12 +646,13 @@ public function getMetadata() * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } + $this->container['metadata'] = $metadata; return $this; @@ -658,14 +671,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign + * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. * * @return self */ - public function setSigningRedirectUrl(?string $signing_redirect_url) + public function setSigningRedirectUrl($signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -685,17 +698,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject the subject in the email that will be sent to the signers + * @param string|null $subject The subject in the email that will be sent to the signers. * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { - throw new InvalidArgumentException('non-nullable subject cannot be null'); + throw new \InvalidArgumentException('non-nullable subject cannot be null'); } - if (mb_strlen($subject) > 255) { - throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestBulkSendWithTemplateRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($subject) > 255)) { + throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestBulkSendWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -720,10 +733,10 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -743,30 +756,31 @@ public function getTitle() /** * Sets title * - * @param string|null $title the title you want to assign to the SignatureRequest + * @param string|null $title The title you want to assign to the SignatureRequest. * * @return self */ - public function setTitle(?string $title) + public function setTitle($title) { if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); + throw new \InvalidArgumentException('non-nullable title cannot be null'); } - if (mb_strlen($title) > 255) { - throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestBulkSendWithTemplateRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($title) > 255)) { + throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestBulkSendWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -775,11 +789,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -790,8 +804,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -804,9 +820,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -814,12 +832,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -848,3 +866,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestCreateEmbeddedRequest.php b/sdks/php/src/Model/SignatureRequestCreateEmbeddedRequest.php index 7d14b823c..0ce71fc64 100644 --- a/sdks/php/src/Model/SignatureRequestCreateEmbeddedRequest.php +++ b/sdks/php/src/Model/SignatureRequestCreateEmbeddedRequest.php @@ -1,11 +1,14 @@ */ -class SignatureRequestCreateEmbeddedRequest implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestCreateEmbeddedRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestCreateEmbeddedRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'client_id' => 'string', 'files' => '\SplFileObject[]', @@ -81,16 +82,16 @@ class SignatureRequestCreateEmbeddedRequest implements ModelInterface, ArrayAcce 'title' => 'string', 'use_text_tags' => 'bool', 'populate_auto_fill_fields' => 'bool', - 'expires_at' => 'int', + 'expires_at' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'client_id' => null, 'files' => 'binary', @@ -115,14 +116,14 @@ class SignatureRequestCreateEmbeddedRequest implements ModelInterface, ArrayAcce 'title' => null, 'use_text_tags' => null, 'populate_auto_fill_fields' => null, - 'expires_at' => null, + 'expires_at' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'client_id' => false, 'files' => false, @@ -147,14 +148,14 @@ class SignatureRequestCreateEmbeddedRequest implements ModelInterface, ArrayAcce 'title' => false, 'use_text_tags' => false, 'populate_auto_fill_fields' => false, - 'expires_at' => true, + 'expires_at' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -179,6 +180,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -188,7 +191,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -198,7 +201,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -207,6 +210,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -215,6 +221,9 @@ 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 { @@ -251,7 +260,7 @@ public function isNullableSetToNull(string $property): bool 'title' => 'title', 'use_text_tags' => 'use_text_tags', 'populate_auto_fill_fields' => 'populate_auto_fill_fields', - 'expires_at' => 'expires_at', + 'expires_at' => 'expires_at' ]; /** @@ -283,7 +292,7 @@ public function isNullableSetToNull(string $property): bool 'title' => 'setTitle', 'use_text_tags' => 'setUseTextTags', 'populate_auto_fill_fields' => 'setPopulateAutoFillFields', - 'expires_at' => 'setExpiresAt', + 'expires_at' => 'setExpiresAt' ]; /** @@ -315,7 +324,7 @@ public function isNullableSetToNull(string $property): bool 'title' => 'getTitle', 'use_text_tags' => 'getUseTextTags', 'populate_auto_fill_fields' => 'getPopulateAutoFillFields', - 'expires_at' => 'getExpiresAt', + 'expires_at' => 'getExpiresAt' ]; /** @@ -359,6 +368,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -369,10 +379,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('client_id', $data ?? [], null); $this->setIfExists('files', $data ?? [], null); @@ -400,33 +410,34 @@ public function __construct(array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestCreateEmbeddedRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestCreateEmbeddedRequest { /** @var SignatureRequestCreateEmbeddedRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestCreateEmbeddedRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -474,6 +485,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets client_id * @@ -491,10 +503,10 @@ public function getClientId() * * @return self */ - public function setClientId(string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -504,7 +516,7 @@ public function setClientId(string $client_id) /** * Gets files * - * @return SplFileObject[]|null + * @return \SplFileObject[]|null */ public function getFiles() { @@ -514,14 +526,14 @@ public function getFiles() /** * Sets files * - * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles(?array $files) + public function setFiles($files) { if (is_null($files)) { - throw new InvalidArgumentException('non-nullable files cannot be null'); + throw new \InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -545,10 +557,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls(?array $file_urls) + public function setFileUrls($file_urls) { if (is_null($file_urls)) { - throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -572,10 +584,10 @@ public function getSigners() * * @return self */ - public function setSigners(?array $signers) + public function setSigners($signers) { if (is_null($signers)) { - throw new InvalidArgumentException('non-nullable signers cannot be null'); + throw new \InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -599,10 +611,10 @@ public function getGroupedSigners() * * @return self */ - public function setGroupedSigners(?array $grouped_signers) + public function setGroupedSigners($grouped_signers) { if (is_null($grouped_signers)) { - throw new InvalidArgumentException('non-nullable grouped_signers cannot be null'); + throw new \InvalidArgumentException('non-nullable grouped_signers cannot be null'); } $this->container['grouped_signers'] = $grouped_signers; @@ -626,10 +638,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline(?bool $allow_decline) + public function setAllowDecline($allow_decline) { if (is_null($allow_decline)) { - throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -653,10 +665,10 @@ public function getAllowReassign() * * @return self */ - public function setAllowReassign(?bool $allow_reassign) + public function setAllowReassign($allow_reassign) { if (is_null($allow_reassign)) { - throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_reassign cannot be null'); } $this->container['allow_reassign'] = $allow_reassign; @@ -680,10 +692,10 @@ public function getAttachments() * * @return self */ - public function setAttachments(?array $attachments) + public function setAttachments($attachments) { if (is_null($attachments)) { - throw new InvalidArgumentException('non-nullable attachments cannot be null'); + throw new \InvalidArgumentException('non-nullable attachments cannot be null'); } $this->container['attachments'] = $attachments; @@ -703,14 +715,14 @@ public function getCcEmailAddresses() /** * Sets cc_email_addresses * - * @param string[]|null $cc_email_addresses the email addresses that should be CCed + * @param string[]|null $cc_email_addresses The email addresses that should be CCed. * * @return self */ - public function setCcEmailAddresses(?array $cc_email_addresses) + public function setCcEmailAddresses($cc_email_addresses) { if (is_null($cc_email_addresses)) { - throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + throw new \InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); } $this->container['cc_email_addresses'] = $cc_email_addresses; @@ -734,10 +746,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields(?array $custom_fields) + public function setCustomFields($custom_fields) { if (is_null($custom_fields)) { - throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -761,10 +773,10 @@ public function getFieldOptions() * * @return self */ - public function setFieldOptions(?SubFieldOptions $field_options) + public function setFieldOptions($field_options) { if (is_null($field_options)) { - throw new InvalidArgumentException('non-nullable field_options cannot be null'); + throw new \InvalidArgumentException('non-nullable field_options cannot be null'); } $this->container['field_options'] = $field_options; @@ -788,10 +800,10 @@ public function getFormFieldGroups() * * @return self */ - public function setFormFieldGroups(?array $form_field_groups) + public function setFormFieldGroups($form_field_groups) { if (is_null($form_field_groups)) { - throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); + throw new \InvalidArgumentException('non-nullable form_field_groups cannot be null'); } $this->container['form_field_groups'] = $form_field_groups; @@ -811,14 +823,14 @@ public function getFormFieldRules() /** * Sets form_field_rules * - * @param SubFormFieldRule[]|null $form_field_rules conditional Logic rules for fields defined in `form_fields_per_document` + * @param SubFormFieldRule[]|null $form_field_rules Conditional Logic rules for fields defined in `form_fields_per_document`. * * @return self */ - public function setFormFieldRules(?array $form_field_rules) + public function setFormFieldRules($form_field_rules) { if (is_null($form_field_rules)) { - throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); + throw new \InvalidArgumentException('non-nullable form_field_rules cannot be null'); } $this->container['form_field_rules'] = $form_field_rules; @@ -842,10 +854,10 @@ public function getFormFieldsPerDocument() * * @return self */ - public function setFormFieldsPerDocument(?array $form_fields_per_document) + public function setFormFieldsPerDocument($form_fields_per_document) { if (is_null($form_fields_per_document)) { - throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + throw new \InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); } $this->container['form_fields_per_document'] = $form_fields_per_document; @@ -869,10 +881,10 @@ public function getHideTextTags() * * @return self */ - public function setHideTextTags(?bool $hide_text_tags) + public function setHideTextTags($hide_text_tags) { if (is_null($hide_text_tags)) { - throw new InvalidArgumentException('non-nullable hide_text_tags cannot be null'); + throw new \InvalidArgumentException('non-nullable hide_text_tags cannot be null'); } $this->container['hide_text_tags'] = $hide_text_tags; @@ -892,17 +904,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message the custom message in the email that will be sent to the signers + * @param string|null $message The custom message in the email that will be sent to the signers. * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { - throw new InvalidArgumentException('non-nullable message cannot be null'); + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - if (mb_strlen($message) > 5000) { - throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestCreateEmbeddedRequest., must be smaller than or equal to 5000.'); + if ((mb_strlen($message) > 5000)) { + throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestCreateEmbeddedRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -927,12 +939,13 @@ public function getMetadata() * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } + $this->container['metadata'] = $metadata; return $this; @@ -955,10 +968,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions(?SubSigningOptions $signing_options) + public function setSigningOptions($signing_options) { if (is_null($signing_options)) { - throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -978,17 +991,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject the subject in the email that will be sent to the signers + * @param string|null $subject The subject in the email that will be sent to the signers. * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { - throw new InvalidArgumentException('non-nullable subject cannot be null'); + throw new \InvalidArgumentException('non-nullable subject cannot be null'); } - if (mb_strlen($subject) > 255) { - throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestCreateEmbeddedRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($subject) > 255)) { + throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestCreateEmbeddedRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -1013,10 +1026,10 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -1036,17 +1049,17 @@ public function getTitle() /** * Sets title * - * @param string|null $title the title you want to assign to the SignatureRequest + * @param string|null $title The title you want to assign to the SignatureRequest. * * @return self */ - public function setTitle(?string $title) + public function setTitle($title) { if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); + throw new \InvalidArgumentException('non-nullable title cannot be null'); } - if (mb_strlen($title) > 255) { - throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestCreateEmbeddedRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($title) > 255)) { + throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestCreateEmbeddedRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; @@ -1071,10 +1084,10 @@ public function getUseTextTags() * * @return self */ - public function setUseTextTags(?bool $use_text_tags) + public function setUseTextTags($use_text_tags) { if (is_null($use_text_tags)) { - throw new InvalidArgumentException('non-nullable use_text_tags cannot be null'); + throw new \InvalidArgumentException('non-nullable use_text_tags cannot be null'); } $this->container['use_text_tags'] = $use_text_tags; @@ -1098,10 +1111,10 @@ public function getPopulateAutoFillFields() * * @return self */ - public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) + public function setPopulateAutoFillFields($populate_auto_fill_fields) { if (is_null($populate_auto_fill_fields)) { - throw new InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); } $this->container['populate_auto_fill_fields'] = $populate_auto_fill_fields; @@ -1125,13 +1138,13 @@ public function getExpiresAt() * * @return self */ - public function setExpiresAt(?int $expires_at) + 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); + $index = array_search('expires_at', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1141,13 +1154,14 @@ public function setExpiresAt(?int $expires_at) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1156,11 +1170,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1171,8 +1185,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1185,9 +1201,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1195,12 +1213,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1229,3 +1247,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.php index b98f7b8b7..83334eeae 100644 --- a/sdks/php/src/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.php @@ -1,11 +1,14 @@ */ -class SignatureRequestCreateEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestCreateEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestCreateEmbeddedWithTemplateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template_ids' => 'string[]', 'client_id' => 'string', @@ -72,16 +73,16 @@ class SignatureRequestCreateEmbeddedWithTemplateRequest implements ModelInterfac 'subject' => 'string', 'test_mode' => 'bool', 'title' => 'string', - 'populate_auto_fill_fields' => 'bool', + 'populate_auto_fill_fields' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template_ids' => null, 'client_id' => null, @@ -97,14 +98,14 @@ class SignatureRequestCreateEmbeddedWithTemplateRequest implements ModelInterfac 'subject' => null, 'test_mode' => null, 'title' => null, - 'populate_auto_fill_fields' => null, + 'populate_auto_fill_fields' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'template_ids' => false, 'client_id' => false, @@ -120,14 +121,14 @@ class SignatureRequestCreateEmbeddedWithTemplateRequest implements ModelInterfac 'subject' => false, 'test_mode' => false, 'title' => false, - 'populate_auto_fill_fields' => false, + 'populate_auto_fill_fields' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -152,6 +153,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -161,7 +164,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -171,7 +174,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -180,6 +183,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -188,6 +194,9 @@ 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 { @@ -215,7 +224,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'subject', 'test_mode' => 'test_mode', 'title' => 'title', - 'populate_auto_fill_fields' => 'populate_auto_fill_fields', + 'populate_auto_fill_fields' => 'populate_auto_fill_fields' ]; /** @@ -238,7 +247,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'setSubject', 'test_mode' => 'setTestMode', 'title' => 'setTitle', - 'populate_auto_fill_fields' => 'setPopulateAutoFillFields', + 'populate_auto_fill_fields' => 'setPopulateAutoFillFields' ]; /** @@ -261,7 +270,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'getSubject', 'test_mode' => 'getTestMode', 'title' => 'getTitle', - 'populate_auto_fill_fields' => 'getPopulateAutoFillFields', + 'populate_auto_fill_fields' => 'getPopulateAutoFillFields' ]; /** @@ -305,6 +314,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -315,10 +325,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('template_ids', $data ?? [], null); $this->setIfExists('client_id', $data ?? [], null); @@ -337,33 +347,34 @@ public function __construct(array $data = null) $this->setIfExists('populate_auto_fill_fields', $data ?? [], false); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestCreateEmbeddedWithTemplateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestCreateEmbeddedWithTemplateRequest { /** @var SignatureRequestCreateEmbeddedWithTemplateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestCreateEmbeddedWithTemplateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -417,6 +428,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets template_ids * @@ -430,14 +442,14 @@ public function getTemplateIds() /** * Sets template_ids * - * @param string[] $template_ids use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used + * @param string[] $template_ids Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. * * @return self */ - public function setTemplateIds(array $template_ids) + public function setTemplateIds($template_ids) { if (is_null($template_ids)) { - throw new InvalidArgumentException('non-nullable template_ids cannot be null'); + throw new \InvalidArgumentException('non-nullable template_ids cannot be null'); } $this->container['template_ids'] = $template_ids; @@ -461,10 +473,10 @@ public function getClientId() * * @return self */ - public function setClientId(string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -484,14 +496,14 @@ public function getSigners() /** * Sets signers * - * @param SubSignatureRequestTemplateSigner[] $signers add Signers to your Templated-based Signature Request + * @param SubSignatureRequestTemplateSigner[] $signers Add Signers to your Templated-based Signature Request. * * @return self */ - public function setSigners(array $signers) + public function setSigners($signers) { if (is_null($signers)) { - throw new InvalidArgumentException('non-nullable signers cannot be null'); + throw new \InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -515,10 +527,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline(?bool $allow_decline) + public function setAllowDecline($allow_decline) { if (is_null($allow_decline)) { - throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -542,10 +554,10 @@ public function getCcs() * * @return self */ - public function setCcs(?array $ccs) + public function setCcs($ccs) { if (is_null($ccs)) { - throw new InvalidArgumentException('non-nullable ccs cannot be null'); + throw new \InvalidArgumentException('non-nullable ccs cannot be null'); } $this->container['ccs'] = $ccs; @@ -569,10 +581,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields(?array $custom_fields) + public function setCustomFields($custom_fields) { if (is_null($custom_fields)) { - throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -582,7 +594,7 @@ public function setCustomFields(?array $custom_fields) /** * Gets files * - * @return SplFileObject[]|null + * @return \SplFileObject[]|null */ public function getFiles() { @@ -592,14 +604,14 @@ public function getFiles() /** * Sets files * - * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles(?array $files) + public function setFiles($files) { if (is_null($files)) { - throw new InvalidArgumentException('non-nullable files cannot be null'); + throw new \InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -623,10 +635,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls(?array $file_urls) + public function setFileUrls($file_urls) { if (is_null($file_urls)) { - throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -646,17 +658,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message the custom message in the email that will be sent to the signers + * @param string|null $message The custom message in the email that will be sent to the signers. * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { - throw new InvalidArgumentException('non-nullable message cannot be null'); + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - if (mb_strlen($message) > 5000) { - throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); + if ((mb_strlen($message) > 5000)) { + throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -681,12 +693,13 @@ public function getMetadata() * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } + $this->container['metadata'] = $metadata; return $this; @@ -709,10 +722,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions(?SubSigningOptions $signing_options) + public function setSigningOptions($signing_options) { if (is_null($signing_options)) { - throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -732,17 +745,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject the subject in the email that will be sent to the signers + * @param string|null $subject The subject in the email that will be sent to the signers. * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { - throw new InvalidArgumentException('non-nullable subject cannot be null'); + throw new \InvalidArgumentException('non-nullable subject cannot be null'); } - if (mb_strlen($subject) > 255) { - throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($subject) > 255)) { + throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -767,10 +780,10 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -790,17 +803,17 @@ public function getTitle() /** * Sets title * - * @param string|null $title the title you want to assign to the SignatureRequest + * @param string|null $title The title you want to assign to the SignatureRequest. * * @return self */ - public function setTitle(?string $title) + public function setTitle($title) { if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); + throw new \InvalidArgumentException('non-nullable title cannot be null'); } - if (mb_strlen($title) > 255) { - throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($title) > 255)) { + throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; @@ -825,22 +838,23 @@ public function getPopulateAutoFillFields() * * @return self */ - public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) + public function setPopulateAutoFillFields($populate_auto_fill_fields) { if (is_null($populate_auto_fill_fields)) { - throw new InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); } $this->container['populate_auto_fill_fields'] = $populate_auto_fill_fields; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -849,11 +863,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -864,8 +878,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -878,9 +894,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -888,12 +906,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -922,3 +940,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestEditEmbeddedRequest.php b/sdks/php/src/Model/SignatureRequestEditEmbeddedRequest.php index fcc387bc3..9fe30629e 100644 --- a/sdks/php/src/Model/SignatureRequestEditEmbeddedRequest.php +++ b/sdks/php/src/Model/SignatureRequestEditEmbeddedRequest.php @@ -1,11 +1,14 @@ */ -class SignatureRequestEditEmbeddedRequest implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestEditEmbeddedRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestEditEmbeddedRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'client_id' => 'string', 'files' => '\SplFileObject[]', @@ -81,16 +82,16 @@ class SignatureRequestEditEmbeddedRequest implements ModelInterface, ArrayAccess 'title' => 'string', 'use_text_tags' => 'bool', 'populate_auto_fill_fields' => 'bool', - 'expires_at' => 'int', + 'expires_at' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'client_id' => null, 'files' => 'binary', @@ -115,14 +116,14 @@ class SignatureRequestEditEmbeddedRequest implements ModelInterface, ArrayAccess 'title' => null, 'use_text_tags' => null, 'populate_auto_fill_fields' => null, - 'expires_at' => null, + 'expires_at' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'client_id' => false, 'files' => false, @@ -147,14 +148,14 @@ class SignatureRequestEditEmbeddedRequest implements ModelInterface, ArrayAccess 'title' => false, 'use_text_tags' => false, 'populate_auto_fill_fields' => false, - 'expires_at' => true, + 'expires_at' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -179,6 +180,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -188,7 +191,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -198,7 +201,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -207,6 +210,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -215,6 +221,9 @@ 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 { @@ -251,7 +260,7 @@ public function isNullableSetToNull(string $property): bool 'title' => 'title', 'use_text_tags' => 'use_text_tags', 'populate_auto_fill_fields' => 'populate_auto_fill_fields', - 'expires_at' => 'expires_at', + 'expires_at' => 'expires_at' ]; /** @@ -283,7 +292,7 @@ public function isNullableSetToNull(string $property): bool 'title' => 'setTitle', 'use_text_tags' => 'setUseTextTags', 'populate_auto_fill_fields' => 'setPopulateAutoFillFields', - 'expires_at' => 'setExpiresAt', + 'expires_at' => 'setExpiresAt' ]; /** @@ -315,7 +324,7 @@ public function isNullableSetToNull(string $property): bool 'title' => 'getTitle', 'use_text_tags' => 'getUseTextTags', 'populate_auto_fill_fields' => 'getPopulateAutoFillFields', - 'expires_at' => 'getExpiresAt', + 'expires_at' => 'getExpiresAt' ]; /** @@ -359,6 +368,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -369,10 +379,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('client_id', $data ?? [], null); $this->setIfExists('files', $data ?? [], null); @@ -400,33 +410,34 @@ public function __construct(array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestEditEmbeddedRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestEditEmbeddedRequest { /** @var SignatureRequestEditEmbeddedRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestEditEmbeddedRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -474,6 +485,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets client_id * @@ -491,10 +503,10 @@ public function getClientId() * * @return self */ - public function setClientId(string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -504,7 +516,7 @@ public function setClientId(string $client_id) /** * Gets files * - * @return SplFileObject[]|null + * @return \SplFileObject[]|null */ public function getFiles() { @@ -514,14 +526,14 @@ public function getFiles() /** * Sets files * - * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles(?array $files) + public function setFiles($files) { if (is_null($files)) { - throw new InvalidArgumentException('non-nullable files cannot be null'); + throw new \InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -545,10 +557,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls(?array $file_urls) + public function setFileUrls($file_urls) { if (is_null($file_urls)) { - throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -572,10 +584,10 @@ public function getSigners() * * @return self */ - public function setSigners(?array $signers) + public function setSigners($signers) { if (is_null($signers)) { - throw new InvalidArgumentException('non-nullable signers cannot be null'); + throw new \InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -599,10 +611,10 @@ public function getGroupedSigners() * * @return self */ - public function setGroupedSigners(?array $grouped_signers) + public function setGroupedSigners($grouped_signers) { if (is_null($grouped_signers)) { - throw new InvalidArgumentException('non-nullable grouped_signers cannot be null'); + throw new \InvalidArgumentException('non-nullable grouped_signers cannot be null'); } $this->container['grouped_signers'] = $grouped_signers; @@ -626,10 +638,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline(?bool $allow_decline) + public function setAllowDecline($allow_decline) { if (is_null($allow_decline)) { - throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -653,10 +665,10 @@ public function getAllowReassign() * * @return self */ - public function setAllowReassign(?bool $allow_reassign) + public function setAllowReassign($allow_reassign) { if (is_null($allow_reassign)) { - throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_reassign cannot be null'); } $this->container['allow_reassign'] = $allow_reassign; @@ -680,10 +692,10 @@ public function getAttachments() * * @return self */ - public function setAttachments(?array $attachments) + public function setAttachments($attachments) { if (is_null($attachments)) { - throw new InvalidArgumentException('non-nullable attachments cannot be null'); + throw new \InvalidArgumentException('non-nullable attachments cannot be null'); } $this->container['attachments'] = $attachments; @@ -703,14 +715,14 @@ public function getCcEmailAddresses() /** * Sets cc_email_addresses * - * @param string[]|null $cc_email_addresses the email addresses that should be CCed + * @param string[]|null $cc_email_addresses The email addresses that should be CCed. * * @return self */ - public function setCcEmailAddresses(?array $cc_email_addresses) + public function setCcEmailAddresses($cc_email_addresses) { if (is_null($cc_email_addresses)) { - throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + throw new \InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); } $this->container['cc_email_addresses'] = $cc_email_addresses; @@ -734,10 +746,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields(?array $custom_fields) + public function setCustomFields($custom_fields) { if (is_null($custom_fields)) { - throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -761,10 +773,10 @@ public function getFieldOptions() * * @return self */ - public function setFieldOptions(?SubFieldOptions $field_options) + public function setFieldOptions($field_options) { if (is_null($field_options)) { - throw new InvalidArgumentException('non-nullable field_options cannot be null'); + throw new \InvalidArgumentException('non-nullable field_options cannot be null'); } $this->container['field_options'] = $field_options; @@ -788,10 +800,10 @@ public function getFormFieldGroups() * * @return self */ - public function setFormFieldGroups(?array $form_field_groups) + public function setFormFieldGroups($form_field_groups) { if (is_null($form_field_groups)) { - throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); + throw new \InvalidArgumentException('non-nullable form_field_groups cannot be null'); } $this->container['form_field_groups'] = $form_field_groups; @@ -811,14 +823,14 @@ public function getFormFieldRules() /** * Sets form_field_rules * - * @param SubFormFieldRule[]|null $form_field_rules conditional Logic rules for fields defined in `form_fields_per_document` + * @param SubFormFieldRule[]|null $form_field_rules Conditional Logic rules for fields defined in `form_fields_per_document`. * * @return self */ - public function setFormFieldRules(?array $form_field_rules) + public function setFormFieldRules($form_field_rules) { if (is_null($form_field_rules)) { - throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); + throw new \InvalidArgumentException('non-nullable form_field_rules cannot be null'); } $this->container['form_field_rules'] = $form_field_rules; @@ -842,10 +854,10 @@ public function getFormFieldsPerDocument() * * @return self */ - public function setFormFieldsPerDocument(?array $form_fields_per_document) + public function setFormFieldsPerDocument($form_fields_per_document) { if (is_null($form_fields_per_document)) { - throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + throw new \InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); } $this->container['form_fields_per_document'] = $form_fields_per_document; @@ -869,10 +881,10 @@ public function getHideTextTags() * * @return self */ - public function setHideTextTags(?bool $hide_text_tags) + public function setHideTextTags($hide_text_tags) { if (is_null($hide_text_tags)) { - throw new InvalidArgumentException('non-nullable hide_text_tags cannot be null'); + throw new \InvalidArgumentException('non-nullable hide_text_tags cannot be null'); } $this->container['hide_text_tags'] = $hide_text_tags; @@ -892,17 +904,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message the custom message in the email that will be sent to the signers + * @param string|null $message The custom message in the email that will be sent to the signers. * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { - throw new InvalidArgumentException('non-nullable message cannot be null'); + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - if (mb_strlen($message) > 5000) { - throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestEditEmbeddedRequest., must be smaller than or equal to 5000.'); + if ((mb_strlen($message) > 5000)) { + throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestEditEmbeddedRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -927,12 +939,13 @@ public function getMetadata() * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } + $this->container['metadata'] = $metadata; return $this; @@ -955,10 +968,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions(?SubSigningOptions $signing_options) + public function setSigningOptions($signing_options) { if (is_null($signing_options)) { - throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -978,17 +991,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject the subject in the email that will be sent to the signers + * @param string|null $subject The subject in the email that will be sent to the signers. * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { - throw new InvalidArgumentException('non-nullable subject cannot be null'); + throw new \InvalidArgumentException('non-nullable subject cannot be null'); } - if (mb_strlen($subject) > 255) { - throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditEmbeddedRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($subject) > 255)) { + throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditEmbeddedRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -1013,10 +1026,10 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -1036,17 +1049,17 @@ public function getTitle() /** * Sets title * - * @param string|null $title the title you want to assign to the SignatureRequest + * @param string|null $title The title you want to assign to the SignatureRequest. * * @return self */ - public function setTitle(?string $title) + public function setTitle($title) { if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); + throw new \InvalidArgumentException('non-nullable title cannot be null'); } - if (mb_strlen($title) > 255) { - throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestEditEmbeddedRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($title) > 255)) { + throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestEditEmbeddedRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; @@ -1071,10 +1084,10 @@ public function getUseTextTags() * * @return self */ - public function setUseTextTags(?bool $use_text_tags) + public function setUseTextTags($use_text_tags) { if (is_null($use_text_tags)) { - throw new InvalidArgumentException('non-nullable use_text_tags cannot be null'); + throw new \InvalidArgumentException('non-nullable use_text_tags cannot be null'); } $this->container['use_text_tags'] = $use_text_tags; @@ -1098,10 +1111,10 @@ public function getPopulateAutoFillFields() * * @return self */ - public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) + public function setPopulateAutoFillFields($populate_auto_fill_fields) { if (is_null($populate_auto_fill_fields)) { - throw new InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); } $this->container['populate_auto_fill_fields'] = $populate_auto_fill_fields; @@ -1125,13 +1138,13 @@ public function getExpiresAt() * * @return self */ - public function setExpiresAt(?int $expires_at) + 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); + $index = array_search('expires_at', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1141,13 +1154,14 @@ public function setExpiresAt(?int $expires_at) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1156,11 +1170,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1171,8 +1185,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1185,9 +1201,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1195,12 +1213,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1229,3 +1247,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestEditEmbeddedWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestEditEmbeddedWithTemplateRequest.php index 07d174a7a..bb5eba50b 100644 --- a/sdks/php/src/Model/SignatureRequestEditEmbeddedWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestEditEmbeddedWithTemplateRequest.php @@ -1,11 +1,14 @@ */ -class SignatureRequestEditEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestEditEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestEditEmbeddedWithTemplateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template_ids' => 'string[]', 'client_id' => 'string', @@ -72,16 +73,16 @@ class SignatureRequestEditEmbeddedWithTemplateRequest implements ModelInterface, 'subject' => 'string', 'test_mode' => 'bool', 'title' => 'string', - 'populate_auto_fill_fields' => 'bool', + 'populate_auto_fill_fields' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template_ids' => null, 'client_id' => null, @@ -97,14 +98,14 @@ class SignatureRequestEditEmbeddedWithTemplateRequest implements ModelInterface, 'subject' => null, 'test_mode' => null, 'title' => null, - 'populate_auto_fill_fields' => null, + 'populate_auto_fill_fields' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'template_ids' => false, 'client_id' => false, @@ -120,14 +121,14 @@ class SignatureRequestEditEmbeddedWithTemplateRequest implements ModelInterface, 'subject' => false, 'test_mode' => false, 'title' => false, - 'populate_auto_fill_fields' => false, + 'populate_auto_fill_fields' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -152,6 +153,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -161,7 +164,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -171,7 +174,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -180,6 +183,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -188,6 +194,9 @@ 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 { @@ -215,7 +224,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'subject', 'test_mode' => 'test_mode', 'title' => 'title', - 'populate_auto_fill_fields' => 'populate_auto_fill_fields', + 'populate_auto_fill_fields' => 'populate_auto_fill_fields' ]; /** @@ -238,7 +247,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'setSubject', 'test_mode' => 'setTestMode', 'title' => 'setTitle', - 'populate_auto_fill_fields' => 'setPopulateAutoFillFields', + 'populate_auto_fill_fields' => 'setPopulateAutoFillFields' ]; /** @@ -261,7 +270,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'getSubject', 'test_mode' => 'getTestMode', 'title' => 'getTitle', - 'populate_auto_fill_fields' => 'getPopulateAutoFillFields', + 'populate_auto_fill_fields' => 'getPopulateAutoFillFields' ]; /** @@ -305,6 +314,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -315,10 +325,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('template_ids', $data ?? [], null); $this->setIfExists('client_id', $data ?? [], null); @@ -337,33 +347,34 @@ public function __construct(array $data = null) $this->setIfExists('populate_auto_fill_fields', $data ?? [], false); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestEditEmbeddedWithTemplateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestEditEmbeddedWithTemplateRequest { /** @var SignatureRequestEditEmbeddedWithTemplateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestEditEmbeddedWithTemplateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -417,6 +428,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets template_ids * @@ -430,14 +442,14 @@ public function getTemplateIds() /** * Sets template_ids * - * @param string[] $template_ids use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used + * @param string[] $template_ids Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. * * @return self */ - public function setTemplateIds(array $template_ids) + public function setTemplateIds($template_ids) { if (is_null($template_ids)) { - throw new InvalidArgumentException('non-nullable template_ids cannot be null'); + throw new \InvalidArgumentException('non-nullable template_ids cannot be null'); } $this->container['template_ids'] = $template_ids; @@ -461,10 +473,10 @@ public function getClientId() * * @return self */ - public function setClientId(string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -484,14 +496,14 @@ public function getSigners() /** * Sets signers * - * @param SubSignatureRequestTemplateSigner[] $signers add Signers to your Templated-based Signature Request + * @param SubSignatureRequestTemplateSigner[] $signers Add Signers to your Templated-based Signature Request. * * @return self */ - public function setSigners(array $signers) + public function setSigners($signers) { if (is_null($signers)) { - throw new InvalidArgumentException('non-nullable signers cannot be null'); + throw new \InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -515,10 +527,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline(?bool $allow_decline) + public function setAllowDecline($allow_decline) { if (is_null($allow_decline)) { - throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -542,10 +554,10 @@ public function getCcs() * * @return self */ - public function setCcs(?array $ccs) + public function setCcs($ccs) { if (is_null($ccs)) { - throw new InvalidArgumentException('non-nullable ccs cannot be null'); + throw new \InvalidArgumentException('non-nullable ccs cannot be null'); } $this->container['ccs'] = $ccs; @@ -569,10 +581,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields(?array $custom_fields) + public function setCustomFields($custom_fields) { if (is_null($custom_fields)) { - throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -582,7 +594,7 @@ public function setCustomFields(?array $custom_fields) /** * Gets files * - * @return SplFileObject[]|null + * @return \SplFileObject[]|null */ public function getFiles() { @@ -592,14 +604,14 @@ public function getFiles() /** * Sets files * - * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles(?array $files) + public function setFiles($files) { if (is_null($files)) { - throw new InvalidArgumentException('non-nullable files cannot be null'); + throw new \InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -623,10 +635,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls(?array $file_urls) + public function setFileUrls($file_urls) { if (is_null($file_urls)) { - throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -646,17 +658,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message the custom message in the email that will be sent to the signers + * @param string|null $message The custom message in the email that will be sent to the signers. * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { - throw new InvalidArgumentException('non-nullable message cannot be null'); + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - if (mb_strlen($message) > 5000) { - throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestEditEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); + if ((mb_strlen($message) > 5000)) { + throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestEditEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -681,12 +693,13 @@ public function getMetadata() * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } + $this->container['metadata'] = $metadata; return $this; @@ -709,10 +722,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions(?SubSigningOptions $signing_options) + public function setSigningOptions($signing_options) { if (is_null($signing_options)) { - throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -732,17 +745,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject the subject in the email that will be sent to the signers + * @param string|null $subject The subject in the email that will be sent to the signers. * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { - throw new InvalidArgumentException('non-nullable subject cannot be null'); + throw new \InvalidArgumentException('non-nullable subject cannot be null'); } - if (mb_strlen($subject) > 255) { - throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($subject) > 255)) { + throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -767,10 +780,10 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -790,17 +803,17 @@ public function getTitle() /** * Sets title * - * @param string|null $title the title you want to assign to the SignatureRequest + * @param string|null $title The title you want to assign to the SignatureRequest. * * @return self */ - public function setTitle(?string $title) + public function setTitle($title) { if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); + throw new \InvalidArgumentException('non-nullable title cannot be null'); } - if (mb_strlen($title) > 255) { - throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestEditEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($title) > 255)) { + throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestEditEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; @@ -825,22 +838,23 @@ public function getPopulateAutoFillFields() * * @return self */ - public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) + public function setPopulateAutoFillFields($populate_auto_fill_fields) { if (is_null($populate_auto_fill_fields)) { - throw new InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); } $this->container['populate_auto_fill_fields'] = $populate_auto_fill_fields; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -849,11 +863,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -864,8 +878,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -878,9 +894,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -888,12 +906,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -922,3 +940,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestEditRequest.php b/sdks/php/src/Model/SignatureRequestEditRequest.php index bc1be125a..4529f58c0 100644 --- a/sdks/php/src/Model/SignatureRequestEditRequest.php +++ b/sdks/php/src/Model/SignatureRequestEditRequest.php @@ -1,11 +1,14 @@ */ -class SignatureRequestEditRequest implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestEditRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestEditRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'files' => '\SplFileObject[]', 'file_urls' => 'string[]', @@ -82,16 +83,16 @@ class SignatureRequestEditRequest implements ModelInterface, ArrayAccess, JsonSe 'test_mode' => 'bool', 'title' => 'string', 'use_text_tags' => 'bool', - 'expires_at' => 'int', + 'expires_at' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'files' => 'binary', 'file_urls' => null, @@ -117,14 +118,14 @@ class SignatureRequestEditRequest implements ModelInterface, ArrayAccess, JsonSe 'test_mode' => null, 'title' => null, 'use_text_tags' => null, - 'expires_at' => null, + 'expires_at' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'files' => false, 'file_urls' => false, @@ -150,14 +151,14 @@ class SignatureRequestEditRequest implements ModelInterface, ArrayAccess, JsonSe 'test_mode' => false, 'title' => false, 'use_text_tags' => false, - 'expires_at' => true, + 'expires_at' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -182,6 +183,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -191,7 +194,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -201,7 +204,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -210,6 +213,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -218,6 +224,9 @@ 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 { @@ -255,7 +264,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'test_mode', 'title' => 'title', 'use_text_tags' => 'use_text_tags', - 'expires_at' => 'expires_at', + 'expires_at' => 'expires_at' ]; /** @@ -288,7 +297,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'setTestMode', 'title' => 'setTitle', 'use_text_tags' => 'setUseTextTags', - 'expires_at' => 'setExpiresAt', + 'expires_at' => 'setExpiresAt' ]; /** @@ -321,7 +330,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'getTestMode', 'title' => 'getTitle', 'use_text_tags' => 'getUseTextTags', - 'expires_at' => 'getExpiresAt', + 'expires_at' => 'getExpiresAt' ]; /** @@ -365,6 +374,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -375,10 +385,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('files', $data ?? [], null); $this->setIfExists('file_urls', $data ?? [], null); @@ -407,33 +417,34 @@ public function __construct(array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestEditRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestEditRequest { /** @var SignatureRequestEditRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestEditRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -478,10 +489,11 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets files * - * @return SplFileObject[]|null + * @return \SplFileObject[]|null */ public function getFiles() { @@ -491,14 +503,14 @@ public function getFiles() /** * Sets files * - * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles(?array $files) + public function setFiles($files) { if (is_null($files)) { - throw new InvalidArgumentException('non-nullable files cannot be null'); + throw new \InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -522,10 +534,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls(?array $file_urls) + public function setFileUrls($file_urls) { if (is_null($file_urls)) { - throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -549,10 +561,10 @@ public function getSigners() * * @return self */ - public function setSigners(?array $signers) + public function setSigners($signers) { if (is_null($signers)) { - throw new InvalidArgumentException('non-nullable signers cannot be null'); + throw new \InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -576,10 +588,10 @@ public function getGroupedSigners() * * @return self */ - public function setGroupedSigners(?array $grouped_signers) + public function setGroupedSigners($grouped_signers) { if (is_null($grouped_signers)) { - throw new InvalidArgumentException('non-nullable grouped_signers cannot be null'); + throw new \InvalidArgumentException('non-nullable grouped_signers cannot be null'); } $this->container['grouped_signers'] = $grouped_signers; @@ -603,10 +615,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline(?bool $allow_decline) + public function setAllowDecline($allow_decline) { if (is_null($allow_decline)) { - throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -630,10 +642,10 @@ public function getAllowReassign() * * @return self */ - public function setAllowReassign(?bool $allow_reassign) + public function setAllowReassign($allow_reassign) { if (is_null($allow_reassign)) { - throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_reassign cannot be null'); } $this->container['allow_reassign'] = $allow_reassign; @@ -657,10 +669,10 @@ public function getAttachments() * * @return self */ - public function setAttachments(?array $attachments) + public function setAttachments($attachments) { if (is_null($attachments)) { - throw new InvalidArgumentException('non-nullable attachments cannot be null'); + throw new \InvalidArgumentException('non-nullable attachments cannot be null'); } $this->container['attachments'] = $attachments; @@ -680,14 +692,14 @@ public function getCcEmailAddresses() /** * Sets cc_email_addresses * - * @param string[]|null $cc_email_addresses the email addresses that should be CCed + * @param string[]|null $cc_email_addresses The email addresses that should be CCed. * * @return self */ - public function setCcEmailAddresses(?array $cc_email_addresses) + public function setCcEmailAddresses($cc_email_addresses) { if (is_null($cc_email_addresses)) { - throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + throw new \InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); } $this->container['cc_email_addresses'] = $cc_email_addresses; @@ -711,10 +723,10 @@ public function getClientId() * * @return self */ - public function setClientId(?string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -738,10 +750,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields(?array $custom_fields) + public function setCustomFields($custom_fields) { if (is_null($custom_fields)) { - throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -765,10 +777,10 @@ public function getFieldOptions() * * @return self */ - public function setFieldOptions(?SubFieldOptions $field_options) + public function setFieldOptions($field_options) { if (is_null($field_options)) { - throw new InvalidArgumentException('non-nullable field_options cannot be null'); + throw new \InvalidArgumentException('non-nullable field_options cannot be null'); } $this->container['field_options'] = $field_options; @@ -792,10 +804,10 @@ public function getFormFieldGroups() * * @return self */ - public function setFormFieldGroups(?array $form_field_groups) + public function setFormFieldGroups($form_field_groups) { if (is_null($form_field_groups)) { - throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); + throw new \InvalidArgumentException('non-nullable form_field_groups cannot be null'); } $this->container['form_field_groups'] = $form_field_groups; @@ -815,14 +827,14 @@ public function getFormFieldRules() /** * Sets form_field_rules * - * @param SubFormFieldRule[]|null $form_field_rules conditional Logic rules for fields defined in `form_fields_per_document` + * @param SubFormFieldRule[]|null $form_field_rules Conditional Logic rules for fields defined in `form_fields_per_document`. * * @return self */ - public function setFormFieldRules(?array $form_field_rules) + public function setFormFieldRules($form_field_rules) { if (is_null($form_field_rules)) { - throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); + throw new \InvalidArgumentException('non-nullable form_field_rules cannot be null'); } $this->container['form_field_rules'] = $form_field_rules; @@ -846,10 +858,10 @@ public function getFormFieldsPerDocument() * * @return self */ - public function setFormFieldsPerDocument(?array $form_fields_per_document) + public function setFormFieldsPerDocument($form_fields_per_document) { if (is_null($form_fields_per_document)) { - throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + throw new \InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); } $this->container['form_fields_per_document'] = $form_fields_per_document; @@ -873,10 +885,10 @@ public function getHideTextTags() * * @return self */ - public function setHideTextTags(?bool $hide_text_tags) + public function setHideTextTags($hide_text_tags) { if (is_null($hide_text_tags)) { - throw new InvalidArgumentException('non-nullable hide_text_tags cannot be null'); + throw new \InvalidArgumentException('non-nullable hide_text_tags cannot be null'); } $this->container['hide_text_tags'] = $hide_text_tags; @@ -900,10 +912,10 @@ public function getIsEid() * * @return self */ - public function setIsEid(?bool $is_eid) + public function setIsEid($is_eid) { if (is_null($is_eid)) { - throw new InvalidArgumentException('non-nullable is_eid cannot be null'); + throw new \InvalidArgumentException('non-nullable is_eid cannot be null'); } $this->container['is_eid'] = $is_eid; @@ -923,17 +935,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message the custom message in the email that will be sent to the signers + * @param string|null $message The custom message in the email that will be sent to the signers. * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { - throw new InvalidArgumentException('non-nullable message cannot be null'); + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - if (mb_strlen($message) > 5000) { - throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestEditRequest., must be smaller than or equal to 5000.'); + if ((mb_strlen($message) > 5000)) { + throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestEditRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -958,12 +970,13 @@ public function getMetadata() * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } + $this->container['metadata'] = $metadata; return $this; @@ -986,10 +999,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions(?SubSigningOptions $signing_options) + public function setSigningOptions($signing_options) { if (is_null($signing_options)) { - throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -1009,14 +1022,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign + * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. * * @return self */ - public function setSigningRedirectUrl(?string $signing_redirect_url) + public function setSigningRedirectUrl($signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -1036,17 +1049,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject the subject in the email that will be sent to the signers + * @param string|null $subject The subject in the email that will be sent to the signers. * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { - throw new InvalidArgumentException('non-nullable subject cannot be null'); + throw new \InvalidArgumentException('non-nullable subject cannot be null'); } - if (mb_strlen($subject) > 255) { - throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($subject) > 255)) { + throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -1071,10 +1084,10 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -1094,17 +1107,17 @@ public function getTitle() /** * Sets title * - * @param string|null $title the title you want to assign to the SignatureRequest + * @param string|null $title The title you want to assign to the SignatureRequest. * * @return self */ - public function setTitle(?string $title) + public function setTitle($title) { if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); + throw new \InvalidArgumentException('non-nullable title cannot be null'); } - if (mb_strlen($title) > 255) { - throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestEditRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($title) > 255)) { + throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestEditRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; @@ -1129,10 +1142,10 @@ public function getUseTextTags() * * @return self */ - public function setUseTextTags(?bool $use_text_tags) + public function setUseTextTags($use_text_tags) { if (is_null($use_text_tags)) { - throw new InvalidArgumentException('non-nullable use_text_tags cannot be null'); + throw new \InvalidArgumentException('non-nullable use_text_tags cannot be null'); } $this->container['use_text_tags'] = $use_text_tags; @@ -1156,13 +1169,13 @@ public function getExpiresAt() * * @return self */ - public function setExpiresAt(?int $expires_at) + 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); + $index = array_search('expires_at', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1172,13 +1185,14 @@ public function setExpiresAt(?int $expires_at) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1187,11 +1201,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1202,8 +1216,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1216,9 +1232,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1226,12 +1244,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1260,3 +1278,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestEditWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestEditWithTemplateRequest.php index cda7360db..39c50c802 100644 --- a/sdks/php/src/Model/SignatureRequestEditWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestEditWithTemplateRequest.php @@ -1,11 +1,14 @@ */ -class SignatureRequestEditWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestEditWithTemplateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestEditWithTemplateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template_ids' => 'string[]', 'signers' => '\Dropbox\Sign\Model\SubSignatureRequestTemplateSigner[]', @@ -74,16 +75,16 @@ class SignatureRequestEditWithTemplateRequest implements ModelInterface, ArrayAc 'signing_redirect_url' => 'string', 'subject' => 'string', 'test_mode' => 'bool', - 'title' => 'string', + 'title' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template_ids' => null, 'signers' => null, @@ -100,14 +101,14 @@ class SignatureRequestEditWithTemplateRequest implements ModelInterface, ArrayAc 'signing_redirect_url' => null, 'subject' => null, 'test_mode' => null, - 'title' => null, + 'title' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'template_ids' => false, 'signers' => false, @@ -124,14 +125,14 @@ class SignatureRequestEditWithTemplateRequest implements ModelInterface, ArrayAc 'signing_redirect_url' => false, 'subject' => false, 'test_mode' => false, - 'title' => false, + 'title' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -156,6 +157,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -165,7 +168,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -175,7 +178,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -184,6 +187,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -192,6 +198,9 @@ 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 { @@ -220,7 +229,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'signing_redirect_url', 'subject' => 'subject', 'test_mode' => 'test_mode', - 'title' => 'title', + 'title' => 'title' ]; /** @@ -244,7 +253,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'setSigningRedirectUrl', 'subject' => 'setSubject', 'test_mode' => 'setTestMode', - 'title' => 'setTitle', + 'title' => 'setTitle' ]; /** @@ -268,7 +277,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'getSigningRedirectUrl', 'subject' => 'getSubject', 'test_mode' => 'getTestMode', - 'title' => 'getTitle', + 'title' => 'getTitle' ]; /** @@ -312,6 +321,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -322,10 +332,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('template_ids', $data ?? [], null); $this->setIfExists('signers', $data ?? [], null); @@ -345,33 +355,34 @@ public function __construct(array $data = null) $this->setIfExists('title', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestEditWithTemplateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestEditWithTemplateRequest { /** @var SignatureRequestEditWithTemplateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestEditWithTemplateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -422,6 +433,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets template_ids * @@ -435,14 +447,14 @@ public function getTemplateIds() /** * Sets template_ids * - * @param string[] $template_ids use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used + * @param string[] $template_ids Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. * * @return self */ - public function setTemplateIds(array $template_ids) + public function setTemplateIds($template_ids) { if (is_null($template_ids)) { - throw new InvalidArgumentException('non-nullable template_ids cannot be null'); + throw new \InvalidArgumentException('non-nullable template_ids cannot be null'); } $this->container['template_ids'] = $template_ids; @@ -462,14 +474,14 @@ public function getSigners() /** * Sets signers * - * @param SubSignatureRequestTemplateSigner[] $signers add Signers to your Templated-based Signature Request + * @param SubSignatureRequestTemplateSigner[] $signers Add Signers to your Templated-based Signature Request. * * @return self */ - public function setSigners(array $signers) + public function setSigners($signers) { if (is_null($signers)) { - throw new InvalidArgumentException('non-nullable signers cannot be null'); + throw new \InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -493,10 +505,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline(?bool $allow_decline) + public function setAllowDecline($allow_decline) { if (is_null($allow_decline)) { - throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -520,10 +532,10 @@ public function getCcs() * * @return self */ - public function setCcs(?array $ccs) + public function setCcs($ccs) { if (is_null($ccs)) { - throw new InvalidArgumentException('non-nullable ccs cannot be null'); + throw new \InvalidArgumentException('non-nullable ccs cannot be null'); } $this->container['ccs'] = $ccs; @@ -547,10 +559,10 @@ public function getClientId() * * @return self */ - public function setClientId(?string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -574,10 +586,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields(?array $custom_fields) + public function setCustomFields($custom_fields) { if (is_null($custom_fields)) { - throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -587,7 +599,7 @@ public function setCustomFields(?array $custom_fields) /** * Gets files * - * @return SplFileObject[]|null + * @return \SplFileObject[]|null */ public function getFiles() { @@ -597,14 +609,14 @@ public function getFiles() /** * Sets files * - * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles(?array $files) + public function setFiles($files) { if (is_null($files)) { - throw new InvalidArgumentException('non-nullable files cannot be null'); + throw new \InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -628,10 +640,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls(?array $file_urls) + public function setFileUrls($file_urls) { if (is_null($file_urls)) { - throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -655,10 +667,10 @@ public function getIsEid() * * @return self */ - public function setIsEid(?bool $is_eid) + public function setIsEid($is_eid) { if (is_null($is_eid)) { - throw new InvalidArgumentException('non-nullable is_eid cannot be null'); + throw new \InvalidArgumentException('non-nullable is_eid cannot be null'); } $this->container['is_eid'] = $is_eid; @@ -678,17 +690,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message the custom message in the email that will be sent to the signers + * @param string|null $message The custom message in the email that will be sent to the signers. * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { - throw new InvalidArgumentException('non-nullable message cannot be null'); + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - if (mb_strlen($message) > 5000) { - throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestEditWithTemplateRequest., must be smaller than or equal to 5000.'); + if ((mb_strlen($message) > 5000)) { + throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestEditWithTemplateRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -713,12 +725,13 @@ public function getMetadata() * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } + $this->container['metadata'] = $metadata; return $this; @@ -741,10 +754,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions(?SubSigningOptions $signing_options) + public function setSigningOptions($signing_options) { if (is_null($signing_options)) { - throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -764,14 +777,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign + * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. * * @return self */ - public function setSigningRedirectUrl(?string $signing_redirect_url) + public function setSigningRedirectUrl($signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -791,17 +804,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject the subject in the email that will be sent to the signers + * @param string|null $subject The subject in the email that will be sent to the signers. * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { - throw new InvalidArgumentException('non-nullable subject cannot be null'); + throw new \InvalidArgumentException('non-nullable subject cannot be null'); } - if (mb_strlen($subject) > 255) { - throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditWithTemplateRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($subject) > 255)) { + throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -826,10 +839,10 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -849,30 +862,31 @@ public function getTitle() /** * Sets title * - * @param string|null $title the title you want to assign to the SignatureRequest + * @param string|null $title The title you want to assign to the SignatureRequest. * * @return self */ - public function setTitle(?string $title) + public function setTitle($title) { if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); + throw new \InvalidArgumentException('non-nullable title cannot be null'); } - if (mb_strlen($title) > 255) { - throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestEditWithTemplateRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($title) > 255)) { + throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestEditWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -881,11 +895,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -896,8 +910,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -910,9 +926,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -920,12 +938,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -954,3 +972,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestGetResponse.php b/sdks/php/src/Model/SignatureRequestGetResponse.php index 97f5f7c9f..404d339e2 100644 --- a/sdks/php/src/Model/SignatureRequestGetResponse.php +++ b/sdks/php/src/Model/SignatureRequestGetResponse.php @@ -1,11 +1,14 @@ */ -class SignatureRequestGetResponse implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestGetResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestGetResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'signature_request' => '\Dropbox\Sign\Model\SignatureRequestResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'signature_request' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'signature_request' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'signature_request' => 'signature_request', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'signature_request' => 'setSignatureRequest', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'signature_request' => 'getSignatureRequest', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('signature_request', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestGetResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestGetResponse { /** @var SignatureRequestGetResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestGetResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,6 +319,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets signature_request * @@ -324,10 +337,10 @@ public function getSignatureRequest() * * @return self */ - public function setSignatureRequest(SignatureRequestResponse $signature_request) + public function setSignatureRequest($signature_request) { if (is_null($signature_request)) { - throw new InvalidArgumentException('non-nullable signature_request cannot be null'); + throw new \InvalidArgumentException('non-nullable signature_request cannot be null'); } $this->container['signature_request'] = $signature_request; @@ -347,26 +360,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -375,11 +389,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,8 +404,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -404,9 +420,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -414,12 +432,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -448,3 +466,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestListResponse.php b/sdks/php/src/Model/SignatureRequestListResponse.php index 659908071..9a47907c9 100644 --- a/sdks/php/src/Model/SignatureRequestListResponse.php +++ b/sdks/php/src/Model/SignatureRequestListResponse.php @@ -1,11 +1,14 @@ */ -class SignatureRequestListResponse implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestListResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestListResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'signature_requests' => '\Dropbox\Sign\Model\SignatureRequestResponse[]', 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'signature_requests' => null, 'list_info' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'signature_requests' => false, 'list_info' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'signature_requests' => 'signature_requests', 'list_info' => 'list_info', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'signature_requests' => 'setSignatureRequests', 'list_info' => 'setListInfo', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'signature_requests' => 'getSignatureRequests', 'list_info' => 'getListInfo', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -232,6 +242,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -242,43 +253,44 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('signature_requests', $data ?? [], null); $this->setIfExists('list_info', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestListResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestListResponse { /** @var SignatureRequestListResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestListResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -317,6 +329,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets signature_requests * @@ -330,14 +343,14 @@ public function getSignatureRequests() /** * Sets signature_requests * - * @param SignatureRequestResponse[] $signature_requests contains information about signature requests + * @param SignatureRequestResponse[] $signature_requests Contains information about signature requests. * * @return self */ - public function setSignatureRequests(array $signature_requests) + public function setSignatureRequests($signature_requests) { if (is_null($signature_requests)) { - throw new InvalidArgumentException('non-nullable signature_requests cannot be null'); + throw new \InvalidArgumentException('non-nullable signature_requests cannot be null'); } $this->container['signature_requests'] = $signature_requests; @@ -361,10 +374,10 @@ public function getListInfo() * * @return self */ - public function setListInfo(ListInfoResponse $list_info) + public function setListInfo($list_info) { if (is_null($list_info)) { - throw new InvalidArgumentException('non-nullable list_info cannot be null'); + throw new \InvalidArgumentException('non-nullable list_info cannot be null'); } $this->container['list_info'] = $list_info; @@ -384,26 +397,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -412,11 +426,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -427,8 +441,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -441,9 +457,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -451,12 +469,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -485,3 +503,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestRemindRequest.php b/sdks/php/src/Model/SignatureRequestRemindRequest.php index 5662351ef..8e50feac9 100644 --- a/sdks/php/src/Model/SignatureRequestRemindRequest.php +++ b/sdks/php/src/Model/SignatureRequestRemindRequest.php @@ -1,11 +1,14 @@ */ -class SignatureRequestRemindRequest implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestRemindRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestRemindRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'email_address' => 'string', - 'name' => 'string', + 'name' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'email_address' => 'email', - 'name' => null, + 'name' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'email_address' => false, - 'name' => false, + 'name' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'email_address' => 'email_address', - 'name' => 'name', + 'name' => 'name' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'email_address' => 'setEmailAddress', - 'name' => 'setName', + 'name' => 'setName' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'email_address' => 'getEmailAddress', - 'name' => 'getName', + 'name' => 'getName' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('email_address', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestRemindRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestRemindRequest { /** @var SignatureRequestRemindRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestRemindRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,6 +319,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets email_address * @@ -320,14 +333,14 @@ public function getEmailAddress() /** * Sets email_address * - * @param string $email_address the email address of the signer to send a reminder to + * @param string $email_address The email address of the signer to send a reminder to. * * @return self */ - public function setEmailAddress(string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -351,22 +364,23 @@ public function getName() * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -375,11 +389,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,8 +404,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -404,9 +420,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -414,12 +432,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -448,3 +466,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestResponse.php b/sdks/php/src/Model/SignatureRequestResponse.php index 08442f436..9ce1025ef 100644 --- a/sdks/php/src/Model/SignatureRequestResponse.php +++ b/sdks/php/src/Model/SignatureRequestResponse.php @@ -1,11 +1,14 @@ */ -class SignatureRequestResponse implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'test_mode' => 'bool', 'signature_request_id' => 'string', @@ -82,16 +84,16 @@ class SignatureRequestResponse implements ModelInterface, ArrayAccess, JsonSeria 'attachments' => '\Dropbox\Sign\Model\SignatureRequestResponseAttachment[]', 'response_data' => '\Dropbox\Sign\Model\SignatureRequestResponseDataBase[]', 'signatures' => '\Dropbox\Sign\Model\SignatureRequestResponseSignatures[]', - 'bulk_send_job_id' => 'string', + 'bulk_send_job_id' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'test_mode' => null, 'signature_request_id' => null, @@ -117,14 +119,14 @@ class SignatureRequestResponse implements ModelInterface, ArrayAccess, JsonSeria 'attachments' => null, 'response_data' => null, 'signatures' => null, - 'bulk_send_job_id' => null, + 'bulk_send_job_id' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'test_mode' => false, 'signature_request_id' => false, @@ -150,14 +152,14 @@ class SignatureRequestResponse implements ModelInterface, ArrayAccess, JsonSeria 'attachments' => true, 'response_data' => true, 'signatures' => false, - 'bulk_send_job_id' => true, + 'bulk_send_job_id' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -182,6 +184,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -191,7 +195,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -201,7 +205,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -210,6 +214,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -218,6 +225,9 @@ 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 { @@ -255,7 +265,7 @@ public function isNullableSetToNull(string $property): bool 'attachments' => 'attachments', 'response_data' => 'response_data', 'signatures' => 'signatures', - 'bulk_send_job_id' => 'bulk_send_job_id', + 'bulk_send_job_id' => 'bulk_send_job_id' ]; /** @@ -288,7 +298,7 @@ public function isNullableSetToNull(string $property): bool 'attachments' => 'setAttachments', 'response_data' => 'setResponseData', 'signatures' => 'setSignatures', - 'bulk_send_job_id' => 'setBulkSendJobId', + 'bulk_send_job_id' => 'setBulkSendJobId' ]; /** @@ -321,7 +331,7 @@ public function isNullableSetToNull(string $property): bool 'attachments' => 'getAttachments', 'response_data' => 'getResponseData', 'signatures' => 'getSignatures', - 'bulk_send_job_id' => 'getBulkSendJobId', + 'bulk_send_job_id' => 'getBulkSendJobId' ]; /** @@ -365,6 +375,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -375,10 +386,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('test_mode', $data ?? [], false); $this->setIfExists('signature_request_id', $data ?? [], null); @@ -407,33 +418,34 @@ public function __construct(array $data = null) $this->setIfExists('bulk_send_job_id', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestResponse { /** @var SignatureRequestResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -450,7 +462,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -464,6 +478,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets test_mode * @@ -481,10 +496,10 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -504,14 +519,14 @@ public function getSignatureRequestId() /** * Sets signature_request_id * - * @param string|null $signature_request_id the id of the SignatureRequest + * @param string|null $signature_request_id The id of the SignatureRequest. * * @return self */ - public function setSignatureRequestId(?string $signature_request_id) + public function setSignatureRequestId($signature_request_id) { if (is_null($signature_request_id)) { - throw new InvalidArgumentException('non-nullable signature_request_id cannot be null'); + throw new \InvalidArgumentException('non-nullable signature_request_id cannot be null'); } $this->container['signature_request_id'] = $signature_request_id; @@ -531,17 +546,17 @@ public function getRequesterEmailAddress() /** * Sets requester_email_address * - * @param string|null $requester_email_address the email address of the initiator of the SignatureRequest + * @param string|null $requester_email_address The email address of the initiator of the SignatureRequest. * * @return self */ - public function setRequesterEmailAddress(?string $requester_email_address) + public function setRequesterEmailAddress($requester_email_address) { if (is_null($requester_email_address)) { array_push($this->openAPINullablesSetToNull, 'requester_email_address'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('requester_email_address', $nullablesSetToNull); + $index = array_search('requester_email_address', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -565,14 +580,14 @@ public function getTitle() /** * Sets title * - * @param string|null $title the title the specified Account uses for the SignatureRequest + * @param string|null $title The title the specified Account uses for the SignatureRequest. * * @return self */ - public function setTitle(?string $title) + public function setTitle($title) { if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); + throw new \InvalidArgumentException('non-nullable title cannot be null'); } $this->container['title'] = $title; @@ -592,14 +607,14 @@ public function getOriginalTitle() /** * Sets original_title * - * @param string|null $original_title default Label for account + * @param string|null $original_title Default Label for account. * * @return self */ - public function setOriginalTitle(?string $original_title) + public function setOriginalTitle($original_title) { if (is_null($original_title)) { - throw new InvalidArgumentException('non-nullable original_title cannot be null'); + throw new \InvalidArgumentException('non-nullable original_title cannot be null'); } $this->container['original_title'] = $original_title; @@ -619,17 +634,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject the subject in the email that was initially sent to the signers + * @param string|null $subject The subject in the email that was initially sent to the signers. * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { array_push($this->openAPINullablesSetToNull, 'subject'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('subject', $nullablesSetToNull); + $index = array_search('subject', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -653,17 +668,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message the custom message in the email that was initially sent to the signers + * @param string|null $message The custom message in the email that was initially sent to the signers. * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { array_push($this->openAPINullablesSetToNull, 'message'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('message', $nullablesSetToNull); + $index = array_search('message', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -687,14 +702,14 @@ public function getMetadata() /** * Sets metadata * - * @param array|null $metadata the metadata attached to the signature request + * @param array|null $metadata The metadata attached to the signature request. * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } $this->container['metadata'] = $metadata; @@ -714,14 +729,14 @@ public function getCreatedAt() /** * Sets created_at * - * @param int|null $created_at time the signature request was created + * @param int|null $created_at Time the signature request was created. * * @return self */ - public function setCreatedAt(?int $created_at) + public function setCreatedAt($created_at) { if (is_null($created_at)) { - throw new InvalidArgumentException('non-nullable created_at cannot be null'); + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } $this->container['created_at'] = $created_at; @@ -745,13 +760,13 @@ public function getExpiresAt() * * @return self */ - public function setExpiresAt(?int $expires_at) + 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); + $index = array_search('expires_at', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -775,14 +790,14 @@ public function getIsComplete() /** * Sets is_complete * - * @param bool|null $is_complete whether or not the SignatureRequest has been fully executed by all signers + * @param bool|null $is_complete Whether or not the SignatureRequest has been fully executed by all signers. * * @return self */ - public function setIsComplete(?bool $is_complete) + public function setIsComplete($is_complete) { if (is_null($is_complete)) { - throw new InvalidArgumentException('non-nullable is_complete cannot be null'); + throw new \InvalidArgumentException('non-nullable is_complete cannot be null'); } $this->container['is_complete'] = $is_complete; @@ -802,14 +817,14 @@ public function getIsDeclined() /** * Sets is_declined * - * @param bool|null $is_declined whether or not the SignatureRequest has been declined by a signer + * @param bool|null $is_declined Whether or not the SignatureRequest has been declined by a signer. * * @return self */ - public function setIsDeclined(?bool $is_declined) + public function setIsDeclined($is_declined) { if (is_null($is_declined)) { - throw new InvalidArgumentException('non-nullable is_declined cannot be null'); + throw new \InvalidArgumentException('non-nullable is_declined cannot be null'); } $this->container['is_declined'] = $is_declined; @@ -829,14 +844,14 @@ public function getHasError() /** * Sets has_error * - * @param bool|null $has_error whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings) + * @param bool|null $has_error Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). * * @return self */ - public function setHasError(?bool $has_error) + public function setHasError($has_error) { if (is_null($has_error)) { - throw new InvalidArgumentException('non-nullable has_error cannot be null'); + throw new \InvalidArgumentException('non-nullable has_error cannot be null'); } $this->container['has_error'] = $has_error; @@ -856,14 +871,14 @@ public function getFilesUrl() /** * Sets files_url * - * @param string|null $files_url the URL where a copy of the request's documents can be downloaded + * @param string|null $files_url The URL where a copy of the request's documents can be downloaded. * * @return self */ - public function setFilesUrl(?string $files_url) + public function setFilesUrl($files_url) { if (is_null($files_url)) { - throw new InvalidArgumentException('non-nullable files_url cannot be null'); + throw new \InvalidArgumentException('non-nullable files_url cannot be null'); } $this->container['files_url'] = $files_url; @@ -887,13 +902,13 @@ public function getSigningUrl() * * @return self */ - public function setSigningUrl(?string $signing_url) + public function setSigningUrl($signing_url) { if (is_null($signing_url)) { array_push($this->openAPINullablesSetToNull, 'signing_url'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signing_url', $nullablesSetToNull); + $index = array_search('signing_url', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -917,14 +932,14 @@ public function getDetailsUrl() /** * Sets details_url * - * @param string|null $details_url the URL where the requester and the signers can view the current status of the SignatureRequest + * @param string|null $details_url The URL where the requester and the signers can view the current status of the SignatureRequest. * * @return self */ - public function setDetailsUrl(?string $details_url) + public function setDetailsUrl($details_url) { if (is_null($details_url)) { - throw new InvalidArgumentException('non-nullable details_url cannot be null'); + throw new \InvalidArgumentException('non-nullable details_url cannot be null'); } $this->container['details_url'] = $details_url; @@ -948,10 +963,10 @@ public function getCcEmailAddresses() * * @return self */ - public function setCcEmailAddresses(?array $cc_email_addresses) + public function setCcEmailAddresses($cc_email_addresses) { if (is_null($cc_email_addresses)) { - throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + throw new \InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); } $this->container['cc_email_addresses'] = $cc_email_addresses; @@ -971,17 +986,17 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url the URL you want the signer redirected to after they successfully sign + * @param string|null $signing_redirect_url The URL you want the signer redirected to after they successfully sign. * * @return self */ - public function setSigningRedirectUrl(?string $signing_redirect_url) + public function setSigningRedirectUrl($signing_redirect_url) { if (is_null($signing_redirect_url)) { array_push($this->openAPINullablesSetToNull, 'signing_redirect_url'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signing_redirect_url', $nullablesSetToNull); + $index = array_search('signing_redirect_url', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1009,13 +1024,13 @@ public function getFinalCopyUri() * * @return self */ - public function setFinalCopyUri(?string $final_copy_uri) + public function setFinalCopyUri($final_copy_uri) { if (is_null($final_copy_uri)) { array_push($this->openAPINullablesSetToNull, 'final_copy_uri'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('final_copy_uri', $nullablesSetToNull); + $index = array_search('final_copy_uri', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1039,17 +1054,17 @@ public function getTemplateIds() /** * Sets template_ids * - * @param string[]|null $template_ids templates IDs used in this SignatureRequest (if any) + * @param string[]|null $template_ids Templates IDs used in this SignatureRequest (if any). * * @return self */ - public function setTemplateIds(?array $template_ids) + public function setTemplateIds($template_ids) { if (is_null($template_ids)) { array_push($this->openAPINullablesSetToNull, 'template_ids'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('template_ids', $nullablesSetToNull); + $index = array_search('template_ids', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1077,13 +1092,13 @@ public function getCustomFields() * * @return self */ - public function setCustomFields(?array $custom_fields) + public function setCustomFields($custom_fields) { if (is_null($custom_fields)) { array_push($this->openAPINullablesSetToNull, 'custom_fields'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('custom_fields', $nullablesSetToNull); + $index = array_search('custom_fields', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1107,17 +1122,17 @@ public function getAttachments() /** * Sets attachments * - * @param SignatureRequestResponseAttachment[]|null $attachments signer attachments + * @param SignatureRequestResponseAttachment[]|null $attachments Signer attachments. * * @return self */ - public function setAttachments(?array $attachments) + public function setAttachments($attachments) { if (is_null($attachments)) { array_push($this->openAPINullablesSetToNull, 'attachments'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('attachments', $nullablesSetToNull); + $index = array_search('attachments', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1141,17 +1156,17 @@ public function getResponseData() /** * Sets response_data * - * @param SignatureRequestResponseDataBase[]|null $response_data an array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers + * @param SignatureRequestResponseDataBase[]|null $response_data An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. * * @return self */ - public function setResponseData(?array $response_data) + public function setResponseData($response_data) { if (is_null($response_data)) { array_push($this->openAPINullablesSetToNull, 'response_data'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('response_data', $nullablesSetToNull); + $index = array_search('response_data', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1175,14 +1190,14 @@ public function getSignatures() /** * Sets signatures * - * @param SignatureRequestResponseSignatures[]|null $signatures an array of signature objects, 1 for each signer + * @param SignatureRequestResponseSignatures[]|null $signatures An array of signature objects, 1 for each signer. * * @return self */ - public function setSignatures(?array $signatures) + public function setSignatures($signatures) { if (is_null($signatures)) { - throw new InvalidArgumentException('non-nullable signatures cannot be null'); + throw new \InvalidArgumentException('non-nullable signatures cannot be null'); } $this->container['signatures'] = $signatures; @@ -1202,17 +1217,17 @@ public function getBulkSendJobId() /** * Sets bulk_send_job_id * - * @param string|null $bulk_send_job_id the ID of the Bulk Send job which sent the signature request, if applicable + * @param string|null $bulk_send_job_id The ID of the Bulk Send job which sent the signature request, if applicable. * * @return self */ - public function setBulkSendJobId(?string $bulk_send_job_id) + public function setBulkSendJobId($bulk_send_job_id) { if (is_null($bulk_send_job_id)) { array_push($this->openAPINullablesSetToNull, 'bulk_send_job_id'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('bulk_send_job_id', $nullablesSetToNull); + $index = array_search('bulk_send_job_id', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1222,13 +1237,14 @@ public function setBulkSendJobId(?string $bulk_send_job_id) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1237,11 +1253,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1252,8 +1268,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1266,9 +1284,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1276,12 +1296,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1310,3 +1330,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestResponseAttachment.php b/sdks/php/src/Model/SignatureRequestResponseAttachment.php index 245930a52..279d9e5cc 100644 --- a/sdks/php/src/Model/SignatureRequestResponseAttachment.php +++ b/sdks/php/src/Model/SignatureRequestResponseAttachment.php @@ -1,11 +1,14 @@ */ -class SignatureRequestResponseAttachment implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestResponseAttachment implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseAttachment'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'signer' => 'string', 'name' => 'string', 'required' => 'bool', 'instructions' => 'string', - 'uploaded_at' => 'int', + 'uploaded_at' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'id' => null, 'signer' => null, 'name' => null, 'required' => null, 'instructions' => null, - 'uploaded_at' => null, + 'uploaded_at' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'id' => false, 'signer' => false, 'name' => false, 'required' => false, 'instructions' => true, - 'uploaded_at' => true, + 'uploaded_at' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -125,6 +127,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -134,7 +138,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -144,7 +148,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -153,6 +157,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -161,6 +168,9 @@ 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 { @@ -179,7 +189,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'name', 'required' => 'required', 'instructions' => 'instructions', - 'uploaded_at' => 'uploaded_at', + 'uploaded_at' => 'uploaded_at' ]; /** @@ -193,7 +203,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'setName', 'required' => 'setRequired', 'instructions' => 'setInstructions', - 'uploaded_at' => 'setUploadedAt', + 'uploaded_at' => 'setUploadedAt' ]; /** @@ -207,7 +217,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'getName', 'required' => 'getRequired', 'instructions' => 'getInstructions', - 'uploaded_at' => 'getUploadedAt', + 'uploaded_at' => 'getUploadedAt' ]; /** @@ -251,6 +261,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -261,10 +272,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('signer', $data ?? [], null); @@ -274,33 +285,34 @@ public function __construct(array $data = null) $this->setIfExists('uploaded_at', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestResponseAttachment { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestResponseAttachment { /** @var SignatureRequestResponseAttachment */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestResponseAttachment::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -345,6 +357,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets id * @@ -358,14 +371,14 @@ public function getId() /** * Sets id * - * @param string $id the unique ID for this attachment + * @param string $id The unique ID for this attachment. * * @return self */ - public function setId(string $id) + public function setId($id) { if (is_null($id)) { - throw new InvalidArgumentException('non-nullable id cannot be null'); + throw new \InvalidArgumentException('non-nullable id cannot be null'); } $this->container['id'] = $id; @@ -385,14 +398,14 @@ public function getSigner() /** * Sets signer * - * @param string $signer the Signer this attachment is assigned to + * @param string $signer The Signer this attachment is assigned to. * * @return self */ - public function setSigner(string $signer) + public function setSigner($signer) { if (is_null($signer)) { - throw new InvalidArgumentException('non-nullable signer cannot be null'); + throw new \InvalidArgumentException('non-nullable signer cannot be null'); } $this->container['signer'] = $signer; @@ -412,14 +425,14 @@ public function getName() /** * Sets name * - * @param string $name the name of this attachment + * @param string $name The name of this attachment. * * @return self */ - public function setName(string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -439,14 +452,14 @@ public function getRequired() /** * Sets required * - * @param bool $required a boolean value denoting if this attachment is required + * @param bool $required A boolean value denoting if this attachment is required. * * @return self */ - public function setRequired(bool $required) + public function setRequired($required) { if (is_null($required)) { - throw new InvalidArgumentException('non-nullable required cannot be null'); + throw new \InvalidArgumentException('non-nullable required cannot be null'); } $this->container['required'] = $required; @@ -466,17 +479,17 @@ public function getInstructions() /** * Sets instructions * - * @param string|null $instructions instructions for Signer + * @param string|null $instructions Instructions for Signer. * * @return self */ - public function setInstructions(?string $instructions) + public function setInstructions($instructions) { if (is_null($instructions)) { array_push($this->openAPINullablesSetToNull, 'instructions'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('instructions', $nullablesSetToNull); + $index = array_search('instructions', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -500,17 +513,17 @@ public function getUploadedAt() /** * Sets uploaded_at * - * @param int|null $uploaded_at timestamp when attachment was uploaded by Signer + * @param int|null $uploaded_at Timestamp when attachment was uploaded by Signer. * * @return self */ - public function setUploadedAt(?int $uploaded_at) + public function setUploadedAt($uploaded_at) { if (is_null($uploaded_at)) { array_push($this->openAPINullablesSetToNull, 'uploaded_at'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('uploaded_at', $nullablesSetToNull); + $index = array_search('uploaded_at', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -520,13 +533,14 @@ public function setUploadedAt(?int $uploaded_at) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -535,11 +549,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -550,8 +564,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -564,9 +580,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -574,12 +592,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -608,3 +626,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestResponseCustomFieldBase.php b/sdks/php/src/Model/SignatureRequestResponseCustomFieldBase.php index bfa753e11..dfab3276c 100644 --- a/sdks/php/src/Model/SignatureRequestResponseCustomFieldBase.php +++ b/sdks/php/src/Model/SignatureRequestResponseCustomFieldBase.php @@ -1,11 +1,14 @@ */ -class SignatureRequestResponseCustomFieldBase implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestResponseCustomFieldBase implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = 'type'; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseCustomFieldBase'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'name' => 'string', 'required' => 'bool', 'api_id' => 'string', - 'editor' => 'string', + 'editor' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'name' => null, 'required' => null, 'api_id' => null, - 'editor' => null, + 'editor' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, 'name' => false, 'required' => false, 'api_id' => false, - 'editor' => true, + 'editor' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -122,6 +124,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -131,7 +135,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -141,7 +145,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -150,6 +154,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -158,6 +165,9 @@ 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 { @@ -175,7 +185,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'name', 'required' => 'required', 'api_id' => 'api_id', - 'editor' => 'editor', + 'editor' => 'editor' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'setName', 'required' => 'setRequired', 'api_id' => 'setApiId', - 'editor' => 'setEditor', + 'editor' => 'setEditor' ]; /** @@ -201,7 +211,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'getName', 'required' => 'getRequired', 'api_id' => 'getApiId', - 'editor' => 'getEditor', + 'editor' => 'getEditor' ]; /** @@ -245,6 +255,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -255,10 +266,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -270,6 +281,7 @@ public function __construct(array $data = null) $this->container['type'] = static::$openAPIModelName; } + public static function discriminatorClassName(array $data): ?string { if (!array_key_exists('type', $data)) { @@ -287,12 +299,14 @@ public static function discriminatorClassName(array $data): ?string } /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -331,6 +345,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -348,10 +363,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -371,14 +386,14 @@ public function getName() /** * Sets name * - * @param string $name the name of the Custom Field + * @param string $name The name of the Custom Field. * * @return self */ - public function setName(string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -398,14 +413,14 @@ public function getRequired() /** * Sets required * - * @param bool|null $required a boolean value denoting if this field is required + * @param bool|null $required A boolean value denoting if this field is required. * * @return self */ - public function setRequired(?bool $required) + public function setRequired($required) { if (is_null($required)) { - throw new InvalidArgumentException('non-nullable required cannot be null'); + throw new \InvalidArgumentException('non-nullable required cannot be null'); } $this->container['required'] = $required; @@ -425,14 +440,14 @@ public function getApiId() /** * Sets api_id * - * @param string|null $api_id the unique ID for this field + * @param string|null $api_id The unique ID for this field. * * @return self */ - public function setApiId(?string $api_id) + public function setApiId($api_id) { if (is_null($api_id)) { - throw new InvalidArgumentException('non-nullable api_id cannot be null'); + throw new \InvalidArgumentException('non-nullable api_id cannot be null'); } $this->container['api_id'] = $api_id; @@ -452,17 +467,17 @@ public function getEditor() /** * Sets editor * - * @param string|null $editor the name of the Role that is able to edit this field + * @param string|null $editor The name of the Role that is able to edit this field. * * @return self */ - public function setEditor(?string $editor) + public function setEditor($editor) { if (is_null($editor)) { array_push($this->openAPINullablesSetToNull, 'editor'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('editor', $nullablesSetToNull); + $index = array_search('editor', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -472,13 +487,14 @@ public function setEditor(?string $editor) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -487,11 +503,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -502,8 +518,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -516,9 +534,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -526,12 +546,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -560,3 +580,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestResponseCustomFieldCheckbox.php b/sdks/php/src/Model/SignatureRequestResponseCustomFieldCheckbox.php index d16c804e7..5d249cfad 100644 --- a/sdks/php/src/Model/SignatureRequestResponseCustomFieldCheckbox.php +++ b/sdks/php/src/Model/SignatureRequestResponseCustomFieldCheckbox.php @@ -1,11 +1,14 @@ */ class SignatureRequestResponseCustomFieldCheckbox extends SignatureRequestResponseCustomFieldBase @@ -44,49 +46,49 @@ class SignatureRequestResponseCustomFieldCheckbox extends SignatureRequestRespon public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseCustomFieldCheckbox'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'value' => 'bool', + 'value' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'value' => null, + 'value' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, - 'value' => false, + 'value' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,6 +113,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -120,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -130,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -139,6 +143,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -147,6 +154,9 @@ 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 { @@ -161,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'value' => 'value', + 'value' => 'value' ]; /** @@ -171,7 +181,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'value' => 'setValue', + 'value' => 'setValue' ]; /** @@ -181,7 +191,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'value' => 'getValue', + 'value' => 'getValue' ]; /** @@ -225,13 +235,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -239,33 +251,34 @@ public function __construct(array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestResponseCustomFieldCheckbox { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestResponseCustomFieldCheckbox { /** @var SignatureRequestResponseCustomFieldCheckbox */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestResponseCustomFieldCheckbox::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -301,6 +314,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -318,10 +332,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -345,22 +359,23 @@ public function getValue() * * @return self */ - public function setValue(?bool $value) + public function setValue($value) { if (is_null($value)) { - throw new InvalidArgumentException('non-nullable value cannot be null'); + throw new \InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -369,11 +384,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -384,8 +399,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -398,9 +415,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -408,12 +427,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -442,3 +461,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestResponseCustomFieldText.php b/sdks/php/src/Model/SignatureRequestResponseCustomFieldText.php index 4115fc171..d97557059 100644 --- a/sdks/php/src/Model/SignatureRequestResponseCustomFieldText.php +++ b/sdks/php/src/Model/SignatureRequestResponseCustomFieldText.php @@ -1,11 +1,14 @@ */ class SignatureRequestResponseCustomFieldText extends SignatureRequestResponseCustomFieldBase @@ -44,49 +46,49 @@ class SignatureRequestResponseCustomFieldText extends SignatureRequestResponseCu public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseCustomFieldText'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'value' => 'string', + 'value' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'value' => null, + 'value' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, - 'value' => false, + 'value' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,6 +113,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -120,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -130,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -139,6 +143,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -147,6 +154,9 @@ 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 { @@ -161,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'value' => 'value', + 'value' => 'value' ]; /** @@ -171,7 +181,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'value' => 'setValue', + 'value' => 'setValue' ]; /** @@ -181,7 +191,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'value' => 'getValue', + 'value' => 'getValue' ]; /** @@ -225,13 +235,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -239,33 +251,34 @@ public function __construct(array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestResponseCustomFieldText { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestResponseCustomFieldText { /** @var SignatureRequestResponseCustomFieldText */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestResponseCustomFieldText::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -301,6 +314,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -318,10 +332,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -345,22 +359,23 @@ public function getValue() * * @return self */ - public function setValue(?string $value) + public function setValue($value) { if (is_null($value)) { - throw new InvalidArgumentException('non-nullable value cannot be null'); + throw new \InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -369,11 +384,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -384,8 +399,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -398,9 +415,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -408,12 +427,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -442,3 +461,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestResponseCustomFieldTypeEnum.php b/sdks/php/src/Model/SignatureRequestResponseCustomFieldTypeEnum.php index c9f4ea0a2..17f4e0706 100644 --- a/sdks/php/src/Model/SignatureRequestResponseCustomFieldTypeEnum.php +++ b/sdks/php/src/Model/SignatureRequestResponseCustomFieldTypeEnum.php @@ -1,11 +1,14 @@ */ -class SignatureRequestResponseDataBase implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestResponseDataBase implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = 'type'; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataBase'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'api_id' => 'string', 'signature_id' => 'string', 'name' => 'string', 'required' => 'bool', - 'type' => 'string', + 'type' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'api_id' => null, 'signature_id' => null, 'name' => null, 'required' => null, - 'type' => null, + 'type' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'api_id' => false, 'signature_id' => false, 'name' => false, 'required' => false, - 'type' => false, + 'type' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -122,6 +124,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -131,7 +135,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -141,7 +145,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -150,6 +154,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -158,6 +165,9 @@ 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 { @@ -175,7 +185,7 @@ public function isNullableSetToNull(string $property): bool 'signature_id' => 'signature_id', 'name' => 'name', 'required' => 'required', - 'type' => 'type', + 'type' => 'type' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool 'signature_id' => 'setSignatureId', 'name' => 'setName', 'required' => 'setRequired', - 'type' => 'setType', + 'type' => 'setType' ]; /** @@ -201,7 +211,7 @@ public function isNullableSetToNull(string $property): bool 'signature_id' => 'getSignatureId', 'name' => 'getName', 'required' => 'getRequired', - 'type' => 'getType', + 'type' => 'getType' ]; /** @@ -245,6 +255,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -255,10 +266,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('api_id', $data ?? [], null); $this->setIfExists('signature_id', $data ?? [], null); @@ -270,6 +281,7 @@ public function __construct(array $data = null) $this->container['type'] = static::$openAPIModelName; } + public static function discriminatorClassName(array $data): ?string { if (!array_key_exists('type', $data)) { @@ -308,12 +320,14 @@ public static function discriminatorClassName(array $data): ?string } /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -330,7 +344,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -344,6 +360,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets api_id * @@ -357,14 +374,14 @@ public function getApiId() /** * Sets api_id * - * @param string|null $api_id the unique ID for this field + * @param string|null $api_id The unique ID for this field. * * @return self */ - public function setApiId(?string $api_id) + public function setApiId($api_id) { if (is_null($api_id)) { - throw new InvalidArgumentException('non-nullable api_id cannot be null'); + throw new \InvalidArgumentException('non-nullable api_id cannot be null'); } $this->container['api_id'] = $api_id; @@ -384,14 +401,14 @@ public function getSignatureId() /** * Sets signature_id * - * @param string|null $signature_id the ID of the signature to which this response is linked + * @param string|null $signature_id The ID of the signature to which this response is linked. * * @return self */ - public function setSignatureId(?string $signature_id) + public function setSignatureId($signature_id) { if (is_null($signature_id)) { - throw new InvalidArgumentException('non-nullable signature_id cannot be null'); + throw new \InvalidArgumentException('non-nullable signature_id cannot be null'); } $this->container['signature_id'] = $signature_id; @@ -411,14 +428,14 @@ public function getName() /** * Sets name * - * @param string|null $name the name of the form field + * @param string|null $name The name of the form field. * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -438,14 +455,14 @@ public function getRequired() /** * Sets required * - * @param bool|null $required a boolean value denoting if this field is required + * @param bool|null $required A boolean value denoting if this field is required. * * @return self */ - public function setRequired(?bool $required) + public function setRequired($required) { if (is_null($required)) { - throw new InvalidArgumentException('non-nullable required cannot be null'); + throw new \InvalidArgumentException('non-nullable required cannot be null'); } $this->container['required'] = $required; @@ -469,22 +486,23 @@ public function getType() * * @return self */ - public function setType(?string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -493,11 +511,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -508,8 +526,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -522,9 +542,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -532,12 +554,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -566,3 +588,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestResponseDataTypeEnum.php b/sdks/php/src/Model/SignatureRequestResponseDataTypeEnum.php index fd4b6e268..f3ef8fb01 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataTypeEnum.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataTypeEnum.php @@ -1,11 +1,14 @@ */ class SignatureRequestResponseDataValueCheckbox extends SignatureRequestResponseDataBase @@ -43,49 +45,49 @@ class SignatureRequestResponseDataValueCheckbox extends SignatureRequestResponse public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataValueCheckbox'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'value' => 'bool', + 'value' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'value' => null, + 'value' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, - 'value' => false, + 'value' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,6 +112,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -119,7 +123,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -129,7 +133,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -138,6 +142,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -146,6 +153,9 @@ 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 { @@ -160,7 +170,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'value' => 'value', + 'value' => 'value' ]; /** @@ -170,7 +180,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'value' => 'setValue', + 'value' => 'setValue' ]; /** @@ -180,7 +190,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'value' => 'getValue', + 'value' => 'getValue' ]; /** @@ -224,13 +234,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -238,33 +250,34 @@ public function __construct(array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestResponseDataValueCheckbox { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestResponseDataValueCheckbox { /** @var SignatureRequestResponseDataValueCheckbox */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueCheckbox::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -281,7 +294,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return parent::listInvalidProperties(); + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; } /** @@ -295,6 +310,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -312,10 +328,10 @@ public function getType() * * @return self */ - public function setType(?string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -335,26 +351,27 @@ public function getValue() /** * Sets value * - * @param bool|null $value the value of the form field + * @param bool|null $value The value of the form field. * * @return self */ - public function setValue(?bool $value) + public function setValue($value) { if (is_null($value)) { - throw new InvalidArgumentException('non-nullable value cannot be null'); + throw new \InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -363,11 +380,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -378,8 +395,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -392,9 +411,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -402,12 +423,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -436,3 +457,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueCheckboxMerge.php b/sdks/php/src/Model/SignatureRequestResponseDataValueCheckboxMerge.php index 96ac1dd3e..fa395f91c 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueCheckboxMerge.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueCheckboxMerge.php @@ -1,11 +1,14 @@ */ class SignatureRequestResponseDataValueCheckboxMerge extends SignatureRequestResponseDataBase @@ -43,49 +45,49 @@ class SignatureRequestResponseDataValueCheckboxMerge extends SignatureRequestRes public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataValueCheckboxMerge'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'value' => 'string', + 'value' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'value' => null, + 'value' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, - 'value' => false, + 'value' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,6 +112,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -119,7 +123,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -129,7 +133,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -138,6 +142,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -146,6 +153,9 @@ 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 { @@ -160,7 +170,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'value' => 'value', + 'value' => 'value' ]; /** @@ -170,7 +180,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'value' => 'setValue', + 'value' => 'setValue' ]; /** @@ -180,7 +190,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'value' => 'getValue', + 'value' => 'getValue' ]; /** @@ -224,13 +234,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -238,33 +250,34 @@ public function __construct(array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestResponseDataValueCheckboxMerge { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestResponseDataValueCheckboxMerge { /** @var SignatureRequestResponseDataValueCheckboxMerge */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueCheckboxMerge::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -281,7 +294,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return parent::listInvalidProperties(); + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; } /** @@ -295,6 +310,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -312,10 +328,10 @@ public function getType() * * @return self */ - public function setType(?string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -335,26 +351,27 @@ public function getValue() /** * Sets value * - * @param string|null $value the value of the form field + * @param string|null $value The value of the form field. * * @return self */ - public function setValue(?string $value) + public function setValue($value) { if (is_null($value)) { - throw new InvalidArgumentException('non-nullable value cannot be null'); + throw new \InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -363,11 +380,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -378,8 +395,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -392,9 +411,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -402,12 +423,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -436,3 +457,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueDateSigned.php b/sdks/php/src/Model/SignatureRequestResponseDataValueDateSigned.php index 78c8794e0..e02c8a0ef 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueDateSigned.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueDateSigned.php @@ -1,11 +1,14 @@ */ class SignatureRequestResponseDataValueDateSigned extends SignatureRequestResponseDataBase @@ -43,49 +45,49 @@ class SignatureRequestResponseDataValueDateSigned extends SignatureRequestRespon public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataValueDateSigned'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'value' => 'string', + 'value' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'value' => null, + 'value' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, - 'value' => false, + 'value' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,6 +112,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -119,7 +123,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -129,7 +133,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -138,6 +142,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -146,6 +153,9 @@ 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 { @@ -160,7 +170,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'value' => 'value', + 'value' => 'value' ]; /** @@ -170,7 +180,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'value' => 'setValue', + 'value' => 'setValue' ]; /** @@ -180,7 +190,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'value' => 'getValue', + 'value' => 'getValue' ]; /** @@ -224,13 +234,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -238,33 +250,34 @@ public function __construct(array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestResponseDataValueDateSigned { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestResponseDataValueDateSigned { /** @var SignatureRequestResponseDataValueDateSigned */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueDateSigned::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -281,7 +294,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return parent::listInvalidProperties(); + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; } /** @@ -295,6 +310,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -312,10 +328,10 @@ public function getType() * * @return self */ - public function setType(?string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -335,26 +351,27 @@ public function getValue() /** * Sets value * - * @param string|null $value the value of the form field + * @param string|null $value The value of the form field. * * @return self */ - public function setValue(?string $value) + public function setValue($value) { if (is_null($value)) { - throw new InvalidArgumentException('non-nullable value cannot be null'); + throw new \InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -363,11 +380,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -378,8 +395,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -392,9 +411,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -402,12 +423,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -436,3 +457,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueDropdown.php b/sdks/php/src/Model/SignatureRequestResponseDataValueDropdown.php index 4171a5860..495af4e93 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueDropdown.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueDropdown.php @@ -1,11 +1,14 @@ */ class SignatureRequestResponseDataValueDropdown extends SignatureRequestResponseDataBase @@ -43,49 +45,49 @@ class SignatureRequestResponseDataValueDropdown extends SignatureRequestResponse public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataValueDropdown'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'value' => 'string', + 'value' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'value' => null, + 'value' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, - 'value' => false, + 'value' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,6 +112,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -119,7 +123,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -129,7 +133,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -138,6 +142,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -146,6 +153,9 @@ 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 { @@ -160,7 +170,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'value' => 'value', + 'value' => 'value' ]; /** @@ -170,7 +180,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'value' => 'setValue', + 'value' => 'setValue' ]; /** @@ -180,7 +190,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'value' => 'getValue', + 'value' => 'getValue' ]; /** @@ -224,13 +234,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -238,33 +250,34 @@ public function __construct(array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestResponseDataValueDropdown { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestResponseDataValueDropdown { /** @var SignatureRequestResponseDataValueDropdown */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueDropdown::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -281,7 +294,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return parent::listInvalidProperties(); + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; } /** @@ -295,6 +310,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -312,10 +328,10 @@ public function getType() * * @return self */ - public function setType(?string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -335,26 +351,27 @@ public function getValue() /** * Sets value * - * @param string|null $value the value of the form field + * @param string|null $value The value of the form field. * * @return self */ - public function setValue(?string $value) + public function setValue($value) { if (is_null($value)) { - throw new InvalidArgumentException('non-nullable value cannot be null'); + throw new \InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -363,11 +380,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -378,8 +395,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -392,9 +411,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -402,12 +423,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -436,3 +457,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueInitials.php b/sdks/php/src/Model/SignatureRequestResponseDataValueInitials.php index 25ed14574..b8d68df97 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueInitials.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueInitials.php @@ -1,11 +1,14 @@ */ class SignatureRequestResponseDataValueInitials extends SignatureRequestResponseDataBase @@ -43,52 +45,52 @@ class SignatureRequestResponseDataValueInitials extends SignatureRequestResponse public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataValueInitials'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'value' => 'string', - 'is_signed' => 'bool', + 'is_signed' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'value' => null, - 'is_signed' => null, + 'is_signed' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, 'value' => false, - 'is_signed' => true, + 'is_signed' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,6 +115,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -122,7 +126,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +136,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,6 +145,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -149,6 +156,9 @@ 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 { @@ -164,7 +174,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'value' => 'value', - 'is_signed' => 'is_signed', + 'is_signed' => 'is_signed' ]; /** @@ -175,7 +185,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'value' => 'setValue', - 'is_signed' => 'setIsSigned', + 'is_signed' => 'setIsSigned' ]; /** @@ -186,7 +196,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'value' => 'getValue', - 'is_signed' => 'getIsSigned', + 'is_signed' => 'getIsSigned' ]; /** @@ -230,13 +240,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -245,33 +257,34 @@ public function __construct(array $data = null) $this->setIfExists('is_signed', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestResponseDataValueInitials { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestResponseDataValueInitials { /** @var SignatureRequestResponseDataValueInitials */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueInitials::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -288,7 +301,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return parent::listInvalidProperties(); + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; } /** @@ -302,6 +317,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -319,10 +335,10 @@ public function getType() * * @return self */ - public function setType(?string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -342,14 +358,14 @@ public function getValue() /** * Sets value * - * @param string|null $value the value of the form field + * @param string|null $value The value of the form field. * * @return self */ - public function setValue(?string $value) + public function setValue($value) { if (is_null($value)) { - throw new InvalidArgumentException('non-nullable value cannot be null'); + throw new \InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; @@ -369,17 +385,17 @@ public function getIsSigned() /** * Sets is_signed * - * @param bool|null $is_signed this field contains the boolean true if the field is signed + * @param bool|null $is_signed This field contains the boolean true if the field is signed. * * @return self */ - public function setIsSigned(?bool $is_signed) + public function setIsSigned($is_signed) { if (is_null($is_signed)) { array_push($this->openAPINullablesSetToNull, 'is_signed'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('is_signed', $nullablesSetToNull); + $index = array_search('is_signed', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -389,13 +405,14 @@ public function setIsSigned(?bool $is_signed) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -404,11 +421,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -419,8 +436,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -433,9 +452,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -443,12 +464,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -477,3 +498,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueRadio.php b/sdks/php/src/Model/SignatureRequestResponseDataValueRadio.php index 0c05b0bc9..9dc2c039a 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueRadio.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueRadio.php @@ -1,11 +1,14 @@ */ class SignatureRequestResponseDataValueRadio extends SignatureRequestResponseDataBase @@ -43,49 +45,49 @@ class SignatureRequestResponseDataValueRadio extends SignatureRequestResponseDat public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataValueRadio'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'value' => 'bool', + 'value' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'value' => null, + 'value' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, - 'value' => false, + 'value' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,6 +112,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -119,7 +123,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -129,7 +133,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -138,6 +142,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -146,6 +153,9 @@ 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 { @@ -160,7 +170,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'value' => 'value', + 'value' => 'value' ]; /** @@ -170,7 +180,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'value' => 'setValue', + 'value' => 'setValue' ]; /** @@ -180,7 +190,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'value' => 'getValue', + 'value' => 'getValue' ]; /** @@ -224,13 +234,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -238,33 +250,34 @@ public function __construct(array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestResponseDataValueRadio { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestResponseDataValueRadio { /** @var SignatureRequestResponseDataValueRadio */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueRadio::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -281,7 +294,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return parent::listInvalidProperties(); + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; } /** @@ -295,6 +310,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -312,10 +328,10 @@ public function getType() * * @return self */ - public function setType(?string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -335,26 +351,27 @@ public function getValue() /** * Sets value * - * @param bool|null $value the value of the form field + * @param bool|null $value The value of the form field. * * @return self */ - public function setValue(?bool $value) + public function setValue($value) { if (is_null($value)) { - throw new InvalidArgumentException('non-nullable value cannot be null'); + throw new \InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -363,11 +380,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -378,8 +395,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -392,9 +411,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -402,12 +423,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -436,3 +457,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueSignature.php b/sdks/php/src/Model/SignatureRequestResponseDataValueSignature.php index b72a8c1fc..3576a9665 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueSignature.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueSignature.php @@ -1,11 +1,14 @@ */ class SignatureRequestResponseDataValueSignature extends SignatureRequestResponseDataBase @@ -43,52 +45,52 @@ class SignatureRequestResponseDataValueSignature extends SignatureRequestRespons public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataValueSignature'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'value' => 'string', - 'is_signed' => 'bool', + 'is_signed' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'value' => null, - 'is_signed' => null, + 'is_signed' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, 'value' => false, - 'is_signed' => true, + 'is_signed' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,6 +115,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -122,7 +126,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +136,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,6 +145,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -149,6 +156,9 @@ 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 { @@ -164,7 +174,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'value' => 'value', - 'is_signed' => 'is_signed', + 'is_signed' => 'is_signed' ]; /** @@ -175,7 +185,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'value' => 'setValue', - 'is_signed' => 'setIsSigned', + 'is_signed' => 'setIsSigned' ]; /** @@ -186,7 +196,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'value' => 'getValue', - 'is_signed' => 'getIsSigned', + 'is_signed' => 'getIsSigned' ]; /** @@ -230,13 +240,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -245,33 +257,34 @@ public function __construct(array $data = null) $this->setIfExists('is_signed', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestResponseDataValueSignature { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestResponseDataValueSignature { /** @var SignatureRequestResponseDataValueSignature */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueSignature::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -288,7 +301,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return parent::listInvalidProperties(); + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; } /** @@ -302,6 +317,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -319,10 +335,10 @@ public function getType() * * @return self */ - public function setType(?string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -342,14 +358,14 @@ public function getValue() /** * Sets value * - * @param string|null $value the value of the form field + * @param string|null $value The value of the form field. * * @return self */ - public function setValue(?string $value) + public function setValue($value) { if (is_null($value)) { - throw new InvalidArgumentException('non-nullable value cannot be null'); + throw new \InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; @@ -369,17 +385,17 @@ public function getIsSigned() /** * Sets is_signed * - * @param bool|null $is_signed this field contains the boolean true if the field is signed + * @param bool|null $is_signed This field contains the boolean true if the field is signed. * * @return self */ - public function setIsSigned(?bool $is_signed) + public function setIsSigned($is_signed) { if (is_null($is_signed)) { array_push($this->openAPINullablesSetToNull, 'is_signed'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('is_signed', $nullablesSetToNull); + $index = array_search('is_signed', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -389,13 +405,14 @@ public function setIsSigned(?bool $is_signed) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -404,11 +421,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -419,8 +436,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -433,9 +452,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -443,12 +464,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -477,3 +498,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueText.php b/sdks/php/src/Model/SignatureRequestResponseDataValueText.php index f4ddd0ff3..722389b16 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueText.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueText.php @@ -1,11 +1,14 @@ */ class SignatureRequestResponseDataValueText extends SignatureRequestResponseDataBase @@ -43,49 +45,49 @@ class SignatureRequestResponseDataValueText extends SignatureRequestResponseData public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataValueText'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'value' => 'string', + 'value' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'value' => null, + 'value' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, - 'value' => false, + 'value' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,6 +112,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -119,7 +123,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -129,7 +133,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -138,6 +142,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -146,6 +153,9 @@ 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 { @@ -160,7 +170,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'value' => 'value', + 'value' => 'value' ]; /** @@ -170,7 +180,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'value' => 'setValue', + 'value' => 'setValue' ]; /** @@ -180,7 +190,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'value' => 'getValue', + 'value' => 'getValue' ]; /** @@ -224,13 +234,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -238,33 +250,34 @@ public function __construct(array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestResponseDataValueText { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestResponseDataValueText { /** @var SignatureRequestResponseDataValueText */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueText::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -281,7 +294,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return parent::listInvalidProperties(); + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; } /** @@ -295,6 +310,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -312,10 +328,10 @@ public function getType() * * @return self */ - public function setType(?string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -335,26 +351,27 @@ public function getValue() /** * Sets value * - * @param string|null $value the value of the form field + * @param string|null $value The value of the form field. * * @return self */ - public function setValue(?string $value) + public function setValue($value) { if (is_null($value)) { - throw new InvalidArgumentException('non-nullable value cannot be null'); + throw new \InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -363,11 +380,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -378,8 +395,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -392,9 +411,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -402,12 +423,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -436,3 +457,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueTextMerge.php b/sdks/php/src/Model/SignatureRequestResponseDataValueTextMerge.php index ef64d4b8e..7fb653491 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueTextMerge.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueTextMerge.php @@ -1,11 +1,14 @@ */ class SignatureRequestResponseDataValueTextMerge extends SignatureRequestResponseDataBase @@ -43,49 +45,49 @@ class SignatureRequestResponseDataValueTextMerge extends SignatureRequestRespons public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataValueTextMerge'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'value' => 'string', + 'value' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'value' => null, + 'value' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, - 'value' => false, + 'value' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,6 +112,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -119,7 +123,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -129,7 +133,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -138,6 +142,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -146,6 +153,9 @@ 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 { @@ -160,7 +170,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'value' => 'value', + 'value' => 'value' ]; /** @@ -170,7 +180,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'value' => 'setValue', + 'value' => 'setValue' ]; /** @@ -180,7 +190,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'value' => 'getValue', + 'value' => 'getValue' ]; /** @@ -224,13 +234,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -238,33 +250,34 @@ public function __construct(array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestResponseDataValueTextMerge { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestResponseDataValueTextMerge { /** @var SignatureRequestResponseDataValueTextMerge */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueTextMerge::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -281,7 +294,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return parent::listInvalidProperties(); + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; } /** @@ -295,6 +310,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -312,10 +328,10 @@ public function getType() * * @return self */ - public function setType(?string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -335,26 +351,27 @@ public function getValue() /** * Sets value * - * @param string|null $value the value of the form field + * @param string|null $value The value of the form field. * * @return self */ - public function setValue(?string $value) + public function setValue($value) { if (is_null($value)) { - throw new InvalidArgumentException('non-nullable value cannot be null'); + throw new \InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -363,11 +380,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -378,8 +395,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -392,9 +411,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -402,12 +423,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -436,3 +457,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestResponseSignatures.php b/sdks/php/src/Model/SignatureRequestResponseSignatures.php index 081ebb6d3..2e19c6a53 100644 --- a/sdks/php/src/Model/SignatureRequestResponseSignatures.php +++ b/sdks/php/src/Model/SignatureRequestResponseSignatures.php @@ -1,11 +1,14 @@ */ -class SignatureRequestResponseSignatures implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestResponseSignatures implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseSignatures'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'signature_id' => 'string', 'signer_group_guid' => 'string', @@ -76,16 +78,16 @@ class SignatureRequestResponseSignatures implements ModelInterface, ArrayAccess, 'reassigned_by' => 'string', 'reassignment_reason' => 'string', 'reassigned_from' => 'string', - 'error' => 'string', + 'error' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'signature_id' => null, 'signer_group_guid' => null, @@ -105,14 +107,14 @@ class SignatureRequestResponseSignatures implements ModelInterface, ArrayAccess, 'reassigned_by' => null, 'reassignment_reason' => null, 'reassigned_from' => null, - 'error' => null, + 'error' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'signature_id' => false, 'signer_group_guid' => true, @@ -132,14 +134,14 @@ class SignatureRequestResponseSignatures implements ModelInterface, ArrayAccess, 'reassigned_by' => true, 'reassignment_reason' => true, 'reassigned_from' => true, - 'error' => true, + 'error' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -164,6 +166,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -173,7 +177,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -183,7 +187,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -192,6 +196,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -200,6 +207,9 @@ 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 { @@ -231,7 +241,7 @@ public function isNullableSetToNull(string $property): bool 'reassigned_by' => 'reassigned_by', 'reassignment_reason' => 'reassignment_reason', 'reassigned_from' => 'reassigned_from', - 'error' => 'error', + 'error' => 'error' ]; /** @@ -258,7 +268,7 @@ public function isNullableSetToNull(string $property): bool 'reassigned_by' => 'setReassignedBy', 'reassignment_reason' => 'setReassignmentReason', 'reassigned_from' => 'setReassignedFrom', - 'error' => 'setError', + 'error' => 'setError' ]; /** @@ -285,7 +295,7 @@ public function isNullableSetToNull(string $property): bool 'reassigned_by' => 'getReassignedBy', 'reassignment_reason' => 'getReassignmentReason', 'reassigned_from' => 'getReassignedFrom', - 'error' => 'getError', + 'error' => 'getError' ]; /** @@ -329,6 +339,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -339,10 +350,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('signature_id', $data ?? [], null); $this->setIfExists('signer_group_guid', $data ?? [], null); @@ -365,33 +376,34 @@ public function __construct(array $data = null) $this->setIfExists('error', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestResponseSignatures { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestResponseSignatures { /** @var SignatureRequestResponseSignatures */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestResponseSignatures::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -408,7 +420,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -422,6 +436,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets signature_id * @@ -435,14 +450,14 @@ public function getSignatureId() /** * Sets signature_id * - * @param string|null $signature_id signature identifier + * @param string|null $signature_id Signature identifier. * * @return self */ - public function setSignatureId(?string $signature_id) + public function setSignatureId($signature_id) { if (is_null($signature_id)) { - throw new InvalidArgumentException('non-nullable signature_id cannot be null'); + throw new \InvalidArgumentException('non-nullable signature_id cannot be null'); } $this->container['signature_id'] = $signature_id; @@ -466,13 +481,13 @@ public function getSignerGroupGuid() * * @return self */ - public function setSignerGroupGuid(?string $signer_group_guid) + public function setSignerGroupGuid($signer_group_guid) { if (is_null($signer_group_guid)) { array_push($this->openAPINullablesSetToNull, 'signer_group_guid'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signer_group_guid', $nullablesSetToNull); + $index = array_search('signer_group_guid', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -496,14 +511,14 @@ public function getSignerEmailAddress() /** * Sets signer_email_address * - * @param string|null $signer_email_address the email address of the signer + * @param string|null $signer_email_address The email address of the signer. * * @return self */ - public function setSignerEmailAddress(?string $signer_email_address) + public function setSignerEmailAddress($signer_email_address) { if (is_null($signer_email_address)) { - throw new InvalidArgumentException('non-nullable signer_email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable signer_email_address cannot be null'); } $this->container['signer_email_address'] = $signer_email_address; @@ -523,17 +538,17 @@ public function getSignerName() /** * Sets signer_name * - * @param string|null $signer_name the name of the signer + * @param string|null $signer_name The name of the signer. * * @return self */ - public function setSignerName(?string $signer_name) + public function setSignerName($signer_name) { if (is_null($signer_name)) { array_push($this->openAPINullablesSetToNull, 'signer_name'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signer_name', $nullablesSetToNull); + $index = array_search('signer_name', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -557,17 +572,17 @@ public function getSignerRole() /** * Sets signer_role * - * @param string|null $signer_role the role of the signer + * @param string|null $signer_role The role of the signer. * * @return self */ - public function setSignerRole(?string $signer_role) + public function setSignerRole($signer_role) { if (is_null($signer_role)) { array_push($this->openAPINullablesSetToNull, 'signer_role'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signer_role', $nullablesSetToNull); + $index = array_search('signer_role', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -591,17 +606,17 @@ public function getOrder() /** * Sets order * - * @param int|null $order if signer order is assigned this is the 0-based index for this signer + * @param int|null $order If signer order is assigned this is the 0-based index for this signer. * * @return self */ - public function setOrder(?int $order) + public function setOrder($order) { if (is_null($order)) { array_push($this->openAPINullablesSetToNull, 'order'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('order', $nullablesSetToNull); + $index = array_search('order', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -629,10 +644,10 @@ public function getStatusCode() * * @return self */ - public function setStatusCode(?string $status_code) + public function setStatusCode($status_code) { if (is_null($status_code)) { - throw new InvalidArgumentException('non-nullable status_code cannot be null'); + throw new \InvalidArgumentException('non-nullable status_code cannot be null'); } $this->container['status_code'] = $status_code; @@ -652,17 +667,17 @@ public function getDeclineReason() /** * Sets decline_reason * - * @param string|null $decline_reason the reason provided by the signer for declining the request + * @param string|null $decline_reason The reason provided by the signer for declining the request. * * @return self */ - public function setDeclineReason(?string $decline_reason) + public function setDeclineReason($decline_reason) { if (is_null($decline_reason)) { array_push($this->openAPINullablesSetToNull, 'decline_reason'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('decline_reason', $nullablesSetToNull); + $index = array_search('decline_reason', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -686,17 +701,17 @@ public function getSignedAt() /** * Sets signed_at * - * @param int|null $signed_at time that the document was signed or null + * @param int|null $signed_at Time that the document was signed or null. * * @return self */ - public function setSignedAt(?int $signed_at) + public function setSignedAt($signed_at) { if (is_null($signed_at)) { array_push($this->openAPINullablesSetToNull, 'signed_at'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signed_at', $nullablesSetToNull); + $index = array_search('signed_at', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -720,17 +735,17 @@ public function getLastViewedAt() /** * Sets last_viewed_at * - * @param int|null $last_viewed_at the time that the document was last viewed by this signer or null + * @param int|null $last_viewed_at The time that the document was last viewed by this signer or null. * * @return self */ - public function setLastViewedAt(?int $last_viewed_at) + public function setLastViewedAt($last_viewed_at) { if (is_null($last_viewed_at)) { array_push($this->openAPINullablesSetToNull, 'last_viewed_at'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('last_viewed_at', $nullablesSetToNull); + $index = array_search('last_viewed_at', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -754,17 +769,17 @@ public function getLastRemindedAt() /** * Sets last_reminded_at * - * @param int|null $last_reminded_at the time the last reminder email was sent to the signer or null + * @param int|null $last_reminded_at The time the last reminder email was sent to the signer or null. * * @return self */ - public function setLastRemindedAt(?int $last_reminded_at) + public function setLastRemindedAt($last_reminded_at) { if (is_null($last_reminded_at)) { array_push($this->openAPINullablesSetToNull, 'last_reminded_at'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('last_reminded_at', $nullablesSetToNull); + $index = array_search('last_reminded_at', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -788,14 +803,14 @@ public function getHasPin() /** * Sets has_pin * - * @param bool|null $has_pin boolean to indicate whether this signature requires a PIN to access + * @param bool|null $has_pin Boolean to indicate whether this signature requires a PIN to access. * * @return self */ - public function setHasPin(?bool $has_pin) + public function setHasPin($has_pin) { if (is_null($has_pin)) { - throw new InvalidArgumentException('non-nullable has_pin cannot be null'); + throw new \InvalidArgumentException('non-nullable has_pin cannot be null'); } $this->container['has_pin'] = $has_pin; @@ -815,17 +830,17 @@ public function getHasSmsAuth() /** * Sets has_sms_auth * - * @param bool|null $has_sms_auth boolean to indicate whether this signature has SMS authentication enabled + * @param bool|null $has_sms_auth Boolean to indicate whether this signature has SMS authentication enabled. * * @return self */ - public function setHasSmsAuth(?bool $has_sms_auth) + public function setHasSmsAuth($has_sms_auth) { if (is_null($has_sms_auth)) { array_push($this->openAPINullablesSetToNull, 'has_sms_auth'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('has_sms_auth', $nullablesSetToNull); + $index = array_search('has_sms_auth', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -849,17 +864,17 @@ public function getHasSmsDelivery() /** * Sets has_sms_delivery * - * @param bool|null $has_sms_delivery boolean to indicate whether this signature has SMS delivery enabled + * @param bool|null $has_sms_delivery Boolean to indicate whether this signature has SMS delivery enabled. * * @return self */ - public function setHasSmsDelivery(?bool $has_sms_delivery) + public function setHasSmsDelivery($has_sms_delivery) { if (is_null($has_sms_delivery)) { array_push($this->openAPINullablesSetToNull, 'has_sms_delivery'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('has_sms_delivery', $nullablesSetToNull); + $index = array_search('has_sms_delivery', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -883,17 +898,17 @@ public function getSmsPhoneNumber() /** * Sets sms_phone_number * - * @param string|null $sms_phone_number the SMS phone number used for authentication or signature request delivery + * @param string|null $sms_phone_number The SMS phone number used for authentication or signature request delivery. * * @return self */ - public function setSmsPhoneNumber(?string $sms_phone_number) + public function setSmsPhoneNumber($sms_phone_number) { if (is_null($sms_phone_number)) { array_push($this->openAPINullablesSetToNull, 'sms_phone_number'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('sms_phone_number', $nullablesSetToNull); + $index = array_search('sms_phone_number', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -917,17 +932,17 @@ public function getReassignedBy() /** * Sets reassigned_by * - * @param string|null $reassigned_by email address of original signer who reassigned to this signer + * @param string|null $reassigned_by Email address of original signer who reassigned to this signer. * * @return self */ - public function setReassignedBy(?string $reassigned_by) + public function setReassignedBy($reassigned_by) { if (is_null($reassigned_by)) { array_push($this->openAPINullablesSetToNull, 'reassigned_by'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('reassigned_by', $nullablesSetToNull); + $index = array_search('reassigned_by', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -951,17 +966,17 @@ public function getReassignmentReason() /** * Sets reassignment_reason * - * @param string|null $reassignment_reason reason provided by original signer who reassigned to this signer + * @param string|null $reassignment_reason Reason provided by original signer who reassigned to this signer. * * @return self */ - public function setReassignmentReason(?string $reassignment_reason) + public function setReassignmentReason($reassignment_reason) { if (is_null($reassignment_reason)) { array_push($this->openAPINullablesSetToNull, 'reassignment_reason'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('reassignment_reason', $nullablesSetToNull); + $index = array_search('reassignment_reason', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -985,17 +1000,17 @@ public function getReassignedFrom() /** * Sets reassigned_from * - * @param string|null $reassigned_from previous signature identifier + * @param string|null $reassigned_from Previous signature identifier. * * @return self */ - public function setReassignedFrom(?string $reassigned_from) + public function setReassignedFrom($reassigned_from) { if (is_null($reassigned_from)) { array_push($this->openAPINullablesSetToNull, 'reassigned_from'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('reassigned_from', $nullablesSetToNull); + $index = array_search('reassigned_from', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1019,17 +1034,17 @@ public function getError() /** * Sets error * - * @param string|null $error error message pertaining to this signer, or null + * @param string|null $error Error message pertaining to this signer, or null. * * @return self */ - public function setError(?string $error) + public function setError($error) { if (is_null($error)) { array_push($this->openAPINullablesSetToNull, 'error'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('error', $nullablesSetToNull); + $index = array_search('error', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1039,13 +1054,14 @@ public function setError(?string $error) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1054,11 +1070,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1069,8 +1085,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1083,9 +1101,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1093,12 +1113,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1127,3 +1147,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestSendRequest.php b/sdks/php/src/Model/SignatureRequestSendRequest.php index 600ee133e..a8d77c8e0 100644 --- a/sdks/php/src/Model/SignatureRequestSendRequest.php +++ b/sdks/php/src/Model/SignatureRequestSendRequest.php @@ -1,11 +1,14 @@ */ -class SignatureRequestSendRequest implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestSendRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestSendRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'files' => '\SplFileObject[]', 'file_urls' => 'string[]', @@ -83,16 +84,16 @@ class SignatureRequestSendRequest implements ModelInterface, ArrayAccess, JsonSe 'test_mode' => 'bool', 'title' => 'string', 'use_text_tags' => 'bool', - 'expires_at' => 'int', + 'expires_at' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'files' => 'binary', 'file_urls' => null, @@ -119,14 +120,14 @@ class SignatureRequestSendRequest implements ModelInterface, ArrayAccess, JsonSe 'test_mode' => null, 'title' => null, 'use_text_tags' => null, - 'expires_at' => null, + 'expires_at' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'files' => false, 'file_urls' => false, @@ -153,14 +154,14 @@ class SignatureRequestSendRequest implements ModelInterface, ArrayAccess, JsonSe 'test_mode' => false, 'title' => false, 'use_text_tags' => false, - 'expires_at' => true, + 'expires_at' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -185,6 +186,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -194,7 +197,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -204,7 +207,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -213,6 +216,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -221,6 +227,9 @@ 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 { @@ -259,7 +268,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'test_mode', 'title' => 'title', 'use_text_tags' => 'use_text_tags', - 'expires_at' => 'expires_at', + 'expires_at' => 'expires_at' ]; /** @@ -293,7 +302,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'setTestMode', 'title' => 'setTitle', 'use_text_tags' => 'setUseTextTags', - 'expires_at' => 'setExpiresAt', + 'expires_at' => 'setExpiresAt' ]; /** @@ -327,7 +336,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'getTestMode', 'title' => 'getTitle', 'use_text_tags' => 'getUseTextTags', - 'expires_at' => 'getExpiresAt', + 'expires_at' => 'getExpiresAt' ]; /** @@ -371,6 +380,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -381,10 +391,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('files', $data ?? [], null); $this->setIfExists('file_urls', $data ?? [], null); @@ -414,33 +424,34 @@ public function __construct(array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestSendRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestSendRequest { /** @var SignatureRequestSendRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestSendRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -485,10 +496,11 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets files * - * @return SplFileObject[]|null + * @return \SplFileObject[]|null */ public function getFiles() { @@ -498,14 +510,14 @@ public function getFiles() /** * Sets files * - * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles(?array $files) + public function setFiles($files) { if (is_null($files)) { - throw new InvalidArgumentException('non-nullable files cannot be null'); + throw new \InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -529,10 +541,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls(?array $file_urls) + public function setFileUrls($file_urls) { if (is_null($file_urls)) { - throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -556,10 +568,10 @@ public function getSigners() * * @return self */ - public function setSigners(?array $signers) + public function setSigners($signers) { if (is_null($signers)) { - throw new InvalidArgumentException('non-nullable signers cannot be null'); + throw new \InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -583,10 +595,10 @@ public function getGroupedSigners() * * @return self */ - public function setGroupedSigners(?array $grouped_signers) + public function setGroupedSigners($grouped_signers) { if (is_null($grouped_signers)) { - throw new InvalidArgumentException('non-nullable grouped_signers cannot be null'); + throw new \InvalidArgumentException('non-nullable grouped_signers cannot be null'); } $this->container['grouped_signers'] = $grouped_signers; @@ -610,10 +622,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline(?bool $allow_decline) + public function setAllowDecline($allow_decline) { if (is_null($allow_decline)) { - throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -637,10 +649,10 @@ public function getAllowReassign() * * @return self */ - public function setAllowReassign(?bool $allow_reassign) + public function setAllowReassign($allow_reassign) { if (is_null($allow_reassign)) { - throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_reassign cannot be null'); } $this->container['allow_reassign'] = $allow_reassign; @@ -664,10 +676,10 @@ public function getAttachments() * * @return self */ - public function setAttachments(?array $attachments) + public function setAttachments($attachments) { if (is_null($attachments)) { - throw new InvalidArgumentException('non-nullable attachments cannot be null'); + throw new \InvalidArgumentException('non-nullable attachments cannot be null'); } $this->container['attachments'] = $attachments; @@ -687,14 +699,14 @@ public function getCcEmailAddresses() /** * Sets cc_email_addresses * - * @param string[]|null $cc_email_addresses the email addresses that should be CCed + * @param string[]|null $cc_email_addresses The email addresses that should be CCed. * * @return self */ - public function setCcEmailAddresses(?array $cc_email_addresses) + public function setCcEmailAddresses($cc_email_addresses) { if (is_null($cc_email_addresses)) { - throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + throw new \InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); } $this->container['cc_email_addresses'] = $cc_email_addresses; @@ -718,10 +730,10 @@ public function getClientId() * * @return self */ - public function setClientId(?string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -745,10 +757,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields(?array $custom_fields) + public function setCustomFields($custom_fields) { if (is_null($custom_fields)) { - throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -772,10 +784,10 @@ public function getFieldOptions() * * @return self */ - public function setFieldOptions(?SubFieldOptions $field_options) + public function setFieldOptions($field_options) { if (is_null($field_options)) { - throw new InvalidArgumentException('non-nullable field_options cannot be null'); + throw new \InvalidArgumentException('non-nullable field_options cannot be null'); } $this->container['field_options'] = $field_options; @@ -799,10 +811,10 @@ public function getFormFieldGroups() * * @return self */ - public function setFormFieldGroups(?array $form_field_groups) + public function setFormFieldGroups($form_field_groups) { if (is_null($form_field_groups)) { - throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); + throw new \InvalidArgumentException('non-nullable form_field_groups cannot be null'); } $this->container['form_field_groups'] = $form_field_groups; @@ -822,14 +834,14 @@ public function getFormFieldRules() /** * Sets form_field_rules * - * @param SubFormFieldRule[]|null $form_field_rules conditional Logic rules for fields defined in `form_fields_per_document` + * @param SubFormFieldRule[]|null $form_field_rules Conditional Logic rules for fields defined in `form_fields_per_document`. * * @return self */ - public function setFormFieldRules(?array $form_field_rules) + public function setFormFieldRules($form_field_rules) { if (is_null($form_field_rules)) { - throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); + throw new \InvalidArgumentException('non-nullable form_field_rules cannot be null'); } $this->container['form_field_rules'] = $form_field_rules; @@ -853,10 +865,10 @@ public function getFormFieldsPerDocument() * * @return self */ - public function setFormFieldsPerDocument(?array $form_fields_per_document) + public function setFormFieldsPerDocument($form_fields_per_document) { if (is_null($form_fields_per_document)) { - throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + throw new \InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); } $this->container['form_fields_per_document'] = $form_fields_per_document; @@ -880,10 +892,10 @@ public function getHideTextTags() * * @return self */ - public function setHideTextTags(?bool $hide_text_tags) + public function setHideTextTags($hide_text_tags) { if (is_null($hide_text_tags)) { - throw new InvalidArgumentException('non-nullable hide_text_tags cannot be null'); + throw new \InvalidArgumentException('non-nullable hide_text_tags cannot be null'); } $this->container['hide_text_tags'] = $hide_text_tags; @@ -909,10 +921,10 @@ public function getIsQualifiedSignature() * @return self * @deprecated */ - public function setIsQualifiedSignature(?bool $is_qualified_signature) + public function setIsQualifiedSignature($is_qualified_signature) { if (is_null($is_qualified_signature)) { - throw new InvalidArgumentException('non-nullable is_qualified_signature cannot be null'); + throw new \InvalidArgumentException('non-nullable is_qualified_signature cannot be null'); } $this->container['is_qualified_signature'] = $is_qualified_signature; @@ -936,10 +948,10 @@ public function getIsEid() * * @return self */ - public function setIsEid(?bool $is_eid) + public function setIsEid($is_eid) { if (is_null($is_eid)) { - throw new InvalidArgumentException('non-nullable is_eid cannot be null'); + throw new \InvalidArgumentException('non-nullable is_eid cannot be null'); } $this->container['is_eid'] = $is_eid; @@ -959,17 +971,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message the custom message in the email that will be sent to the signers + * @param string|null $message The custom message in the email that will be sent to the signers. * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { - throw new InvalidArgumentException('non-nullable message cannot be null'); + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - if (mb_strlen($message) > 5000) { - throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestSendRequest., must be smaller than or equal to 5000.'); + if ((mb_strlen($message) > 5000)) { + throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestSendRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -994,12 +1006,13 @@ public function getMetadata() * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } + $this->container['metadata'] = $metadata; return $this; @@ -1022,10 +1035,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions(?SubSigningOptions $signing_options) + public function setSigningOptions($signing_options) { if (is_null($signing_options)) { - throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -1045,14 +1058,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign + * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. * * @return self */ - public function setSigningRedirectUrl(?string $signing_redirect_url) + public function setSigningRedirectUrl($signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -1072,17 +1085,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject the subject in the email that will be sent to the signers + * @param string|null $subject The subject in the email that will be sent to the signers. * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { - throw new InvalidArgumentException('non-nullable subject cannot be null'); + throw new \InvalidArgumentException('non-nullable subject cannot be null'); } - if (mb_strlen($subject) > 255) { - throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestSendRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($subject) > 255)) { + throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestSendRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -1107,10 +1120,10 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -1130,17 +1143,17 @@ public function getTitle() /** * Sets title * - * @param string|null $title the title you want to assign to the SignatureRequest + * @param string|null $title The title you want to assign to the SignatureRequest. * * @return self */ - public function setTitle(?string $title) + public function setTitle($title) { if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); + throw new \InvalidArgumentException('non-nullable title cannot be null'); } - if (mb_strlen($title) > 255) { - throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestSendRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($title) > 255)) { + throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestSendRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; @@ -1165,10 +1178,10 @@ public function getUseTextTags() * * @return self */ - public function setUseTextTags(?bool $use_text_tags) + public function setUseTextTags($use_text_tags) { if (is_null($use_text_tags)) { - throw new InvalidArgumentException('non-nullable use_text_tags cannot be null'); + throw new \InvalidArgumentException('non-nullable use_text_tags cannot be null'); } $this->container['use_text_tags'] = $use_text_tags; @@ -1192,13 +1205,13 @@ public function getExpiresAt() * * @return self */ - public function setExpiresAt(?int $expires_at) + 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); + $index = array_search('expires_at', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1208,13 +1221,14 @@ public function setExpiresAt(?int $expires_at) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1223,11 +1237,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1238,8 +1252,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1252,9 +1268,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1262,12 +1280,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1296,3 +1314,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestSendWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestSendWithTemplateRequest.php index c58096632..27b2ed4e9 100644 --- a/sdks/php/src/Model/SignatureRequestSendWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestSendWithTemplateRequest.php @@ -1,11 +1,14 @@ */ -class SignatureRequestSendWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestSendWithTemplateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestSendWithTemplateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template_ids' => 'string[]', 'signers' => '\Dropbox\Sign\Model\SubSignatureRequestTemplateSigner[]', @@ -75,16 +76,16 @@ class SignatureRequestSendWithTemplateRequest implements ModelInterface, ArrayAc 'signing_redirect_url' => 'string', 'subject' => 'string', 'test_mode' => 'bool', - 'title' => 'string', + 'title' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template_ids' => null, 'signers' => null, @@ -102,14 +103,14 @@ class SignatureRequestSendWithTemplateRequest implements ModelInterface, ArrayAc 'signing_redirect_url' => null, 'subject' => null, 'test_mode' => null, - 'title' => null, + 'title' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'template_ids' => false, 'signers' => false, @@ -127,14 +128,14 @@ class SignatureRequestSendWithTemplateRequest implements ModelInterface, ArrayAc 'signing_redirect_url' => false, 'subject' => false, 'test_mode' => false, - 'title' => false, + 'title' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -159,6 +160,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -168,7 +171,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -178,7 +181,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -187,6 +190,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -195,6 +201,9 @@ 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 { @@ -224,7 +233,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'signing_redirect_url', 'subject' => 'subject', 'test_mode' => 'test_mode', - 'title' => 'title', + 'title' => 'title' ]; /** @@ -249,7 +258,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'setSigningRedirectUrl', 'subject' => 'setSubject', 'test_mode' => 'setTestMode', - 'title' => 'setTitle', + 'title' => 'setTitle' ]; /** @@ -274,7 +283,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'getSigningRedirectUrl', 'subject' => 'getSubject', 'test_mode' => 'getTestMode', - 'title' => 'getTitle', + 'title' => 'getTitle' ]; /** @@ -318,6 +327,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -328,10 +338,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('template_ids', $data ?? [], null); $this->setIfExists('signers', $data ?? [], null); @@ -352,33 +362,34 @@ public function __construct(array $data = null) $this->setIfExists('title', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestSendWithTemplateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestSendWithTemplateRequest { /** @var SignatureRequestSendWithTemplateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestSendWithTemplateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -429,6 +440,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets template_ids * @@ -442,14 +454,14 @@ public function getTemplateIds() /** * Sets template_ids * - * @param string[] $template_ids use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used + * @param string[] $template_ids Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. * * @return self */ - public function setTemplateIds(array $template_ids) + public function setTemplateIds($template_ids) { if (is_null($template_ids)) { - throw new InvalidArgumentException('non-nullable template_ids cannot be null'); + throw new \InvalidArgumentException('non-nullable template_ids cannot be null'); } $this->container['template_ids'] = $template_ids; @@ -469,14 +481,14 @@ public function getSigners() /** * Sets signers * - * @param SubSignatureRequestTemplateSigner[] $signers add Signers to your Templated-based Signature Request + * @param SubSignatureRequestTemplateSigner[] $signers Add Signers to your Templated-based Signature Request. * * @return self */ - public function setSigners(array $signers) + public function setSigners($signers) { if (is_null($signers)) { - throw new InvalidArgumentException('non-nullable signers cannot be null'); + throw new \InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -500,10 +512,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline(?bool $allow_decline) + public function setAllowDecline($allow_decline) { if (is_null($allow_decline)) { - throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -527,10 +539,10 @@ public function getCcs() * * @return self */ - public function setCcs(?array $ccs) + public function setCcs($ccs) { if (is_null($ccs)) { - throw new InvalidArgumentException('non-nullable ccs cannot be null'); + throw new \InvalidArgumentException('non-nullable ccs cannot be null'); } $this->container['ccs'] = $ccs; @@ -554,10 +566,10 @@ public function getClientId() * * @return self */ - public function setClientId(?string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -581,10 +593,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields(?array $custom_fields) + public function setCustomFields($custom_fields) { if (is_null($custom_fields)) { - throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -594,7 +606,7 @@ public function setCustomFields(?array $custom_fields) /** * Gets files * - * @return SplFileObject[]|null + * @return \SplFileObject[]|null */ public function getFiles() { @@ -604,14 +616,14 @@ public function getFiles() /** * Sets files * - * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles(?array $files) + public function setFiles($files) { if (is_null($files)) { - throw new InvalidArgumentException('non-nullable files cannot be null'); + throw new \InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -635,10 +647,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls(?array $file_urls) + public function setFileUrls($file_urls) { if (is_null($file_urls)) { - throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -664,10 +676,10 @@ public function getIsQualifiedSignature() * @return self * @deprecated */ - public function setIsQualifiedSignature(?bool $is_qualified_signature) + public function setIsQualifiedSignature($is_qualified_signature) { if (is_null($is_qualified_signature)) { - throw new InvalidArgumentException('non-nullable is_qualified_signature cannot be null'); + throw new \InvalidArgumentException('non-nullable is_qualified_signature cannot be null'); } $this->container['is_qualified_signature'] = $is_qualified_signature; @@ -691,10 +703,10 @@ public function getIsEid() * * @return self */ - public function setIsEid(?bool $is_eid) + public function setIsEid($is_eid) { if (is_null($is_eid)) { - throw new InvalidArgumentException('non-nullable is_eid cannot be null'); + throw new \InvalidArgumentException('non-nullable is_eid cannot be null'); } $this->container['is_eid'] = $is_eid; @@ -714,17 +726,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message the custom message in the email that will be sent to the signers + * @param string|null $message The custom message in the email that will be sent to the signers. * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { - throw new InvalidArgumentException('non-nullable message cannot be null'); + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - if (mb_strlen($message) > 5000) { - throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestSendWithTemplateRequest., must be smaller than or equal to 5000.'); + if ((mb_strlen($message) > 5000)) { + throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestSendWithTemplateRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -749,12 +761,13 @@ public function getMetadata() * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } + $this->container['metadata'] = $metadata; return $this; @@ -777,10 +790,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions(?SubSigningOptions $signing_options) + public function setSigningOptions($signing_options) { if (is_null($signing_options)) { - throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -800,14 +813,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign + * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. * * @return self */ - public function setSigningRedirectUrl(?string $signing_redirect_url) + public function setSigningRedirectUrl($signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -827,17 +840,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject the subject in the email that will be sent to the signers + * @param string|null $subject The subject in the email that will be sent to the signers. * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { - throw new InvalidArgumentException('non-nullable subject cannot be null'); + throw new \InvalidArgumentException('non-nullable subject cannot be null'); } - if (mb_strlen($subject) > 255) { - throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestSendWithTemplateRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($subject) > 255)) { + throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestSendWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -862,10 +875,10 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -885,30 +898,31 @@ public function getTitle() /** * Sets title * - * @param string|null $title the title you want to assign to the SignatureRequest + * @param string|null $title The title you want to assign to the SignatureRequest. * * @return self */ - public function setTitle(?string $title) + public function setTitle($title) { if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); + throw new \InvalidArgumentException('non-nullable title cannot be null'); } - if (mb_strlen($title) > 255) { - throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestSendWithTemplateRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($title) > 255)) { + throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestSendWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -917,11 +931,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -932,8 +946,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -946,9 +962,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -956,12 +974,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -990,3 +1008,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SignatureRequestUpdateRequest.php b/sdks/php/src/Model/SignatureRequestUpdateRequest.php index 2a4a33dcf..dbc1d7be8 100644 --- a/sdks/php/src/Model/SignatureRequestUpdateRequest.php +++ b/sdks/php/src/Model/SignatureRequestUpdateRequest.php @@ -1,11 +1,14 @@ */ -class SignatureRequestUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestUpdateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestUpdateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'signature_id' => 'string', 'email_address' => 'string', 'name' => 'string', - 'expires_at' => 'int', + 'expires_at' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'signature_id' => null, 'email_address' => 'email', 'name' => null, - 'expires_at' => null, + 'expires_at' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'signature_id' => false, 'email_address' => false, 'name' => false, - 'expires_at' => true, + 'expires_at' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -118,6 +120,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -127,7 +131,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -137,7 +141,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -146,6 +150,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -154,6 +161,9 @@ 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 { @@ -170,7 +180,7 @@ public function isNullableSetToNull(string $property): bool 'signature_id' => 'signature_id', 'email_address' => 'email_address', 'name' => 'name', - 'expires_at' => 'expires_at', + 'expires_at' => 'expires_at' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'signature_id' => 'setSignatureId', 'email_address' => 'setEmailAddress', 'name' => 'setName', - 'expires_at' => 'setExpiresAt', + 'expires_at' => 'setExpiresAt' ]; /** @@ -194,7 +204,7 @@ public function isNullableSetToNull(string $property): bool 'signature_id' => 'getSignatureId', 'email_address' => 'getEmailAddress', 'name' => 'getName', - 'expires_at' => 'getExpiresAt', + 'expires_at' => 'getExpiresAt' ]; /** @@ -238,6 +248,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -248,10 +259,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('signature_id', $data ?? [], null); $this->setIfExists('email_address', $data ?? [], null); @@ -259,33 +270,34 @@ public function __construct(array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SignatureRequestUpdateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SignatureRequestUpdateRequest { /** @var SignatureRequestUpdateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SignatureRequestUpdateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -321,6 +333,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets signature_id * @@ -334,14 +347,14 @@ public function getSignatureId() /** * Sets signature_id * - * @param string $signature_id the signature ID for the recipient + * @param string $signature_id The signature ID for the recipient. * * @return self */ - public function setSignatureId(string $signature_id) + public function setSignatureId($signature_id) { if (is_null($signature_id)) { - throw new InvalidArgumentException('non-nullable signature_id cannot be null'); + throw new \InvalidArgumentException('non-nullable signature_id cannot be null'); } $this->container['signature_id'] = $signature_id; @@ -365,10 +378,10 @@ public function getEmailAddress() * * @return self */ - public function setEmailAddress(?string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -392,10 +405,10 @@ public function getName() * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -419,13 +432,13 @@ public function getExpiresAt() * * @return self */ - public function setExpiresAt(?int $expires_at) + 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); + $index = array_search('expires_at', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -435,13 +448,14 @@ public function setExpiresAt(?int $expires_at) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -450,11 +464,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -465,8 +479,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -479,9 +495,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -489,12 +507,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -523,3 +541,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubAttachment.php b/sdks/php/src/Model/SubAttachment.php index d41f3459c..b76000840 100644 --- a/sdks/php/src/Model/SubAttachment.php +++ b/sdks/php/src/Model/SubAttachment.php @@ -1,11 +1,14 @@ */ -class SubAttachment implements ModelInterface, ArrayAccess, JsonSerializable +class SubAttachment implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubAttachment'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', 'signer_index' => 'int', 'instructions' => 'string', - 'required' => 'bool', + 'required' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, 'signer_index' => null, 'instructions' => null, - 'required' => null, + 'required' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'name' => false, 'signer_index' => false, 'instructions' => false, - 'required' => false, + 'required' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -118,6 +120,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -127,7 +131,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -137,7 +141,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -146,6 +150,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -154,6 +161,9 @@ 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 { @@ -170,7 +180,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'name', 'signer_index' => 'signer_index', 'instructions' => 'instructions', - 'required' => 'required', + 'required' => 'required' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'setName', 'signer_index' => 'setSignerIndex', 'instructions' => 'setInstructions', - 'required' => 'setRequired', + 'required' => 'setRequired' ]; /** @@ -194,7 +204,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'getName', 'signer_index' => 'getSignerIndex', 'instructions' => 'getInstructions', - 'required' => 'getRequired', + 'required' => 'getRequired' ]; /** @@ -238,6 +248,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -248,10 +259,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('signer_index', $data ?? [], null); @@ -259,33 +270,34 @@ public function __construct(array $data = null) $this->setIfExists('required', $data ?? [], false); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubAttachment { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubAttachment { /** @var SubAttachment */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubAttachment::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -324,6 +336,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets name * @@ -337,14 +350,14 @@ public function getName() /** * Sets name * - * @param string $name the name of attachment + * @param string $name The name of attachment. * * @return self */ - public function setName(string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -368,10 +381,10 @@ public function getSignerIndex() * * @return self */ - public function setSignerIndex(int $signer_index) + public function setSignerIndex($signer_index) { if (is_null($signer_index)) { - throw new InvalidArgumentException('non-nullable signer_index cannot be null'); + throw new \InvalidArgumentException('non-nullable signer_index cannot be null'); } $this->container['signer_index'] = $signer_index; @@ -391,14 +404,14 @@ public function getInstructions() /** * Sets instructions * - * @param string|null $instructions the instructions for uploading the attachment + * @param string|null $instructions The instructions for uploading the attachment. * * @return self */ - public function setInstructions(?string $instructions) + public function setInstructions($instructions) { if (is_null($instructions)) { - throw new InvalidArgumentException('non-nullable instructions cannot be null'); + throw new \InvalidArgumentException('non-nullable instructions cannot be null'); } $this->container['instructions'] = $instructions; @@ -418,26 +431,27 @@ public function getRequired() /** * Sets required * - * @param bool|null $required determines if the attachment must be uploaded + * @param bool|null $required Determines if the attachment must be uploaded. * * @return self */ - public function setRequired(?bool $required) + public function setRequired($required) { if (is_null($required)) { - throw new InvalidArgumentException('non-nullable required cannot be null'); + throw new \InvalidArgumentException('non-nullable required cannot be null'); } $this->container['required'] = $required; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -446,11 +460,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -461,8 +475,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -475,9 +491,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -485,12 +503,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -519,3 +537,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubBulkSignerList.php b/sdks/php/src/Model/SubBulkSignerList.php index d9702bb7d..8d0c68c4c 100644 --- a/sdks/php/src/Model/SubBulkSignerList.php +++ b/sdks/php/src/Model/SubBulkSignerList.php @@ -1,11 +1,14 @@ */ -class SubBulkSignerList implements ModelInterface, ArrayAccess, JsonSerializable +class SubBulkSignerList implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubBulkSignerList'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'custom_fields' => '\Dropbox\Sign\Model\SubBulkSignerListCustomField[]', - 'signers' => '\Dropbox\Sign\Model\SubSignatureRequestTemplateSigner[]', + 'signers' => '\Dropbox\Sign\Model\SubSignatureRequestTemplateSigner[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'custom_fields' => null, - 'signers' => null, + 'signers' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'custom_fields' => false, - 'signers' => false, + 'signers' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'custom_fields' => 'custom_fields', - 'signers' => 'signers', + 'signers' => 'signers' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'custom_fields' => 'setCustomFields', - 'signers' => 'setSigners', + 'signers' => 'setSigners' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'custom_fields' => 'getCustomFields', - 'signers' => 'getSigners', + 'signers' => 'getSigners' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('custom_fields', $data ?? [], null); $this->setIfExists('signers', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubBulkSignerList { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubBulkSignerList { /** @var SubBulkSignerList */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubBulkSignerList::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -288,7 +300,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -302,6 +316,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets custom_fields * @@ -315,14 +330,14 @@ public function getCustomFields() /** * Sets custom_fields * - * @param SubBulkSignerListCustomField[]|null $custom_fields an array of custom field values + * @param SubBulkSignerListCustomField[]|null $custom_fields An array of custom field values. * * @return self */ - public function setCustomFields(?array $custom_fields) + public function setCustomFields($custom_fields) { if (is_null($custom_fields)) { - throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -346,22 +361,23 @@ public function getSigners() * * @return self */ - public function setSigners(?array $signers) + public function setSigners($signers) { if (is_null($signers)) { - throw new InvalidArgumentException('non-nullable signers cannot be null'); + throw new \InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -370,11 +386,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -385,8 +401,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -399,9 +417,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -409,12 +429,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -443,3 +463,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubBulkSignerListCustomField.php b/sdks/php/src/Model/SubBulkSignerListCustomField.php index 17f67ac95..397903419 100644 --- a/sdks/php/src/Model/SubBulkSignerListCustomField.php +++ b/sdks/php/src/Model/SubBulkSignerListCustomField.php @@ -1,11 +1,14 @@ */ -class SubBulkSignerListCustomField implements ModelInterface, ArrayAccess, JsonSerializable +class SubBulkSignerListCustomField implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubBulkSignerListCustomField'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', - 'value' => 'string', + 'value' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, - 'value' => null, + 'value' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'name' => false, - 'value' => false, + 'value' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'name' => 'name', - 'value' => 'value', + 'value' => 'value' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'name' => 'setName', - 'value' => 'setValue', + 'value' => 'setValue' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'name' => 'getName', - 'value' => 'getValue', + 'value' => 'getValue' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubBulkSignerListCustomField { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubBulkSignerListCustomField { /** @var SubBulkSignerListCustomField */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubBulkSignerListCustomField::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -310,6 +322,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets name * @@ -327,10 +340,10 @@ public function getName() * * @return self */ - public function setName(string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -350,26 +363,27 @@ public function getValue() /** * Sets value * - * @param string $value the value of the custom field + * @param string $value The value of the custom field. * * @return self */ - public function setValue(string $value) + public function setValue($value) { if (is_null($value)) { - throw new InvalidArgumentException('non-nullable value cannot be null'); + throw new \InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -378,11 +392,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -393,8 +407,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -407,9 +423,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -417,12 +435,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -451,3 +469,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubCC.php b/sdks/php/src/Model/SubCC.php index 0380a3889..56a7d14bd 100644 --- a/sdks/php/src/Model/SubCC.php +++ b/sdks/php/src/Model/SubCC.php @@ -1,11 +1,14 @@ */ -class SubCC implements ModelInterface, ArrayAccess, JsonSerializable +class SubCC implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubCC'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'role' => 'string', - 'email_address' => 'string', + 'email_address' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'role' => null, - 'email_address' => 'email', + 'email_address' => 'email' ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'role' => false, - 'email_address' => false, + 'email_address' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'role' => 'role', - 'email_address' => 'email_address', + 'email_address' => 'email_address' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'role' => 'setRole', - 'email_address' => 'setEmailAddress', + 'email_address' => 'setEmailAddress' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'role' => 'getRole', - 'email_address' => 'getEmailAddress', + 'email_address' => 'getEmailAddress' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('role', $data ?? [], null); $this->setIfExists('email_address', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubCC { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubCC { /** @var SubCC */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubCC::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -310,6 +322,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets role * @@ -327,10 +340,10 @@ public function getRole() * * @return self */ - public function setRole(string $role) + public function setRole($role) { if (is_null($role)) { - throw new InvalidArgumentException('non-nullable role cannot be null'); + throw new \InvalidArgumentException('non-nullable role cannot be null'); } $this->container['role'] = $role; @@ -350,26 +363,27 @@ public function getEmailAddress() /** * Sets email_address * - * @param string $email_address the email address of the CC recipient + * @param string $email_address The email address of the CC recipient. * * @return self */ - public function setEmailAddress(string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -378,11 +392,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -393,8 +407,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -407,9 +423,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -417,12 +435,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -451,3 +469,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubCustomField.php b/sdks/php/src/Model/SubCustomField.php index e853f9eb1..3084f80d4 100644 --- a/sdks/php/src/Model/SubCustomField.php +++ b/sdks/php/src/Model/SubCustomField.php @@ -1,11 +1,14 @@ */ -class SubCustomField implements ModelInterface, ArrayAccess, JsonSerializable +class SubCustomField implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubCustomField'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', 'editor' => 'string', 'required' => 'bool', - 'value' => 'string', + 'value' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, 'editor' => null, 'required' => null, - 'value' => null, + 'value' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'name' => false, 'editor' => false, 'required' => false, - 'value' => false, + 'value' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -119,6 +121,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -128,7 +132,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +142,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,6 +151,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -155,6 +162,9 @@ 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 { @@ -171,7 +181,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'name', 'editor' => 'editor', 'required' => 'required', - 'value' => 'value', + 'value' => 'value' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'setName', 'editor' => 'setEditor', 'required' => 'setRequired', - 'value' => 'setValue', + 'value' => 'setValue' ]; /** @@ -195,7 +205,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'getName', 'editor' => 'getEditor', 'required' => 'getRequired', - 'value' => 'getValue', + 'value' => 'getValue' ]; /** @@ -239,6 +249,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -249,10 +260,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('editor', $data ?? [], null); @@ -260,33 +271,34 @@ public function __construct(array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubCustomField { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubCustomField { /** @var SubCustomField */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubCustomField::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -322,6 +334,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets name * @@ -339,10 +352,10 @@ public function getName() * * @return self */ - public function setName(string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -366,10 +379,10 @@ public function getEditor() * * @return self */ - public function setEditor(?string $editor) + public function setEditor($editor) { if (is_null($editor)) { - throw new InvalidArgumentException('non-nullable editor cannot be null'); + throw new \InvalidArgumentException('non-nullable editor cannot be null'); } $this->container['editor'] = $editor; @@ -393,10 +406,10 @@ public function getRequired() * * @return self */ - public function setRequired(?bool $required) + public function setRequired($required) { if (is_null($required)) { - throw new InvalidArgumentException('non-nullable required cannot be null'); + throw new \InvalidArgumentException('non-nullable required cannot be null'); } $this->container['required'] = $required; @@ -416,26 +429,27 @@ public function getValue() /** * Sets value * - * @param string|null $value the string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing + * @param string|null $value The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing. * * @return self */ - public function setValue(?string $value) + public function setValue($value) { if (is_null($value)) { - throw new InvalidArgumentException('non-nullable value cannot be null'); + throw new \InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -444,11 +458,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -459,8 +473,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -473,9 +489,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -483,12 +501,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -517,3 +535,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubEditorOptions.php b/sdks/php/src/Model/SubEditorOptions.php index cd15d5965..d0cf50dbb 100644 --- a/sdks/php/src/Model/SubEditorOptions.php +++ b/sdks/php/src/Model/SubEditorOptions.php @@ -1,11 +1,14 @@ */ -class SubEditorOptions implements ModelInterface, ArrayAccess, JsonSerializable +class SubEditorOptions implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubEditorOptions'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'allow_edit_signers' => 'bool', - 'allow_edit_documents' => 'bool', + 'allow_edit_documents' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'allow_edit_signers' => null, - 'allow_edit_documents' => null, + 'allow_edit_documents' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'allow_edit_signers' => false, - 'allow_edit_documents' => false, + 'allow_edit_documents' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,6 +115,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -122,7 +126,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +136,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,6 +145,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -149,6 +156,9 @@ 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 { @@ -163,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'allow_edit_signers' => 'allow_edit_signers', - 'allow_edit_documents' => 'allow_edit_documents', + 'allow_edit_documents' => 'allow_edit_documents' ]; /** @@ -173,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'allow_edit_signers' => 'setAllowEditSigners', - 'allow_edit_documents' => 'setAllowEditDocuments', + 'allow_edit_documents' => 'setAllowEditDocuments' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'allow_edit_signers' => 'getAllowEditSigners', - 'allow_edit_documents' => 'getAllowEditDocuments', + 'allow_edit_documents' => 'getAllowEditDocuments' ]; /** @@ -227,6 +237,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -237,42 +248,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('allow_edit_signers', $data ?? [], false); $this->setIfExists('allow_edit_documents', $data ?? [], false); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubEditorOptions { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubEditorOptions { /** @var SubEditorOptions */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubEditorOptions::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -289,7 +301,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -303,6 +317,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets allow_edit_signers * @@ -320,10 +335,10 @@ public function getAllowEditSigners() * * @return self */ - public function setAllowEditSigners(?bool $allow_edit_signers) + public function setAllowEditSigners($allow_edit_signers) { if (is_null($allow_edit_signers)) { - throw new InvalidArgumentException('non-nullable allow_edit_signers cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_edit_signers cannot be null'); } $this->container['allow_edit_signers'] = $allow_edit_signers; @@ -347,22 +362,23 @@ public function getAllowEditDocuments() * * @return self */ - public function setAllowEditDocuments(?bool $allow_edit_documents) + public function setAllowEditDocuments($allow_edit_documents) { if (is_null($allow_edit_documents)) { - throw new InvalidArgumentException('non-nullable allow_edit_documents cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_edit_documents cannot be null'); } $this->container['allow_edit_documents'] = $allow_edit_documents; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -371,11 +387,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -386,8 +402,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -400,9 +418,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -410,12 +430,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -444,3 +464,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubFieldOptions.php b/sdks/php/src/Model/SubFieldOptions.php index 974daa4a9..eac5b169d 100644 --- a/sdks/php/src/Model/SubFieldOptions.php +++ b/sdks/php/src/Model/SubFieldOptions.php @@ -1,11 +1,14 @@ */ -class SubFieldOptions implements ModelInterface, ArrayAccess, JsonSerializable +class SubFieldOptions implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFieldOptions'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'date_format' => 'string', + 'date_format' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'date_format' => null, + 'date_format' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'date_format' => false, + 'date_format' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,6 +112,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -119,7 +123,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -129,7 +133,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -138,6 +142,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -146,6 +153,9 @@ 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 { @@ -159,7 +169,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'date_format' => 'date_format', + 'date_format' => 'date_format' ]; /** @@ -168,7 +178,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'date_format' => 'setDateFormat', + 'date_format' => 'setDateFormat' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'date_format' => 'getDateFormat', + 'date_format' => 'getDateFormat' ]; /** @@ -255,41 +265,42 @@ public function getDateFormatAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('date_format', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubFieldOptions { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubFieldOptions { /** @var SubFieldOptions */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubFieldOptions::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -334,6 +345,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets date_format * @@ -347,18 +359,18 @@ public function getDateFormat() /** * Sets date_format * - * @param string $date_format allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher + * @param string $date_format Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher. * * @return self */ - public function setDateFormat(string $date_format) + public function setDateFormat($date_format) { if (is_null($date_format)) { - throw new InvalidArgumentException('non-nullable date_format cannot be null'); + throw new \InvalidArgumentException('non-nullable date_format cannot be null'); } $allowedValues = $this->getDateFormatAllowableValues(); if (!in_array($date_format, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'date_format', must be one of '%s'", $date_format, @@ -370,13 +382,14 @@ public function setDateFormat(string $date_format) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -385,11 +398,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -400,8 +413,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -414,9 +429,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -424,12 +441,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -458,3 +475,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubFormFieldGroup.php b/sdks/php/src/Model/SubFormFieldGroup.php index 2ff53e101..da649762e 100644 --- a/sdks/php/src/Model/SubFormFieldGroup.php +++ b/sdks/php/src/Model/SubFormFieldGroup.php @@ -1,11 +1,14 @@ */ -class SubFormFieldGroup implements ModelInterface, ArrayAccess, JsonSerializable +class SubFormFieldGroup implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldGroup'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'group_id' => 'string', 'group_label' => 'string', - 'requirement' => 'string', + 'requirement' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'group_id' => null, 'group_label' => null, - 'requirement' => null, + 'requirement' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'group_id' => false, 'group_label' => false, - 'requirement' => false, + 'requirement' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'group_id' => 'group_id', 'group_label' => 'group_label', - 'requirement' => 'requirement', + 'requirement' => 'requirement' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'group_id' => 'setGroupId', 'group_label' => 'setGroupLabel', - 'requirement' => 'setRequirement', + 'requirement' => 'setRequirement' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'group_id' => 'getGroupId', 'group_label' => 'getGroupLabel', - 'requirement' => 'getRequirement', + 'requirement' => 'getRequirement' ]; /** @@ -232,6 +242,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -242,43 +253,44 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('group_id', $data ?? [], null); $this->setIfExists('group_label', $data ?? [], null); $this->setIfExists('requirement', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubFormFieldGroup { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubFormFieldGroup { /** @var SubFormFieldGroup */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubFormFieldGroup::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -320,6 +332,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets group_id * @@ -337,10 +350,10 @@ public function getGroupId() * * @return self */ - public function setGroupId(string $group_id) + public function setGroupId($group_id) { if (is_null($group_id)) { - throw new InvalidArgumentException('non-nullable group_id cannot be null'); + throw new \InvalidArgumentException('non-nullable group_id cannot be null'); } $this->container['group_id'] = $group_id; @@ -364,10 +377,10 @@ public function getGroupLabel() * * @return self */ - public function setGroupLabel(string $group_label) + public function setGroupLabel($group_label) { if (is_null($group_label)) { - throw new InvalidArgumentException('non-nullable group_label cannot be null'); + throw new \InvalidArgumentException('non-nullable group_label cannot be null'); } $this->container['group_label'] = $group_label; @@ -391,22 +404,23 @@ public function getRequirement() * * @return self */ - public function setRequirement(string $requirement) + public function setRequirement($requirement) { if (is_null($requirement)) { - throw new InvalidArgumentException('non-nullable requirement cannot be null'); + throw new \InvalidArgumentException('non-nullable requirement cannot be null'); } $this->container['requirement'] = $requirement; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -415,11 +429,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -430,8 +444,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -444,9 +460,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -454,12 +472,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -488,3 +506,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubFormFieldRule.php b/sdks/php/src/Model/SubFormFieldRule.php index 094d8217c..5da8f60f8 100644 --- a/sdks/php/src/Model/SubFormFieldRule.php +++ b/sdks/php/src/Model/SubFormFieldRule.php @@ -1,11 +1,14 @@ */ -class SubFormFieldRule implements ModelInterface, ArrayAccess, JsonSerializable +class SubFormFieldRule implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldRule'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'trigger_operator' => 'string', 'triggers' => '\Dropbox\Sign\Model\SubFormFieldRuleTrigger[]', - 'actions' => '\Dropbox\Sign\Model\SubFormFieldRuleAction[]', + 'actions' => '\Dropbox\Sign\Model\SubFormFieldRuleAction[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'id' => null, 'trigger_operator' => null, 'triggers' => null, - 'actions' => null, + 'actions' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'id' => false, 'trigger_operator' => false, 'triggers' => false, - 'actions' => false, + 'actions' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -118,6 +120,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -127,7 +131,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -137,7 +141,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -146,6 +150,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -154,6 +161,9 @@ 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 { @@ -170,7 +180,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'id', 'trigger_operator' => 'trigger_operator', 'triggers' => 'triggers', - 'actions' => 'actions', + 'actions' => 'actions' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'setId', 'trigger_operator' => 'setTriggerOperator', 'triggers' => 'setTriggers', - 'actions' => 'setActions', + 'actions' => 'setActions' ]; /** @@ -194,7 +204,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'getId', 'trigger_operator' => 'getTriggerOperator', 'triggers' => 'getTriggers', - 'actions' => 'getActions', + 'actions' => 'getActions' ]; /** @@ -238,6 +248,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -248,10 +259,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('trigger_operator', $data ?? [], 'AND'); @@ -259,33 +270,34 @@ public function __construct(array $data = null) $this->setIfExists('actions', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubFormFieldRule { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubFormFieldRule { /** @var SubFormFieldRule */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubFormFieldRule::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -313,18 +325,18 @@ public function listInvalidProperties() if ($this->container['triggers'] === null) { $invalidProperties[] = "'triggers' can't be null"; } - if (count($this->container['triggers']) > 1) { + if ((count($this->container['triggers']) > 1)) { $invalidProperties[] = "invalid value for 'triggers', number of items must be less than or equal to 1."; } - if (count($this->container['triggers']) < 1) { + if ((count($this->container['triggers']) < 1)) { $invalidProperties[] = "invalid value for 'triggers', number of items must be greater than or equal to 1."; } if ($this->container['actions'] === null) { $invalidProperties[] = "'actions' can't be null"; } - if (count($this->container['actions']) < 1) { + if ((count($this->container['actions']) < 1)) { $invalidProperties[] = "invalid value for 'actions', number of items must be greater than or equal to 1."; } @@ -342,6 +354,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets id * @@ -355,14 +368,14 @@ public function getId() /** * Sets id * - * @param string $id must be unique across all defined rules + * @param string $id Must be unique across all defined rules. * * @return self */ - public function setId(string $id) + public function setId($id) { if (is_null($id)) { - throw new InvalidArgumentException('non-nullable id cannot be null'); + throw new \InvalidArgumentException('non-nullable id cannot be null'); } $this->container['id'] = $id; @@ -386,10 +399,10 @@ public function getTriggerOperator() * * @return self */ - public function setTriggerOperator(string $trigger_operator) + public function setTriggerOperator($trigger_operator) { if (is_null($trigger_operator)) { - throw new InvalidArgumentException('non-nullable trigger_operator cannot be null'); + throw new \InvalidArgumentException('non-nullable trigger_operator cannot be null'); } $this->container['trigger_operator'] = $trigger_operator; @@ -413,17 +426,17 @@ public function getTriggers() * * @return self */ - public function setTriggers(array $triggers) + public function setTriggers($triggers) { if (is_null($triggers)) { - throw new InvalidArgumentException('non-nullable triggers cannot be null'); + throw new \InvalidArgumentException('non-nullable triggers cannot be null'); } - if (count($triggers) > 1) { - throw new InvalidArgumentException('invalid value for $triggers when calling SubFormFieldRule., number of items must be less than or equal to 1.'); + if ((count($triggers) > 1)) { + throw new \InvalidArgumentException('invalid value for $triggers when calling SubFormFieldRule., number of items must be less than or equal to 1.'); } - if (count($triggers) < 1) { - throw new InvalidArgumentException('invalid length for $triggers when calling SubFormFieldRule., number of items must be greater than or equal to 1.'); + if ((count($triggers) < 1)) { + throw new \InvalidArgumentException('invalid length for $triggers when calling SubFormFieldRule., number of items must be greater than or equal to 1.'); } $this->container['triggers'] = $triggers; @@ -447,26 +460,28 @@ public function getActions() * * @return self */ - public function setActions(array $actions) + public function setActions($actions) { if (is_null($actions)) { - throw new InvalidArgumentException('non-nullable actions cannot be null'); + throw new \InvalidArgumentException('non-nullable actions cannot be null'); } - if (count($actions) < 1) { - throw new InvalidArgumentException('invalid length for $actions when calling SubFormFieldRule., number of items must be greater than or equal to 1.'); + + if ((count($actions) < 1)) { + throw new \InvalidArgumentException('invalid length for $actions when calling SubFormFieldRule., number of items must be greater than or equal to 1.'); } $this->container['actions'] = $actions; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -475,11 +490,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -490,8 +505,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -504,9 +521,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -514,12 +533,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -548,3 +567,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubFormFieldRuleAction.php b/sdks/php/src/Model/SubFormFieldRuleAction.php index 458b5822f..49b0c305a 100644 --- a/sdks/php/src/Model/SubFormFieldRuleAction.php +++ b/sdks/php/src/Model/SubFormFieldRuleAction.php @@ -1,11 +1,14 @@ */ -class SubFormFieldRuleAction implements ModelInterface, ArrayAccess, JsonSerializable +class SubFormFieldRuleAction implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldRuleAction'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'hidden' => 'bool', 'type' => 'string', 'field_id' => 'string', - 'group_id' => 'string', + 'group_id' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'hidden' => null, 'type' => null, 'field_id' => null, - 'group_id' => null, + 'group_id' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'hidden' => false, 'type' => false, 'field_id' => false, - 'group_id' => false, + 'group_id' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -118,6 +120,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -127,7 +131,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -137,7 +141,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -146,6 +150,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -154,6 +161,9 @@ 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 { @@ -170,7 +180,7 @@ public function isNullableSetToNull(string $property): bool 'hidden' => 'hidden', 'type' => 'type', 'field_id' => 'field_id', - 'group_id' => 'group_id', + 'group_id' => 'group_id' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'hidden' => 'setHidden', 'type' => 'setType', 'field_id' => 'setFieldId', - 'group_id' => 'setGroupId', + 'group_id' => 'setGroupId' ]; /** @@ -194,7 +204,7 @@ public function isNullableSetToNull(string $property): bool 'hidden' => 'getHidden', 'type' => 'getType', 'field_id' => 'getFieldId', - 'group_id' => 'getGroupId', + 'group_id' => 'getGroupId' ]; /** @@ -238,8 +248,8 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_FIELD_VISIBILITY = 'change-field-visibility'; - public const TYPE_GROUP_VISIBILITY = 'change-group-visibility'; + public const TYPE_CHANGE_FIELD_VISIBILITY = 'change-field-visibility'; + public const TYPE_CHANGE_GROUP_VISIBILITY = 'change-group-visibility'; /** * Gets allowable values of the enum @@ -249,8 +259,8 @@ public function getModelName() public function getTypeAllowableValues() { return [ - self::TYPE_FIELD_VISIBILITY, - self::TYPE_GROUP_VISIBILITY, + self::TYPE_CHANGE_FIELD_VISIBILITY, + self::TYPE_CHANGE_GROUP_VISIBILITY, ]; } @@ -264,10 +274,10 @@ public function getTypeAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('hidden', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); @@ -275,33 +285,34 @@ public function __construct(array $data = null) $this->setIfExists('group_id', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubFormFieldRuleAction { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubFormFieldRuleAction { /** @var SubFormFieldRuleAction */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubFormFieldRuleAction::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -349,6 +360,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets hidden * @@ -362,14 +374,14 @@ public function getHidden() /** * Sets hidden * - * @param bool $hidden `true` to hide the target field when rule is satisfied, otherwise `false` + * @param bool $hidden `true` to hide the target field when rule is satisfied, otherwise `false`. * * @return self */ - public function setHidden(bool $hidden) + public function setHidden($hidden) { if (is_null($hidden)) { - throw new InvalidArgumentException('non-nullable hidden cannot be null'); + throw new \InvalidArgumentException('non-nullable hidden cannot be null'); } $this->container['hidden'] = $hidden; @@ -393,14 +405,14 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'type', must be one of '%s'", $type, @@ -430,10 +442,10 @@ public function getFieldId() * * @return self */ - public function setFieldId(?string $field_id) + public function setFieldId($field_id) { if (is_null($field_id)) { - throw new InvalidArgumentException('non-nullable field_id cannot be null'); + throw new \InvalidArgumentException('non-nullable field_id cannot be null'); } $this->container['field_id'] = $field_id; @@ -457,22 +469,23 @@ public function getGroupId() * * @return self */ - public function setGroupId(?string $group_id) + public function setGroupId($group_id) { if (is_null($group_id)) { - throw new InvalidArgumentException('non-nullable group_id cannot be null'); + throw new \InvalidArgumentException('non-nullable group_id cannot be null'); } $this->container['group_id'] = $group_id; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -481,11 +494,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -496,8 +509,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -510,9 +525,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -520,12 +537,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -554,3 +571,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubFormFieldRuleTrigger.php b/sdks/php/src/Model/SubFormFieldRuleTrigger.php index 0ab5768e0..3e42258fd 100644 --- a/sdks/php/src/Model/SubFormFieldRuleTrigger.php +++ b/sdks/php/src/Model/SubFormFieldRuleTrigger.php @@ -1,11 +1,14 @@ */ -class SubFormFieldRuleTrigger implements ModelInterface, ArrayAccess, JsonSerializable +class SubFormFieldRuleTrigger implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldRuleTrigger'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'operator' => 'string', 'value' => 'string', - 'values' => 'string[]', + 'values' => 'string[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'id' => null, 'operator' => null, 'value' => null, - 'values' => null, + 'values' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'id' => false, 'operator' => false, 'value' => false, - 'values' => false, + 'values' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -118,6 +120,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -127,7 +131,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -137,7 +141,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -146,6 +150,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -154,6 +161,9 @@ 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 { @@ -170,7 +180,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'id', 'operator' => 'operator', 'value' => 'value', - 'values' => 'values', + 'values' => 'values' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'setId', 'operator' => 'setOperator', 'value' => 'setValue', - 'values' => 'setValues', + 'values' => 'setValues' ]; /** @@ -194,7 +204,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'getId', 'operator' => 'getOperator', 'value' => 'getValue', - 'values' => 'getValues', + 'values' => 'getValues' ]; /** @@ -270,10 +280,10 @@ public function getOperatorAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); @@ -281,33 +291,34 @@ public function __construct(array $data = null) $this->setIfExists('values', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubFormFieldRuleTrigger { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubFormFieldRuleTrigger { /** @var SubFormFieldRuleTrigger */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubFormFieldRuleTrigger::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -355,6 +366,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets id * @@ -372,10 +384,10 @@ public function getId() * * @return self */ - public function setId(string $id) + public function setId($id) { if (is_null($id)) { - throw new InvalidArgumentException('non-nullable id cannot be null'); + throw new \InvalidArgumentException('non-nullable id cannot be null'); } $this->container['id'] = $id; @@ -399,14 +411,14 @@ public function getOperator() * * @return self */ - public function setOperator(string $operator) + public function setOperator($operator) { if (is_null($operator)) { - throw new InvalidArgumentException('non-nullable operator cannot be null'); + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } $allowedValues = $this->getOperatorAllowableValues(); if (!in_array($operator, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'operator', must be one of '%s'", $operator, @@ -436,10 +448,10 @@ public function getValue() * * @return self */ - public function setValue(?string $value) + public function setValue($value) { if (is_null($value)) { - throw new InvalidArgumentException('non-nullable value cannot be null'); + throw new \InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; @@ -463,22 +475,23 @@ public function getValues() * * @return self */ - public function setValues(?array $values) + public function setValues($values) { if (is_null($values)) { - throw new InvalidArgumentException('non-nullable values cannot be null'); + throw new \InvalidArgumentException('non-nullable values cannot be null'); } $this->container['values'] = $values; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -487,11 +500,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -502,8 +515,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -516,9 +531,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -526,12 +543,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -560,3 +577,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentBase.php b/sdks/php/src/Model/SubFormFieldsPerDocumentBase.php index 68158bf5a..e1f048ce9 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentBase.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentBase.php @@ -1,11 +1,14 @@ */ -class SubFormFieldsPerDocumentBase implements ModelInterface, ArrayAccess, JsonSerializable +class SubFormFieldsPerDocumentBase implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = 'type'; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentBase'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'document_index' => 'int', 'api_id' => 'string', @@ -68,16 +70,16 @@ class SubFormFieldsPerDocumentBase implements ModelInterface, ArrayAccess, JsonS 'x' => 'int', 'y' => 'int', 'name' => 'string', - 'page' => 'int', + 'page' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'document_index' => null, 'api_id' => null, @@ -89,14 +91,14 @@ class SubFormFieldsPerDocumentBase implements ModelInterface, ArrayAccess, JsonS 'x' => null, 'y' => null, 'name' => null, - 'page' => null, + 'page' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'document_index' => false, 'api_id' => false, @@ -108,14 +110,14 @@ class SubFormFieldsPerDocumentBase implements ModelInterface, ArrayAccess, JsonS 'x' => false, 'y' => false, 'name' => false, - 'page' => true, + 'page' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -140,6 +142,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -149,7 +153,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -159,7 +163,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -168,6 +172,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -176,6 +183,9 @@ 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 { @@ -199,7 +209,7 @@ public function isNullableSetToNull(string $property): bool 'x' => 'x', 'y' => 'y', 'name' => 'name', - 'page' => 'page', + 'page' => 'page' ]; /** @@ -218,7 +228,7 @@ public function isNullableSetToNull(string $property): bool 'x' => 'setX', 'y' => 'setY', 'name' => 'setName', - 'page' => 'setPage', + 'page' => 'setPage' ]; /** @@ -237,7 +247,7 @@ public function isNullableSetToNull(string $property): bool 'x' => 'getX', 'y' => 'getY', 'name' => 'getName', - 'page' => 'getPage', + 'page' => 'getPage' ]; /** @@ -281,6 +291,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -291,10 +302,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('document_index', $data ?? [], null); $this->setIfExists('api_id', $data ?? [], null); @@ -312,6 +323,7 @@ public function __construct(array $data = null) $this->container['type'] = static::$openAPIModelName; } + public static function discriminatorClassName(array $data): ?string { if (!array_key_exists('type', $data)) { @@ -353,12 +365,14 @@ public static function discriminatorClassName(array $data): ?string } /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -418,6 +432,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets document_index * @@ -431,14 +446,14 @@ public function getDocumentIndex() /** * Sets document_index * - * @param int $document_index represents the integer index of the `file` or `file_url` document the field should be attached to + * @param int $document_index Represents the integer index of the `file` or `file_url` document the field should be attached to. * * @return self */ - public function setDocumentIndex(int $document_index) + public function setDocumentIndex($document_index) { if (is_null($document_index)) { - throw new InvalidArgumentException('non-nullable document_index cannot be null'); + throw new \InvalidArgumentException('non-nullable document_index cannot be null'); } $this->container['document_index'] = $document_index; @@ -458,14 +473,14 @@ public function getApiId() /** * Sets api_id * - * @param string $api_id an identifier for the field that is unique across all documents in the request + * @param string $api_id An identifier for the field that is unique across all documents in the request. * * @return self */ - public function setApiId(string $api_id) + public function setApiId($api_id) { if (is_null($api_id)) { - throw new InvalidArgumentException('non-nullable api_id cannot be null'); + throw new \InvalidArgumentException('non-nullable api_id cannot be null'); } $this->container['api_id'] = $api_id; @@ -485,14 +500,14 @@ public function getHeight() /** * Sets height * - * @param int $height size of the field in pixels + * @param int $height Size of the field in pixels. * * @return self */ - public function setHeight(int $height) + public function setHeight($height) { if (is_null($height)) { - throw new InvalidArgumentException('non-nullable height cannot be null'); + throw new \InvalidArgumentException('non-nullable height cannot be null'); } $this->container['height'] = $height; @@ -512,14 +527,14 @@ public function getRequired() /** * Sets required * - * @param bool $required whether this field is required + * @param bool $required Whether this field is required. * * @return self */ - public function setRequired(bool $required) + public function setRequired($required) { if (is_null($required)) { - throw new InvalidArgumentException('non-nullable required cannot be null'); + throw new \InvalidArgumentException('non-nullable required cannot be null'); } $this->container['required'] = $required; @@ -543,10 +558,10 @@ public function getSigner() * * @return self */ - public function setSigner(string $signer) + public function setSigner($signer) { if (is_null($signer)) { - throw new InvalidArgumentException('non-nullable signer cannot be null'); + throw new \InvalidArgumentException('non-nullable signer cannot be null'); } $this->container['signer'] = $signer; @@ -570,10 +585,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -593,14 +608,14 @@ public function getWidth() /** * Sets width * - * @param int $width size of the field in pixels + * @param int $width Size of the field in pixels. * * @return self */ - public function setWidth(int $width) + public function setWidth($width) { if (is_null($width)) { - throw new InvalidArgumentException('non-nullable width cannot be null'); + throw new \InvalidArgumentException('non-nullable width cannot be null'); } $this->container['width'] = $width; @@ -620,14 +635,14 @@ public function getX() /** * Sets x * - * @param int $x location coordinates of the field in pixels + * @param int $x Location coordinates of the field in pixels. * * @return self */ - public function setX(int $x) + public function setX($x) { if (is_null($x)) { - throw new InvalidArgumentException('non-nullable x cannot be null'); + throw new \InvalidArgumentException('non-nullable x cannot be null'); } $this->container['x'] = $x; @@ -647,14 +662,14 @@ public function getY() /** * Sets y * - * @param int $y location coordinates of the field in pixels + * @param int $y Location coordinates of the field in pixels. * * @return self */ - public function setY(int $y) + public function setY($y) { if (is_null($y)) { - throw new InvalidArgumentException('non-nullable y cannot be null'); + throw new \InvalidArgumentException('non-nullable y cannot be null'); } $this->container['y'] = $y; @@ -674,14 +689,14 @@ public function getName() /** * Sets name * - * @param string|null $name display name for the field + * @param string|null $name Display name for the field. * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -705,13 +720,13 @@ public function getPage() * * @return self */ - public function setPage(?int $page) + public function setPage($page) { if (is_null($page)) { array_push($this->openAPINullablesSetToNull, 'page'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('page', $nullablesSetToNull); + $index = array_search('page', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -721,13 +736,14 @@ public function setPage(?int $page) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -736,11 +752,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -751,8 +767,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -765,9 +783,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -775,12 +795,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -809,3 +829,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentCheckbox.php b/sdks/php/src/Model/SubFormFieldsPerDocumentCheckbox.php index c023916c7..c4a701564 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentCheckbox.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentCheckbox.php @@ -1,11 +1,14 @@ */ class SubFormFieldsPerDocumentCheckbox extends SubFormFieldsPerDocumentBase @@ -44,52 +46,52 @@ class SubFormFieldsPerDocumentCheckbox extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentCheckbox'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'is_checked' => 'bool', - 'group' => 'string', + 'group' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'is_checked' => null, - 'group' => null, + 'group' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, 'is_checked' => false, - 'group' => false, + 'group' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,6 +116,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -123,7 +127,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -133,7 +137,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -142,6 +146,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -150,6 +157,9 @@ 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 { @@ -165,7 +175,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'is_checked' => 'is_checked', - 'group' => 'group', + 'group' => 'group' ]; /** @@ -176,7 +186,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'is_checked' => 'setIsChecked', - 'group' => 'setGroup', + 'group' => 'setGroup' ]; /** @@ -187,7 +197,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'is_checked' => 'getIsChecked', - 'group' => 'getGroup', + 'group' => 'getGroup' ]; /** @@ -231,13 +241,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -246,33 +258,34 @@ public function __construct(array $data = null) $this->setIfExists('group', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubFormFieldsPerDocumentCheckbox { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubFormFieldsPerDocumentCheckbox { /** @var SubFormFieldsPerDocumentCheckbox */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentCheckbox::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -311,6 +324,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -328,10 +342,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -351,14 +365,14 @@ public function getIsChecked() /** * Sets is_checked * - * @param bool $is_checked `true` for checking the checkbox field by default, otherwise `false` + * @param bool $is_checked `true` for checking the checkbox field by default, otherwise `false`. * * @return self */ - public function setIsChecked(bool $is_checked) + public function setIsChecked($is_checked) { if (is_null($is_checked)) { - throw new InvalidArgumentException('non-nullable is_checked cannot be null'); + throw new \InvalidArgumentException('non-nullable is_checked cannot be null'); } $this->container['is_checked'] = $is_checked; @@ -378,26 +392,27 @@ public function getGroup() /** * Sets group * - * @param string|null $group string referencing group defined in `form_field_groups` parameter + * @param string|null $group String referencing group defined in `form_field_groups` parameter. * * @return self */ - public function setGroup(?string $group) + public function setGroup($group) { if (is_null($group)) { - throw new InvalidArgumentException('non-nullable group cannot be null'); + throw new \InvalidArgumentException('non-nullable group cannot be null'); } $this->container['group'] = $group; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -406,11 +421,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -421,8 +436,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -435,9 +452,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -445,12 +464,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -479,3 +498,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentCheckboxMerge.php b/sdks/php/src/Model/SubFormFieldsPerDocumentCheckboxMerge.php index c3924079b..c0bb47c58 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentCheckboxMerge.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentCheckboxMerge.php @@ -1,11 +1,14 @@ */ class SubFormFieldsPerDocumentCheckboxMerge extends SubFormFieldsPerDocumentBase @@ -44,46 +46,46 @@ class SubFormFieldsPerDocumentCheckboxMerge extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentCheckboxMerge'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string', + 'type' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null, + 'type' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'type' => false, + 'type' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -108,6 +110,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -117,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -127,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -136,6 +140,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -144,6 +151,9 @@ 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 { @@ -157,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', + 'type' => 'type' ]; /** @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', + 'type' => 'setType' ]; /** @@ -175,7 +185,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', + 'type' => 'getType' ]; /** @@ -219,46 +229,49 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); $this->setIfExists('type', $data ?? [], 'checkbox-merge'); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubFormFieldsPerDocumentCheckboxMerge { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubFormFieldsPerDocumentCheckboxMerge { /** @var SubFormFieldsPerDocumentCheckboxMerge */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentCheckboxMerge::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,6 +307,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -311,22 +325,23 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -335,11 +350,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -350,8 +365,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -364,9 +381,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -374,12 +393,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -408,3 +427,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentDateSigned.php b/sdks/php/src/Model/SubFormFieldsPerDocumentDateSigned.php index 5902025ad..8fe168bc6 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentDateSigned.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentDateSigned.php @@ -1,11 +1,14 @@ */ class SubFormFieldsPerDocumentDateSigned extends SubFormFieldsPerDocumentBase @@ -44,52 +46,52 @@ class SubFormFieldsPerDocumentDateSigned extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentDateSigned'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'font_family' => 'string', - 'font_size' => 'int', + 'font_size' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'font_family' => null, - 'font_size' => null, + 'font_size' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, 'font_family' => false, - 'font_size' => false, + 'font_size' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,6 +116,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -123,7 +127,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -133,7 +137,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -142,6 +146,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -150,6 +157,9 @@ 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 { @@ -165,7 +175,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'font_family' => 'font_family', - 'font_size' => 'font_size', + 'font_size' => 'font_size' ]; /** @@ -176,7 +186,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'font_family' => 'setFontFamily', - 'font_size' => 'setFontSize', + 'font_size' => 'setFontSize' ]; /** @@ -187,7 +197,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'font_family' => 'getFontFamily', - 'font_size' => 'getFontSize', + 'font_size' => 'getFontSize' ]; /** @@ -275,13 +285,14 @@ public function getFontFamilyAllowableValues() ]; } + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -290,33 +301,34 @@ public function __construct(array $data = null) $this->setIfExists('font_size', $data ?? [], 12); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubFormFieldsPerDocumentDateSigned { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubFormFieldsPerDocumentDateSigned { /** @var SubFormFieldsPerDocumentDateSigned */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentDateSigned::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -361,6 +373,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -378,10 +391,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -401,18 +414,18 @@ public function getFontFamily() /** * Sets font_family * - * @param string|null $font_family font family for the field + * @param string|null $font_family Font family for the field. * * @return self */ - public function setFontFamily(?string $font_family) + public function setFontFamily($font_family) { if (is_null($font_family)) { - throw new InvalidArgumentException('non-nullable font_family cannot be null'); + throw new \InvalidArgumentException('non-nullable font_family cannot be null'); } $allowedValues = $this->getFontFamilyAllowableValues(); if (!in_array($font_family, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'font_family', must be one of '%s'", $font_family, @@ -442,22 +455,23 @@ public function getFontSize() * * @return self */ - public function setFontSize(?int $font_size) + public function setFontSize($font_size) { if (is_null($font_size)) { - throw new InvalidArgumentException('non-nullable font_size cannot be null'); + throw new \InvalidArgumentException('non-nullable font_size cannot be null'); } $this->container['font_size'] = $font_size; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -466,11 +480,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -481,8 +495,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -495,9 +511,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -505,12 +523,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -539,3 +557,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentDropdown.php b/sdks/php/src/Model/SubFormFieldsPerDocumentDropdown.php index 121c3eb48..d17020c31 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentDropdown.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentDropdown.php @@ -1,11 +1,14 @@ */ class SubFormFieldsPerDocumentDropdown extends SubFormFieldsPerDocumentBase @@ -44,58 +46,58 @@ class SubFormFieldsPerDocumentDropdown extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentDropdown'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'options' => 'string[]', 'content' => 'string', 'font_family' => 'string', - 'font_size' => 'int', + 'font_size' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'options' => null, 'content' => null, 'font_family' => null, - 'font_size' => null, + 'font_size' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, 'options' => false, 'content' => false, 'font_family' => false, - 'font_size' => false, + 'font_size' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -120,6 +122,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -129,7 +133,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -139,7 +143,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -148,6 +152,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -156,6 +163,9 @@ 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 { @@ -173,7 +183,7 @@ public function isNullableSetToNull(string $property): bool 'options' => 'options', 'content' => 'content', 'font_family' => 'font_family', - 'font_size' => 'font_size', + 'font_size' => 'font_size' ]; /** @@ -186,7 +196,7 @@ public function isNullableSetToNull(string $property): bool 'options' => 'setOptions', 'content' => 'setContent', 'font_family' => 'setFontFamily', - 'font_size' => 'setFontSize', + 'font_size' => 'setFontSize' ]; /** @@ -199,7 +209,7 @@ public function isNullableSetToNull(string $property): bool 'options' => 'getOptions', 'content' => 'getContent', 'font_family' => 'getFontFamily', - 'font_size' => 'getFontSize', + 'font_size' => 'getFontSize' ]; /** @@ -287,13 +297,14 @@ public function getFontFamilyAllowableValues() ]; } + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -304,33 +315,34 @@ public function __construct(array $data = null) $this->setIfExists('font_size', $data ?? [], 12); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubFormFieldsPerDocumentDropdown { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubFormFieldsPerDocumentDropdown { /** @var SubFormFieldsPerDocumentDropdown */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentDropdown::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -355,7 +367,7 @@ public function listInvalidProperties() if ($this->container['options'] === null) { $invalidProperties[] = "'options' can't be null"; } - if (count($this->container['options']) < 1) { + if ((count($this->container['options']) < 1)) { $invalidProperties[] = "invalid value for 'options', number of items must be greater than or equal to 1."; } @@ -382,6 +394,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -399,10 +412,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -422,18 +435,19 @@ public function getOptions() /** * Sets options * - * @param string[] $options array of string values representing dropdown values + * @param string[] $options Array of string values representing dropdown values. * * @return self */ - public function setOptions(array $options) + public function setOptions($options) { if (is_null($options)) { - throw new InvalidArgumentException('non-nullable options cannot be null'); + throw new \InvalidArgumentException('non-nullable options cannot be null'); } - if (count($options) < 1) { - throw new InvalidArgumentException('invalid length for $options when calling SubFormFieldsPerDocumentDropdown., number of items must be greater than or equal to 1.'); + + if ((count($options) < 1)) { + throw new \InvalidArgumentException('invalid length for $options when calling SubFormFieldsPerDocumentDropdown., number of items must be greater than or equal to 1.'); } $this->container['options'] = $options; @@ -457,10 +471,10 @@ public function getContent() * * @return self */ - public function setContent(?string $content) + public function setContent($content) { if (is_null($content)) { - throw new InvalidArgumentException('non-nullable content cannot be null'); + throw new \InvalidArgumentException('non-nullable content cannot be null'); } $this->container['content'] = $content; @@ -480,18 +494,18 @@ public function getFontFamily() /** * Sets font_family * - * @param string|null $font_family font family for the field + * @param string|null $font_family Font family for the field. * * @return self */ - public function setFontFamily(?string $font_family) + public function setFontFamily($font_family) { if (is_null($font_family)) { - throw new InvalidArgumentException('non-nullable font_family cannot be null'); + throw new \InvalidArgumentException('non-nullable font_family cannot be null'); } $allowedValues = $this->getFontFamilyAllowableValues(); if (!in_array($font_family, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'font_family', must be one of '%s'", $font_family, @@ -521,22 +535,23 @@ public function getFontSize() * * @return self */ - public function setFontSize(?int $font_size) + public function setFontSize($font_size) { if (is_null($font_size)) { - throw new InvalidArgumentException('non-nullable font_size cannot be null'); + throw new \InvalidArgumentException('non-nullable font_size cannot be null'); } $this->container['font_size'] = $font_size; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -545,11 +560,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -560,8 +575,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -574,9 +591,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -584,12 +603,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -618,3 +637,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentFontEnum.php b/sdks/php/src/Model/SubFormFieldsPerDocumentFontEnum.php index bc0eff196..377d7df3a 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentFontEnum.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentFontEnum.php @@ -1,11 +1,14 @@ */ class SubFormFieldsPerDocumentHyperlink extends SubFormFieldsPerDocumentBase @@ -44,58 +46,58 @@ class SubFormFieldsPerDocumentHyperlink extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentHyperlink'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'content' => 'string', 'content_url' => 'string', 'font_family' => 'string', - 'font_size' => 'int', + 'font_size' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'content' => null, 'content_url' => null, 'font_family' => null, - 'font_size' => null, + 'font_size' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, 'content' => false, 'content_url' => false, 'font_family' => false, - 'font_size' => false, + 'font_size' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -120,6 +122,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -129,7 +133,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -139,7 +143,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -148,6 +152,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -156,6 +163,9 @@ 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 { @@ -173,7 +183,7 @@ public function isNullableSetToNull(string $property): bool 'content' => 'content', 'content_url' => 'content_url', 'font_family' => 'font_family', - 'font_size' => 'font_size', + 'font_size' => 'font_size' ]; /** @@ -186,7 +196,7 @@ public function isNullableSetToNull(string $property): bool 'content' => 'setContent', 'content_url' => 'setContentUrl', 'font_family' => 'setFontFamily', - 'font_size' => 'setFontSize', + 'font_size' => 'setFontSize' ]; /** @@ -199,7 +209,7 @@ public function isNullableSetToNull(string $property): bool 'content' => 'getContent', 'content_url' => 'getContentUrl', 'font_family' => 'getFontFamily', - 'font_size' => 'getFontSize', + 'font_size' => 'getFontSize' ]; /** @@ -287,13 +297,14 @@ public function getFontFamilyAllowableValues() ]; } + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -304,33 +315,34 @@ public function __construct(array $data = null) $this->setIfExists('font_size', $data ?? [], 12); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubFormFieldsPerDocumentHyperlink { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubFormFieldsPerDocumentHyperlink { /** @var SubFormFieldsPerDocumentHyperlink */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentHyperlink::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -381,6 +393,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -398,10 +411,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -421,14 +434,14 @@ public function getContent() /** * Sets content * - * @param string $content link Text + * @param string $content Link Text. * * @return self */ - public function setContent(string $content) + public function setContent($content) { if (is_null($content)) { - throw new InvalidArgumentException('non-nullable content cannot be null'); + throw new \InvalidArgumentException('non-nullable content cannot be null'); } $this->container['content'] = $content; @@ -448,14 +461,14 @@ public function getContentUrl() /** * Sets content_url * - * @param string $content_url link URL + * @param string $content_url Link URL. * * @return self */ - public function setContentUrl(string $content_url) + public function setContentUrl($content_url) { if (is_null($content_url)) { - throw new InvalidArgumentException('non-nullable content_url cannot be null'); + throw new \InvalidArgumentException('non-nullable content_url cannot be null'); } $this->container['content_url'] = $content_url; @@ -475,18 +488,18 @@ public function getFontFamily() /** * Sets font_family * - * @param string|null $font_family font family for the field + * @param string|null $font_family Font family for the field. * * @return self */ - public function setFontFamily(?string $font_family) + public function setFontFamily($font_family) { if (is_null($font_family)) { - throw new InvalidArgumentException('non-nullable font_family cannot be null'); + throw new \InvalidArgumentException('non-nullable font_family cannot be null'); } $allowedValues = $this->getFontFamilyAllowableValues(); if (!in_array($font_family, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'font_family', must be one of '%s'", $font_family, @@ -516,22 +529,23 @@ public function getFontSize() * * @return self */ - public function setFontSize(?int $font_size) + public function setFontSize($font_size) { if (is_null($font_size)) { - throw new InvalidArgumentException('non-nullable font_size cannot be null'); + throw new \InvalidArgumentException('non-nullable font_size cannot be null'); } $this->container['font_size'] = $font_size; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -540,11 +554,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -555,8 +569,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -569,9 +585,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -579,12 +597,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -613,3 +631,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentInitials.php b/sdks/php/src/Model/SubFormFieldsPerDocumentInitials.php index cfddb0495..a0a8448bf 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentInitials.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentInitials.php @@ -1,11 +1,14 @@ */ class SubFormFieldsPerDocumentInitials extends SubFormFieldsPerDocumentBase @@ -44,46 +46,46 @@ class SubFormFieldsPerDocumentInitials extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentInitials'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string', + 'type' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null, + 'type' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'type' => false, + 'type' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -108,6 +110,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -117,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -127,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -136,6 +140,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -144,6 +151,9 @@ 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 { @@ -157,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', + 'type' => 'type' ]; /** @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', + 'type' => 'setType' ]; /** @@ -175,7 +185,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', + 'type' => 'getType' ]; /** @@ -219,46 +229,49 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); $this->setIfExists('type', $data ?? [], 'initials'); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubFormFieldsPerDocumentInitials { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubFormFieldsPerDocumentInitials { /** @var SubFormFieldsPerDocumentInitials */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentInitials::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,6 +307,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -311,22 +325,23 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -335,11 +350,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -350,8 +365,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -364,9 +381,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -374,12 +393,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -408,3 +427,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentRadio.php b/sdks/php/src/Model/SubFormFieldsPerDocumentRadio.php index b506baa56..52ee3070f 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentRadio.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentRadio.php @@ -1,11 +1,14 @@ */ class SubFormFieldsPerDocumentRadio extends SubFormFieldsPerDocumentBase @@ -44,52 +46,52 @@ class SubFormFieldsPerDocumentRadio extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentRadio'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'group' => 'string', - 'is_checked' => 'bool', + 'is_checked' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'group' => null, - 'is_checked' => null, + 'is_checked' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, 'group' => false, - 'is_checked' => false, + 'is_checked' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,6 +116,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -123,7 +127,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -133,7 +137,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -142,6 +146,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -150,6 +157,9 @@ 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 { @@ -165,7 +175,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'group' => 'group', - 'is_checked' => 'is_checked', + 'is_checked' => 'is_checked' ]; /** @@ -176,7 +186,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'group' => 'setGroup', - 'is_checked' => 'setIsChecked', + 'is_checked' => 'setIsChecked' ]; /** @@ -187,7 +197,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'group' => 'getGroup', - 'is_checked' => 'getIsChecked', + 'is_checked' => 'getIsChecked' ]; /** @@ -231,13 +241,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -246,33 +258,34 @@ public function __construct(array $data = null) $this->setIfExists('is_checked', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubFormFieldsPerDocumentRadio { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubFormFieldsPerDocumentRadio { /** @var SubFormFieldsPerDocumentRadio */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentRadio::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -314,6 +327,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -331,10 +345,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -354,14 +368,14 @@ public function getGroup() /** * Sets group * - * @param string $group string referencing group defined in `form_field_groups` parameter + * @param string $group String referencing group defined in `form_field_groups` parameter. * * @return self */ - public function setGroup(string $group) + public function setGroup($group) { if (is_null($group)) { - throw new InvalidArgumentException('non-nullable group cannot be null'); + throw new \InvalidArgumentException('non-nullable group cannot be null'); } $this->container['group'] = $group; @@ -385,22 +399,23 @@ public function getIsChecked() * * @return self */ - public function setIsChecked(bool $is_checked) + public function setIsChecked($is_checked) { if (is_null($is_checked)) { - throw new InvalidArgumentException('non-nullable is_checked cannot be null'); + throw new \InvalidArgumentException('non-nullable is_checked cannot be null'); } $this->container['is_checked'] = $is_checked; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -409,11 +424,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -424,8 +439,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -438,9 +455,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -448,12 +467,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -482,3 +501,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentSignature.php b/sdks/php/src/Model/SubFormFieldsPerDocumentSignature.php index 37c6e7a15..8e88f3de8 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentSignature.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentSignature.php @@ -1,11 +1,14 @@ */ class SubFormFieldsPerDocumentSignature extends SubFormFieldsPerDocumentBase @@ -44,46 +46,46 @@ class SubFormFieldsPerDocumentSignature extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentSignature'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string', + 'type' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null, + 'type' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'type' => false, + 'type' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -108,6 +110,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -117,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -127,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -136,6 +140,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -144,6 +151,9 @@ 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 { @@ -157,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', + 'type' => 'type' ]; /** @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', + 'type' => 'setType' ]; /** @@ -175,7 +185,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', + 'type' => 'getType' ]; /** @@ -219,46 +229,49 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); $this->setIfExists('type', $data ?? [], 'signature'); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubFormFieldsPerDocumentSignature { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubFormFieldsPerDocumentSignature { /** @var SubFormFieldsPerDocumentSignature */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentSignature::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,6 +307,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -311,22 +325,23 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -335,11 +350,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -350,8 +365,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -364,9 +381,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -374,12 +393,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -408,3 +427,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentText.php b/sdks/php/src/Model/SubFormFieldsPerDocumentText.php index fa048a12b..8ea9623e6 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentText.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentText.php @@ -1,11 +1,14 @@ */ class SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase @@ -44,17 +46,17 @@ class SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentText'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'placeholder' => 'string', @@ -66,16 +68,16 @@ class SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase 'validation_custom_regex_format_label' => 'string', 'content' => 'string', 'font_family' => 'string', - 'font_size' => 'int', + 'font_size' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'placeholder' => null, @@ -87,14 +89,14 @@ class SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase 'validation_custom_regex_format_label' => null, 'content' => null, 'font_family' => null, - 'font_size' => null, + 'font_size' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, 'placeholder' => false, @@ -106,14 +108,14 @@ class SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase 'validation_custom_regex_format_label' => false, 'content' => false, 'font_family' => false, - 'font_size' => false, + 'font_size' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -138,6 +140,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -147,7 +151,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -157,7 +161,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -166,6 +170,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -174,6 +181,9 @@ 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 { @@ -197,7 +207,7 @@ public function isNullableSetToNull(string $property): bool 'validation_custom_regex_format_label' => 'validation_custom_regex_format_label', 'content' => 'content', 'font_family' => 'font_family', - 'font_size' => 'font_size', + 'font_size' => 'font_size' ]; /** @@ -216,7 +226,7 @@ public function isNullableSetToNull(string $property): bool 'validation_custom_regex_format_label' => 'setValidationCustomRegexFormatLabel', 'content' => 'setContent', 'font_family' => 'setFontFamily', - 'font_size' => 'setFontSize', + 'font_size' => 'setFontSize' ]; /** @@ -235,7 +245,7 @@ public function isNullableSetToNull(string $property): bool 'validation_custom_regex_format_label' => 'getValidationCustomRegexFormatLabel', 'content' => 'getContent', 'font_family' => 'getFontFamily', - 'font_size' => 'getFontSize', + 'font_size' => 'getFontSize' ]; /** @@ -354,13 +364,14 @@ public function getFontFamilyAllowableValues() ]; } + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -377,33 +388,34 @@ public function __construct(array $data = null) $this->setIfExists('font_size', $data ?? [], 12); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubFormFieldsPerDocumentText { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubFormFieldsPerDocumentText { /** @var SubFormFieldsPerDocumentText */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentText::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -457,6 +469,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -474,10 +487,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -497,14 +510,14 @@ public function getPlaceholder() /** * Sets placeholder * - * @param string|null $placeholder placeholder value for text field + * @param string|null $placeholder Placeholder value for text field. * * @return self */ - public function setPlaceholder(?string $placeholder) + public function setPlaceholder($placeholder) { if (is_null($placeholder)) { - throw new InvalidArgumentException('non-nullable placeholder cannot be null'); + throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); } $this->container['placeholder'] = $placeholder; @@ -528,10 +541,10 @@ public function getAutoFillType() * * @return self */ - public function setAutoFillType(?string $auto_fill_type) + public function setAutoFillType($auto_fill_type) { if (is_null($auto_fill_type)) { - throw new InvalidArgumentException('non-nullable auto_fill_type cannot be null'); + throw new \InvalidArgumentException('non-nullable auto_fill_type cannot be null'); } $this->container['auto_fill_type'] = $auto_fill_type; @@ -555,10 +568,10 @@ public function getLinkId() * * @return self */ - public function setLinkId(?string $link_id) + public function setLinkId($link_id) { if (is_null($link_id)) { - throw new InvalidArgumentException('non-nullable link_id cannot be null'); + throw new \InvalidArgumentException('non-nullable link_id cannot be null'); } $this->container['link_id'] = $link_id; @@ -582,10 +595,10 @@ public function getMasked() * * @return self */ - public function setMasked(?bool $masked) + public function setMasked($masked) { if (is_null($masked)) { - throw new InvalidArgumentException('non-nullable masked cannot be null'); + throw new \InvalidArgumentException('non-nullable masked cannot be null'); } $this->container['masked'] = $masked; @@ -609,14 +622,14 @@ public function getValidationType() * * @return self */ - public function setValidationType(?string $validation_type) + public function setValidationType($validation_type) { if (is_null($validation_type)) { - throw new InvalidArgumentException('non-nullable validation_type cannot be null'); + throw new \InvalidArgumentException('non-nullable validation_type cannot be null'); } $allowedValues = $this->getValidationTypeAllowableValues(); if (!in_array($validation_type, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'validation_type', must be one of '%s'", $validation_type, @@ -646,10 +659,10 @@ public function getValidationCustomRegex() * * @return self */ - public function setValidationCustomRegex(?string $validation_custom_regex) + public function setValidationCustomRegex($validation_custom_regex) { if (is_null($validation_custom_regex)) { - throw new InvalidArgumentException('non-nullable validation_custom_regex cannot be null'); + throw new \InvalidArgumentException('non-nullable validation_custom_regex cannot be null'); } $this->container['validation_custom_regex'] = $validation_custom_regex; @@ -673,10 +686,10 @@ public function getValidationCustomRegexFormatLabel() * * @return self */ - public function setValidationCustomRegexFormatLabel(?string $validation_custom_regex_format_label) + public function setValidationCustomRegexFormatLabel($validation_custom_regex_format_label) { if (is_null($validation_custom_regex_format_label)) { - throw new InvalidArgumentException('non-nullable validation_custom_regex_format_label cannot be null'); + throw new \InvalidArgumentException('non-nullable validation_custom_regex_format_label cannot be null'); } $this->container['validation_custom_regex_format_label'] = $validation_custom_regex_format_label; @@ -700,10 +713,10 @@ public function getContent() * * @return self */ - public function setContent(?string $content) + public function setContent($content) { if (is_null($content)) { - throw new InvalidArgumentException('non-nullable content cannot be null'); + throw new \InvalidArgumentException('non-nullable content cannot be null'); } $this->container['content'] = $content; @@ -723,18 +736,18 @@ public function getFontFamily() /** * Sets font_family * - * @param string|null $font_family font family for the field + * @param string|null $font_family Font family for the field. * * @return self */ - public function setFontFamily(?string $font_family) + public function setFontFamily($font_family) { if (is_null($font_family)) { - throw new InvalidArgumentException('non-nullable font_family cannot be null'); + throw new \InvalidArgumentException('non-nullable font_family cannot be null'); } $allowedValues = $this->getFontFamilyAllowableValues(); if (!in_array($font_family, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'font_family', must be one of '%s'", $font_family, @@ -764,22 +777,23 @@ public function getFontSize() * * @return self */ - public function setFontSize(?int $font_size) + public function setFontSize($font_size) { if (is_null($font_size)) { - throw new InvalidArgumentException('non-nullable font_size cannot be null'); + throw new \InvalidArgumentException('non-nullable font_size cannot be null'); } $this->container['font_size'] = $font_size; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -788,11 +802,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -803,8 +817,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -817,9 +833,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -827,12 +845,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -861,3 +879,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentTextMerge.php b/sdks/php/src/Model/SubFormFieldsPerDocumentTextMerge.php index bfe22420e..36f5596fc 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentTextMerge.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentTextMerge.php @@ -1,11 +1,14 @@ */ class SubFormFieldsPerDocumentTextMerge extends SubFormFieldsPerDocumentBase @@ -44,52 +46,52 @@ class SubFormFieldsPerDocumentTextMerge extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentTextMerge'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'font_family' => 'string', - 'font_size' => 'int', + 'font_size' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'font_family' => null, - 'font_size' => null, + 'font_size' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, 'font_family' => false, - 'font_size' => false, + 'font_size' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,6 +116,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -123,7 +127,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -133,7 +137,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -142,6 +146,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -150,6 +157,9 @@ 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 { @@ -165,7 +175,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'font_family' => 'font_family', - 'font_size' => 'font_size', + 'font_size' => 'font_size' ]; /** @@ -176,7 +186,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'font_family' => 'setFontFamily', - 'font_size' => 'setFontSize', + 'font_size' => 'setFontSize' ]; /** @@ -187,7 +197,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'font_family' => 'getFontFamily', - 'font_size' => 'getFontSize', + 'font_size' => 'getFontSize' ]; /** @@ -275,13 +285,14 @@ public function getFontFamilyAllowableValues() ]; } + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -290,33 +301,34 @@ public function __construct(array $data = null) $this->setIfExists('font_size', $data ?? [], 12); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubFormFieldsPerDocumentTextMerge { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubFormFieldsPerDocumentTextMerge { /** @var SubFormFieldsPerDocumentTextMerge */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentTextMerge::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -361,6 +373,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -378,10 +391,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -401,18 +414,18 @@ public function getFontFamily() /** * Sets font_family * - * @param string|null $font_family font family for the field + * @param string|null $font_family Font family for the field. * * @return self */ - public function setFontFamily(?string $font_family) + public function setFontFamily($font_family) { if (is_null($font_family)) { - throw new InvalidArgumentException('non-nullable font_family cannot be null'); + throw new \InvalidArgumentException('non-nullable font_family cannot be null'); } $allowedValues = $this->getFontFamilyAllowableValues(); if (!in_array($font_family, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'font_family', must be one of '%s'", $font_family, @@ -442,22 +455,23 @@ public function getFontSize() * * @return self */ - public function setFontSize(?int $font_size) + public function setFontSize($font_size) { if (is_null($font_size)) { - throw new InvalidArgumentException('non-nullable font_size cannot be null'); + throw new \InvalidArgumentException('non-nullable font_size cannot be null'); } $this->container['font_size'] = $font_size; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -466,11 +480,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -481,8 +495,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -495,9 +511,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -505,12 +523,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -539,3 +557,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentTypeEnum.php b/sdks/php/src/Model/SubFormFieldsPerDocumentTypeEnum.php index 4a4294f5e..fd4acd18b 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentTypeEnum.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentTypeEnum.php @@ -1,11 +1,14 @@ */ -class SubMergeField implements ModelInterface, ArrayAccess, JsonSerializable +class SubMergeField implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubMergeField'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', - 'type' => 'string', + 'type' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, - 'type' => null, + 'type' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'name' => false, - 'type' => false, + 'type' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'name' => 'name', - 'type' => 'type', + 'type' => 'type' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'name' => 'setName', - 'type' => 'setType', + 'type' => 'setType' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'name' => 'getName', - 'type' => 'getType', + 'type' => 'getType' ]; /** @@ -252,42 +262,43 @@ public function getTypeAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubMergeField { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubMergeField { /** @var SubMergeField */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubMergeField::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -335,6 +346,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets name * @@ -352,10 +364,10 @@ public function getName() * * @return self */ - public function setName(string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -375,18 +387,18 @@ public function getType() /** * Sets type * - * @param string $type the type of merge field + * @param string $type The type of merge field. * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'type', must be one of '%s'", $type, @@ -398,13 +410,14 @@ public function setType(string $type) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -413,11 +426,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -428,8 +441,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -442,9 +457,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -452,12 +469,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -486,3 +503,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubOAuth.php b/sdks/php/src/Model/SubOAuth.php index 2bbf85547..501ab9d64 100644 --- a/sdks/php/src/Model/SubOAuth.php +++ b/sdks/php/src/Model/SubOAuth.php @@ -1,11 +1,14 @@ */ -class SubOAuth implements ModelInterface, ArrayAccess, JsonSerializable +class SubOAuth implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubOAuth'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'callback_url' => 'string', - 'scopes' => 'string[]', + 'scopes' => 'string[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'callback_url' => null, - 'scopes' => null, + 'scopes' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'callback_url' => false, - 'scopes' => false, + 'scopes' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,6 +115,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -122,7 +126,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +136,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,6 +145,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -149,6 +156,9 @@ 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 { @@ -163,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'callback_url' => 'callback_url', - 'scopes' => 'scopes', + 'scopes' => 'scopes' ]; /** @@ -173,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'callback_url' => 'setCallbackUrl', - 'scopes' => 'setScopes', + 'scopes' => 'setScopes' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'callback_url' => 'getCallbackUrl', - 'scopes' => 'getScopes', + 'scopes' => 'getScopes' ]; /** @@ -265,42 +275,43 @@ public function getScopesAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('callback_url', $data ?? [], null); $this->setIfExists('scopes', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubOAuth { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubOAuth { /** @var SubOAuth */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubOAuth::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -317,7 +328,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -331,6 +344,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets callback_url * @@ -348,10 +362,10 @@ public function getCallbackUrl() * * @return self */ - public function setCallbackUrl(?string $callback_url) + public function setCallbackUrl($callback_url) { if (is_null($callback_url)) { - throw new InvalidArgumentException('non-nullable callback_url cannot be null'); + throw new \InvalidArgumentException('non-nullable callback_url cannot be null'); } $this->container['callback_url'] = $callback_url; @@ -375,14 +389,14 @@ public function getScopes() * * @return self */ - public function setScopes(?array $scopes) + public function setScopes($scopes) { if (is_null($scopes)) { - throw new InvalidArgumentException('non-nullable scopes cannot be null'); + throw new \InvalidArgumentException('non-nullable scopes cannot be null'); } $allowedValues = $this->getScopesAllowableValues(); if (array_diff($scopes, $allowedValues)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value for 'scopes', must be one of '%s'", implode("', '", $allowedValues) @@ -393,13 +407,14 @@ public function setScopes(?array $scopes) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -408,11 +423,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -423,8 +438,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -437,9 +454,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -447,12 +466,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -481,3 +500,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubOptions.php b/sdks/php/src/Model/SubOptions.php index b86fa5b7f..5609a909c 100644 --- a/sdks/php/src/Model/SubOptions.php +++ b/sdks/php/src/Model/SubOptions.php @@ -1,11 +1,14 @@ */ -class SubOptions implements ModelInterface, ArrayAccess, JsonSerializable +class SubOptions implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubOptions'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'can_insert_everywhere' => 'bool', + 'can_insert_everywhere' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'can_insert_everywhere' => null, + 'can_insert_everywhere' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'can_insert_everywhere' => false, + 'can_insert_everywhere' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,6 +112,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -119,7 +123,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -129,7 +133,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -138,6 +142,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -146,6 +153,9 @@ 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 { @@ -159,7 +169,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'can_insert_everywhere' => 'can_insert_everywhere', + 'can_insert_everywhere' => 'can_insert_everywhere' ]; /** @@ -168,7 +178,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'can_insert_everywhere' => 'setCanInsertEverywhere', + 'can_insert_everywhere' => 'setCanInsertEverywhere' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'can_insert_everywhere' => 'getCanInsertEverywhere', + 'can_insert_everywhere' => 'getCanInsertEverywhere' ]; /** @@ -221,6 +231,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -231,41 +242,42 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('can_insert_everywhere', $data ?? [], false); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubOptions { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubOptions { /** @var SubOptions */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubOptions::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -282,7 +294,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -296,6 +310,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets can_insert_everywhere * @@ -309,26 +324,27 @@ public function getCanInsertEverywhere() /** * Sets can_insert_everywhere * - * @param bool|null $can_insert_everywhere determines if signers can use \"Insert Everywhere\" when signing a document + * @param bool|null $can_insert_everywhere Determines if signers can use \"Insert Everywhere\" when signing a document. * * @return self */ - public function setCanInsertEverywhere(?bool $can_insert_everywhere) + public function setCanInsertEverywhere($can_insert_everywhere) { if (is_null($can_insert_everywhere)) { - throw new InvalidArgumentException('non-nullable can_insert_everywhere cannot be null'); + throw new \InvalidArgumentException('non-nullable can_insert_everywhere cannot be null'); } $this->container['can_insert_everywhere'] = $can_insert_everywhere; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -337,11 +353,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -352,8 +368,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -366,9 +384,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -376,12 +396,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -410,3 +430,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubSignatureRequestGroupedSigners.php b/sdks/php/src/Model/SubSignatureRequestGroupedSigners.php index 2d15bc241..f9a095986 100644 --- a/sdks/php/src/Model/SubSignatureRequestGroupedSigners.php +++ b/sdks/php/src/Model/SubSignatureRequestGroupedSigners.php @@ -1,11 +1,14 @@ */ -class SubSignatureRequestGroupedSigners implements ModelInterface, ArrayAccess, JsonSerializable +class SubSignatureRequestGroupedSigners implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubSignatureRequestGroupedSigners'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'group' => 'string', 'signers' => '\Dropbox\Sign\Model\SubSignatureRequestSigner[]', - 'order' => 'int', + 'order' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'group' => null, 'signers' => null, - 'order' => null, + 'order' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'group' => false, 'signers' => false, - 'order' => true, + 'order' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'group' => 'group', 'signers' => 'signers', - 'order' => 'order', + 'order' => 'order' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'group' => 'setGroup', 'signers' => 'setSigners', - 'order' => 'setOrder', + 'order' => 'setOrder' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'group' => 'getGroup', 'signers' => 'getSigners', - 'order' => 'getOrder', + 'order' => 'getOrder' ]; /** @@ -232,6 +242,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -242,43 +253,44 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('group', $data ?? [], null); $this->setIfExists('signers', $data ?? [], null); $this->setIfExists('order', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubSignatureRequestGroupedSigners { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubSignatureRequestGroupedSigners { /** @var SubSignatureRequestGroupedSigners */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubSignatureRequestGroupedSigners::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -317,6 +329,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets group * @@ -330,14 +343,14 @@ public function getGroup() /** * Sets group * - * @param string $group the name of the group + * @param string $group The name of the group. * * @return self */ - public function setGroup(string $group) + public function setGroup($group) { if (is_null($group)) { - throw new InvalidArgumentException('non-nullable group cannot be null'); + throw new \InvalidArgumentException('non-nullable group cannot be null'); } $this->container['group'] = $group; @@ -361,10 +374,10 @@ public function getSigners() * * @return self */ - public function setSigners(array $signers) + public function setSigners($signers) { if (is_null($signers)) { - throw new InvalidArgumentException('non-nullable signers cannot be null'); + throw new \InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -388,13 +401,13 @@ public function getOrder() * * @return self */ - public function setOrder(?int $order) + public function setOrder($order) { if (is_null($order)) { array_push($this->openAPINullablesSetToNull, 'order'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('order', $nullablesSetToNull); + $index = array_search('order', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -404,13 +417,14 @@ public function setOrder(?int $order) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -419,11 +433,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -434,8 +448,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -448,9 +464,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -458,12 +476,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -492,3 +510,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubSignatureRequestSigner.php b/sdks/php/src/Model/SubSignatureRequestSigner.php index 64133e165..985b88d91 100644 --- a/sdks/php/src/Model/SubSignatureRequestSigner.php +++ b/sdks/php/src/Model/SubSignatureRequestSigner.php @@ -1,11 +1,14 @@ */ -class SubSignatureRequestSigner implements ModelInterface, ArrayAccess, JsonSerializable +class SubSignatureRequestSigner implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubSignatureRequestSigner'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', 'email_address' => 'string', 'order' => 'int', 'pin' => 'string', 'sms_phone_number' => 'string', - 'sms_phone_number_type' => 'string', + 'sms_phone_number_type' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, 'email_address' => 'email', 'order' => null, 'pin' => null, 'sms_phone_number' => null, - 'sms_phone_number_type' => null, + 'sms_phone_number_type' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'name' => false, 'email_address' => false, 'order' => true, 'pin' => false, 'sms_phone_number' => false, - 'sms_phone_number_type' => false, + 'sms_phone_number_type' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -124,6 +126,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -133,7 +137,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -143,7 +147,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -152,6 +156,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -160,6 +167,9 @@ 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 { @@ -178,7 +188,7 @@ public function isNullableSetToNull(string $property): bool 'order' => 'order', 'pin' => 'pin', 'sms_phone_number' => 'sms_phone_number', - 'sms_phone_number_type' => 'sms_phone_number_type', + 'sms_phone_number_type' => 'sms_phone_number_type' ]; /** @@ -192,7 +202,7 @@ public function isNullableSetToNull(string $property): bool 'order' => 'setOrder', 'pin' => 'setPin', 'sms_phone_number' => 'setSmsPhoneNumber', - 'sms_phone_number_type' => 'setSmsPhoneNumberType', + 'sms_phone_number_type' => 'setSmsPhoneNumberType' ]; /** @@ -206,7 +216,7 @@ public function isNullableSetToNull(string $property): bool 'order' => 'getOrder', 'pin' => 'getPin', 'sms_phone_number' => 'getSmsPhoneNumber', - 'sms_phone_number_type' => 'getSmsPhoneNumberType', + 'sms_phone_number_type' => 'getSmsPhoneNumberType' ]; /** @@ -276,10 +286,10 @@ public function getSmsPhoneNumberTypeAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('email_address', $data ?? [], null); @@ -289,33 +299,34 @@ public function __construct(array $data = null) $this->setIfExists('sms_phone_number_type', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubSignatureRequestSigner { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubSignatureRequestSigner { /** @var SubSignatureRequestSigner */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubSignatureRequestSigner::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -371,6 +382,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets name * @@ -384,14 +396,14 @@ public function getName() /** * Sets name * - * @param string $name the name of the signer + * @param string $name The name of the signer. * * @return self */ - public function setName(string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -411,14 +423,14 @@ public function getEmailAddress() /** * Sets email_address * - * @param string $email_address the email address of the signer + * @param string $email_address The email address of the signer. * * @return self */ - public function setEmailAddress(string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -438,17 +450,17 @@ public function getOrder() /** * Sets order * - * @param int|null $order the order the signer is required to sign in + * @param int|null $order The order the signer is required to sign in. * * @return self */ - public function setOrder(?int $order) + public function setOrder($order) { if (is_null($order)) { array_push($this->openAPINullablesSetToNull, 'order'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('order', $nullablesSetToNull); + $index = array_search('order', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -472,20 +484,20 @@ public function getPin() /** * Sets pin * - * @param string|null $pin the 4- to 12-character access code that will secure this signer's signature page + * @param string|null $pin The 4- to 12-character access code that will secure this signer's signature page. * * @return self */ - public function setPin(?string $pin) + public function setPin($pin) { if (is_null($pin)) { - throw new InvalidArgumentException('non-nullable pin cannot be null'); + throw new \InvalidArgumentException('non-nullable pin cannot be null'); } - if (mb_strlen($pin) > 12) { - throw new InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestSigner., must be smaller than or equal to 12.'); + if ((mb_strlen($pin) > 12)) { + throw new \InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestSigner., must be smaller than or equal to 12.'); } - if (mb_strlen($pin) < 4) { - throw new InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestSigner., must be bigger than or equal to 4.'); + if ((mb_strlen($pin) < 4)) { + throw new \InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestSigner., must be bigger than or equal to 4.'); } $this->container['pin'] = $pin; @@ -510,10 +522,10 @@ public function getSmsPhoneNumber() * * @return self */ - public function setSmsPhoneNumber(?string $sms_phone_number) + public function setSmsPhoneNumber($sms_phone_number) { if (is_null($sms_phone_number)) { - throw new InvalidArgumentException('non-nullable sms_phone_number cannot be null'); + throw new \InvalidArgumentException('non-nullable sms_phone_number cannot be null'); } $this->container['sms_phone_number'] = $sms_phone_number; @@ -537,14 +549,14 @@ public function getSmsPhoneNumberType() * * @return self */ - public function setSmsPhoneNumberType(?string $sms_phone_number_type) + public function setSmsPhoneNumberType($sms_phone_number_type) { if (is_null($sms_phone_number_type)) { - throw new InvalidArgumentException('non-nullable sms_phone_number_type cannot be null'); + throw new \InvalidArgumentException('non-nullable sms_phone_number_type cannot be null'); } $allowedValues = $this->getSmsPhoneNumberTypeAllowableValues(); if (!in_array($sms_phone_number_type, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'sms_phone_number_type', must be one of '%s'", $sms_phone_number_type, @@ -556,13 +568,14 @@ public function setSmsPhoneNumberType(?string $sms_phone_number_type) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -571,11 +584,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -586,8 +599,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -600,9 +615,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -610,12 +627,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -644,3 +661,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubSignatureRequestTemplateSigner.php b/sdks/php/src/Model/SubSignatureRequestTemplateSigner.php index 15070e31f..e97b478b1 100644 --- a/sdks/php/src/Model/SubSignatureRequestTemplateSigner.php +++ b/sdks/php/src/Model/SubSignatureRequestTemplateSigner.php @@ -1,11 +1,14 @@ */ -class SubSignatureRequestTemplateSigner implements ModelInterface, ArrayAccess, JsonSerializable +class SubSignatureRequestTemplateSigner implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubSignatureRequestTemplateSigner'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'role' => 'string', 'name' => 'string', 'email_address' => 'string', 'pin' => 'string', 'sms_phone_number' => 'string', - 'sms_phone_number_type' => 'string', + 'sms_phone_number_type' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'role' => null, 'name' => null, 'email_address' => 'email', 'pin' => null, 'sms_phone_number' => null, - 'sms_phone_number_type' => null, + 'sms_phone_number_type' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'role' => false, 'name' => false, 'email_address' => false, 'pin' => false, 'sms_phone_number' => false, - 'sms_phone_number_type' => false, + 'sms_phone_number_type' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -124,6 +126,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -133,7 +137,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -143,7 +147,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -152,6 +156,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -160,6 +167,9 @@ 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 { @@ -178,7 +188,7 @@ public function isNullableSetToNull(string $property): bool 'email_address' => 'email_address', 'pin' => 'pin', 'sms_phone_number' => 'sms_phone_number', - 'sms_phone_number_type' => 'sms_phone_number_type', + 'sms_phone_number_type' => 'sms_phone_number_type' ]; /** @@ -192,7 +202,7 @@ public function isNullableSetToNull(string $property): bool 'email_address' => 'setEmailAddress', 'pin' => 'setPin', 'sms_phone_number' => 'setSmsPhoneNumber', - 'sms_phone_number_type' => 'setSmsPhoneNumberType', + 'sms_phone_number_type' => 'setSmsPhoneNumberType' ]; /** @@ -206,7 +216,7 @@ public function isNullableSetToNull(string $property): bool 'email_address' => 'getEmailAddress', 'pin' => 'getPin', 'sms_phone_number' => 'getSmsPhoneNumber', - 'sms_phone_number_type' => 'getSmsPhoneNumberType', + 'sms_phone_number_type' => 'getSmsPhoneNumberType' ]; /** @@ -276,10 +286,10 @@ public function getSmsPhoneNumberTypeAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('role', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -289,33 +299,34 @@ public function __construct(array $data = null) $this->setIfExists('sms_phone_number_type', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubSignatureRequestTemplateSigner { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubSignatureRequestTemplateSigner { /** @var SubSignatureRequestTemplateSigner */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubSignatureRequestTemplateSigner::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -374,6 +385,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets role * @@ -391,10 +403,10 @@ public function getRole() * * @return self */ - public function setRole(string $role) + public function setRole($role) { if (is_null($role)) { - throw new InvalidArgumentException('non-nullable role cannot be null'); + throw new \InvalidArgumentException('non-nullable role cannot be null'); } $this->container['role'] = $role; @@ -414,14 +426,14 @@ public function getName() /** * Sets name * - * @param string $name the name of the signer + * @param string $name The name of the signer. * * @return self */ - public function setName(string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -441,14 +453,14 @@ public function getEmailAddress() /** * Sets email_address * - * @param string $email_address the email address of the signer + * @param string $email_address The email address of the signer. * * @return self */ - public function setEmailAddress(string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -468,20 +480,20 @@ public function getPin() /** * Sets pin * - * @param string|null $pin the 4- to 12-character access code that will secure this signer's signature page + * @param string|null $pin The 4- to 12-character access code that will secure this signer's signature page. * * @return self */ - public function setPin(?string $pin) + public function setPin($pin) { if (is_null($pin)) { - throw new InvalidArgumentException('non-nullable pin cannot be null'); + throw new \InvalidArgumentException('non-nullable pin cannot be null'); } - if (mb_strlen($pin) > 12) { - throw new InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestTemplateSigner., must be smaller than or equal to 12.'); + if ((mb_strlen($pin) > 12)) { + throw new \InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestTemplateSigner., must be smaller than or equal to 12.'); } - if (mb_strlen($pin) < 4) { - throw new InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestTemplateSigner., must be bigger than or equal to 4.'); + if ((mb_strlen($pin) < 4)) { + throw new \InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestTemplateSigner., must be bigger than or equal to 4.'); } $this->container['pin'] = $pin; @@ -506,10 +518,10 @@ public function getSmsPhoneNumber() * * @return self */ - public function setSmsPhoneNumber(?string $sms_phone_number) + public function setSmsPhoneNumber($sms_phone_number) { if (is_null($sms_phone_number)) { - throw new InvalidArgumentException('non-nullable sms_phone_number cannot be null'); + throw new \InvalidArgumentException('non-nullable sms_phone_number cannot be null'); } $this->container['sms_phone_number'] = $sms_phone_number; @@ -533,14 +545,14 @@ public function getSmsPhoneNumberType() * * @return self */ - public function setSmsPhoneNumberType(?string $sms_phone_number_type) + public function setSmsPhoneNumberType($sms_phone_number_type) { if (is_null($sms_phone_number_type)) { - throw new InvalidArgumentException('non-nullable sms_phone_number_type cannot be null'); + throw new \InvalidArgumentException('non-nullable sms_phone_number_type cannot be null'); } $allowedValues = $this->getSmsPhoneNumberTypeAllowableValues(); if (!in_array($sms_phone_number_type, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'sms_phone_number_type', must be one of '%s'", $sms_phone_number_type, @@ -552,13 +564,14 @@ public function setSmsPhoneNumberType(?string $sms_phone_number_type) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -567,11 +580,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -582,8 +595,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -596,9 +611,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -606,12 +623,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -640,3 +657,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubSigningOptions.php b/sdks/php/src/Model/SubSigningOptions.php index 8cbaff0f0..9eeba9e34 100644 --- a/sdks/php/src/Model/SubSigningOptions.php +++ b/sdks/php/src/Model/SubSigningOptions.php @@ -1,11 +1,14 @@ */ -class SubSigningOptions implements ModelInterface, ArrayAccess, JsonSerializable +class SubSigningOptions implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubSigningOptions'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'default_type' => 'string', 'draw' => 'bool', 'phone' => 'bool', 'type' => 'bool', - 'upload' => 'bool', + 'upload' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'default_type' => null, 'draw' => null, 'phone' => null, 'type' => null, - 'upload' => null, + 'upload' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'default_type' => false, 'draw' => false, 'phone' => false, 'type' => false, - 'upload' => false, + 'upload' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -122,6 +124,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -131,7 +135,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -141,7 +145,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -150,6 +154,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -158,6 +165,9 @@ 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 { @@ -175,7 +185,7 @@ public function isNullableSetToNull(string $property): bool 'draw' => 'draw', 'phone' => 'phone', 'type' => 'type', - 'upload' => 'upload', + 'upload' => 'upload' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool 'draw' => 'setDraw', 'phone' => 'setPhone', 'type' => 'setType', - 'upload' => 'setUpload', + 'upload' => 'setUpload' ]; /** @@ -201,7 +211,7 @@ public function isNullableSetToNull(string $property): bool 'draw' => 'getDraw', 'phone' => 'getPhone', 'type' => 'getType', - 'upload' => 'getUpload', + 'upload' => 'getUpload' ]; /** @@ -275,10 +285,10 @@ public function getDefaultTypeAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('default_type', $data ?? [], null); $this->setIfExists('draw', $data ?? [], false); @@ -287,33 +297,34 @@ public function __construct(array $data = null) $this->setIfExists('upload', $data ?? [], false); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubSigningOptions { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubSigningOptions { /** @var SubSigningOptions */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubSigningOptions::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -358,6 +369,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets default_type * @@ -375,14 +387,14 @@ public function getDefaultType() * * @return self */ - public function setDefaultType(string $default_type) + public function setDefaultType($default_type) { if (is_null($default_type)) { - throw new InvalidArgumentException('non-nullable default_type cannot be null'); + throw new \InvalidArgumentException('non-nullable default_type cannot be null'); } $allowedValues = $this->getDefaultTypeAllowableValues(); if (!in_array($default_type, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'default_type', must be one of '%s'", $default_type, @@ -412,10 +424,10 @@ public function getDraw() * * @return self */ - public function setDraw(?bool $draw) + public function setDraw($draw) { if (is_null($draw)) { - throw new InvalidArgumentException('non-nullable draw cannot be null'); + throw new \InvalidArgumentException('non-nullable draw cannot be null'); } $this->container['draw'] = $draw; @@ -439,10 +451,10 @@ public function getPhone() * * @return self */ - public function setPhone(?bool $phone) + public function setPhone($phone) { if (is_null($phone)) { - throw new InvalidArgumentException('non-nullable phone cannot be null'); + throw new \InvalidArgumentException('non-nullable phone cannot be null'); } $this->container['phone'] = $phone; @@ -466,10 +478,10 @@ public function getType() * * @return self */ - public function setType(?bool $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -493,22 +505,23 @@ public function getUpload() * * @return self */ - public function setUpload(?bool $upload) + public function setUpload($upload) { if (is_null($upload)) { - throw new InvalidArgumentException('non-nullable upload cannot be null'); + throw new \InvalidArgumentException('non-nullable upload cannot be null'); } $this->container['upload'] = $upload; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -517,11 +530,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -532,8 +545,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -546,9 +561,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -556,12 +573,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -590,3 +607,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubTeamResponse.php b/sdks/php/src/Model/SubTeamResponse.php index 60ecc442a..2e1497011 100644 --- a/sdks/php/src/Model/SubTeamResponse.php +++ b/sdks/php/src/Model/SubTeamResponse.php @@ -1,11 +1,14 @@ */ -class SubTeamResponse implements ModelInterface, ArrayAccess, JsonSerializable +class SubTeamResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubTeamResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'team_id' => 'string', - 'name' => 'string', + 'name' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'team_id' => null, - 'name' => null, + 'name' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'team_id' => false, - 'name' => false, + 'name' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'team_id' => 'team_id', - 'name' => 'name', + 'name' => 'name' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'team_id' => 'setTeamId', - 'name' => 'setName', + 'name' => 'setName' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'team_id' => 'getTeamId', - 'name' => 'getName', + 'name' => 'getName' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('team_id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubTeamResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubTeamResponse { /** @var SubTeamResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubTeamResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -288,7 +300,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -302,6 +316,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets team_id * @@ -319,10 +334,10 @@ public function getTeamId() * * @return self */ - public function setTeamId(?string $team_id) + public function setTeamId($team_id) { if (is_null($team_id)) { - throw new InvalidArgumentException('non-nullable team_id cannot be null'); + throw new \InvalidArgumentException('non-nullable team_id cannot be null'); } $this->container['team_id'] = $team_id; @@ -346,22 +361,23 @@ public function getName() * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -370,11 +386,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -385,8 +401,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -399,9 +417,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -409,12 +429,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -443,3 +463,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubTemplateRole.php b/sdks/php/src/Model/SubTemplateRole.php index 2678da93a..44e4cb4f7 100644 --- a/sdks/php/src/Model/SubTemplateRole.php +++ b/sdks/php/src/Model/SubTemplateRole.php @@ -1,11 +1,14 @@ */ -class SubTemplateRole implements ModelInterface, ArrayAccess, JsonSerializable +class SubTemplateRole implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubTemplateRole'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', - 'order' => 'int', + 'order' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, - 'order' => null, + 'order' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'name' => false, - 'order' => true, + 'order' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'name' => 'name', - 'order' => 'order', + 'order' => 'order' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'name' => 'setName', - 'order' => 'setOrder', + 'order' => 'setOrder' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'name' => 'getName', - 'order' => 'getOrder', + 'order' => 'getOrder' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('order', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubTemplateRole { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubTemplateRole { /** @var SubTemplateRole */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubTemplateRole::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -288,7 +300,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -302,6 +316,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets name * @@ -315,14 +330,14 @@ public function getName() /** * Sets name * - * @param string|null $name the role name of the signer that will be displayed when the template is used to create a signature request + * @param string|null $name The role name of the signer that will be displayed when the template is used to create a signature request. * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -342,17 +357,17 @@ public function getOrder() /** * Sets order * - * @param int|null $order the order in which this signer role is required to sign + * @param int|null $order The order in which this signer role is required to sign. * * @return self */ - public function setOrder(?int $order) + public function setOrder($order) { if (is_null($order)) { array_push($this->openAPINullablesSetToNull, 'order'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('order', $nullablesSetToNull); + $index = array_search('order', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -362,13 +377,14 @@ public function setOrder(?int $order) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -377,11 +393,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -392,8 +408,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -406,9 +424,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -416,12 +436,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -450,3 +470,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubUnclaimedDraftSigner.php b/sdks/php/src/Model/SubUnclaimedDraftSigner.php index acc466356..891554432 100644 --- a/sdks/php/src/Model/SubUnclaimedDraftSigner.php +++ b/sdks/php/src/Model/SubUnclaimedDraftSigner.php @@ -1,11 +1,14 @@ */ -class SubUnclaimedDraftSigner implements ModelInterface, ArrayAccess, JsonSerializable +class SubUnclaimedDraftSigner implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubUnclaimedDraftSigner'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'email_address' => 'string', 'name' => 'string', - 'order' => 'int', + 'order' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'email_address' => 'email', 'name' => null, - 'order' => null, + 'order' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'email_address' => false, 'name' => false, - 'order' => true, + 'order' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'email_address' => 'email_address', 'name' => 'name', - 'order' => 'order', + 'order' => 'order' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'email_address' => 'setEmailAddress', 'name' => 'setName', - 'order' => 'setOrder', + 'order' => 'setOrder' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'email_address' => 'getEmailAddress', 'name' => 'getName', - 'order' => 'getOrder', + 'order' => 'getOrder' ]; /** @@ -232,6 +242,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -242,43 +253,44 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('email_address', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); $this->setIfExists('order', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubUnclaimedDraftSigner { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubUnclaimedDraftSigner { /** @var SubUnclaimedDraftSigner */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubUnclaimedDraftSigner::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -317,6 +329,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets email_address * @@ -330,14 +343,14 @@ public function getEmailAddress() /** * Sets email_address * - * @param string $email_address the email address of the signer + * @param string $email_address The email address of the signer. * * @return self */ - public function setEmailAddress(string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -357,14 +370,14 @@ public function getName() /** * Sets name * - * @param string $name the name of the signer + * @param string $name The name of the signer. * * @return self */ - public function setName(string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -384,17 +397,17 @@ public function getOrder() /** * Sets order * - * @param int|null $order the order the signer is required to sign in + * @param int|null $order The order the signer is required to sign in. * * @return self */ - public function setOrder(?int $order) + public function setOrder($order) { if (is_null($order)) { array_push($this->openAPINullablesSetToNull, 'order'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('order', $nullablesSetToNull); + $index = array_search('order', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -404,13 +417,14 @@ public function setOrder(?int $order) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -419,11 +433,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -434,8 +448,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -448,9 +464,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -458,12 +476,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -492,3 +510,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubUnclaimedDraftTemplateSigner.php b/sdks/php/src/Model/SubUnclaimedDraftTemplateSigner.php index 9daffb1e4..094f43b3d 100644 --- a/sdks/php/src/Model/SubUnclaimedDraftTemplateSigner.php +++ b/sdks/php/src/Model/SubUnclaimedDraftTemplateSigner.php @@ -1,11 +1,14 @@ */ -class SubUnclaimedDraftTemplateSigner implements ModelInterface, ArrayAccess, JsonSerializable +class SubUnclaimedDraftTemplateSigner implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubUnclaimedDraftTemplateSigner'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'role' => 'string', 'name' => 'string', - 'email_address' => 'string', + 'email_address' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'role' => null, 'name' => null, - 'email_address' => 'email', + 'email_address' => 'email' ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'role' => false, 'name' => false, - 'email_address' => false, + 'email_address' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'role' => 'role', 'name' => 'name', - 'email_address' => 'email_address', + 'email_address' => 'email_address' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'role' => 'setRole', 'name' => 'setName', - 'email_address' => 'setEmailAddress', + 'email_address' => 'setEmailAddress' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'role' => 'getRole', 'name' => 'getName', - 'email_address' => 'getEmailAddress', + 'email_address' => 'getEmailAddress' ]; /** @@ -232,6 +242,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -242,43 +253,44 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('role', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); $this->setIfExists('email_address', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubUnclaimedDraftTemplateSigner { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubUnclaimedDraftTemplateSigner { /** @var SubUnclaimedDraftTemplateSigner */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubUnclaimedDraftTemplateSigner::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -320,6 +332,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets role * @@ -333,14 +346,14 @@ public function getRole() /** * Sets role * - * @param string $role must match an existing role in chosen Template(s) + * @param string $role Must match an existing role in chosen Template(s). * * @return self */ - public function setRole(string $role) + public function setRole($role) { if (is_null($role)) { - throw new InvalidArgumentException('non-nullable role cannot be null'); + throw new \InvalidArgumentException('non-nullable role cannot be null'); } $this->container['role'] = $role; @@ -360,14 +373,14 @@ public function getName() /** * Sets name * - * @param string $name the name of the signer filling the role of `role` + * @param string $name The name of the signer filling the role of `role`. * * @return self */ - public function setName(string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -387,26 +400,27 @@ public function getEmailAddress() /** * Sets email_address * - * @param string $email_address the email address of the signer filling the role of `role` + * @param string $email_address The email address of the signer filling the role of `role`. * * @return self */ - public function setEmailAddress(string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -415,11 +429,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -430,8 +444,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -444,9 +460,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -454,12 +472,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -488,3 +506,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/SubWhiteLabelingOptions.php b/sdks/php/src/Model/SubWhiteLabelingOptions.php index 0abcbd111..5f1d304a0 100644 --- a/sdks/php/src/Model/SubWhiteLabelingOptions.php +++ b/sdks/php/src/Model/SubWhiteLabelingOptions.php @@ -1,11 +1,14 @@ */ -class SubWhiteLabelingOptions implements ModelInterface, ArrayAccess, JsonSerializable +class SubWhiteLabelingOptions implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubWhiteLabelingOptions'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'header_background_color' => 'string', 'legal_version' => 'string', @@ -72,16 +74,16 @@ class SubWhiteLabelingOptions implements ModelInterface, ArrayAccess, JsonSerial 'secondary_button_text_color_hover' => 'string', 'text_color1' => 'string', 'text_color2' => 'string', - 'reset_to_default' => 'bool', + 'reset_to_default' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'header_background_color' => null, 'legal_version' => null, @@ -97,14 +99,14 @@ class SubWhiteLabelingOptions implements ModelInterface, ArrayAccess, JsonSerial 'secondary_button_text_color_hover' => null, 'text_color1' => null, 'text_color2' => null, - 'reset_to_default' => null, + 'reset_to_default' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'header_background_color' => false, 'legal_version' => false, @@ -120,14 +122,14 @@ class SubWhiteLabelingOptions implements ModelInterface, ArrayAccess, JsonSerial 'secondary_button_text_color_hover' => false, 'text_color1' => false, 'text_color2' => false, - 'reset_to_default' => false, + 'reset_to_default' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -152,6 +154,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -161,7 +165,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -171,7 +175,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -180,6 +184,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -188,6 +195,9 @@ 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 { @@ -215,7 +225,7 @@ public function isNullableSetToNull(string $property): bool 'secondary_button_text_color_hover' => 'secondary_button_text_color_hover', 'text_color1' => 'text_color1', 'text_color2' => 'text_color2', - 'reset_to_default' => 'reset_to_default', + 'reset_to_default' => 'reset_to_default' ]; /** @@ -238,7 +248,7 @@ public function isNullableSetToNull(string $property): bool 'secondary_button_text_color_hover' => 'setSecondaryButtonTextColorHover', 'text_color1' => 'setTextColor1', 'text_color2' => 'setTextColor2', - 'reset_to_default' => 'setResetToDefault', + 'reset_to_default' => 'setResetToDefault' ]; /** @@ -261,7 +271,7 @@ public function isNullableSetToNull(string $property): bool 'secondary_button_text_color_hover' => 'getSecondaryButtonTextColorHover', 'text_color1' => 'getTextColor1', 'text_color2' => 'getTextColor2', - 'reset_to_default' => 'getResetToDefault', + 'reset_to_default' => 'getResetToDefault' ]; /** @@ -331,10 +341,10 @@ public function getLegalVersionAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('header_background_color', $data ?? [], '#1a1a1a'); $this->setIfExists('legal_version', $data ?? [], 'terms1'); @@ -353,33 +363,34 @@ public function __construct(array $data = null) $this->setIfExists('reset_to_default', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): SubWhiteLabelingOptions { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): SubWhiteLabelingOptions { /** @var SubWhiteLabelingOptions */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, SubWhiteLabelingOptions::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -421,6 +432,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets header_background_color * @@ -438,10 +450,10 @@ public function getHeaderBackgroundColor() * * @return self */ - public function setHeaderBackgroundColor(?string $header_background_color) + public function setHeaderBackgroundColor($header_background_color) { if (is_null($header_background_color)) { - throw new InvalidArgumentException('non-nullable header_background_color cannot be null'); + throw new \InvalidArgumentException('non-nullable header_background_color cannot be null'); } $this->container['header_background_color'] = $header_background_color; @@ -465,14 +477,14 @@ public function getLegalVersion() * * @return self */ - public function setLegalVersion(?string $legal_version) + public function setLegalVersion($legal_version) { if (is_null($legal_version)) { - throw new InvalidArgumentException('non-nullable legal_version cannot be null'); + throw new \InvalidArgumentException('non-nullable legal_version cannot be null'); } $allowedValues = $this->getLegalVersionAllowableValues(); if (!in_array($legal_version, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'legal_version', must be one of '%s'", $legal_version, @@ -502,10 +514,10 @@ public function getLinkColor() * * @return self */ - public function setLinkColor(?string $link_color) + public function setLinkColor($link_color) { if (is_null($link_color)) { - throw new InvalidArgumentException('non-nullable link_color cannot be null'); + throw new \InvalidArgumentException('non-nullable link_color cannot be null'); } $this->container['link_color'] = $link_color; @@ -529,10 +541,10 @@ public function getPageBackgroundColor() * * @return self */ - public function setPageBackgroundColor(?string $page_background_color) + public function setPageBackgroundColor($page_background_color) { if (is_null($page_background_color)) { - throw new InvalidArgumentException('non-nullable page_background_color cannot be null'); + throw new \InvalidArgumentException('non-nullable page_background_color cannot be null'); } $this->container['page_background_color'] = $page_background_color; @@ -556,10 +568,10 @@ public function getPrimaryButtonColor() * * @return self */ - public function setPrimaryButtonColor(?string $primary_button_color) + public function setPrimaryButtonColor($primary_button_color) { if (is_null($primary_button_color)) { - throw new InvalidArgumentException('non-nullable primary_button_color cannot be null'); + throw new \InvalidArgumentException('non-nullable primary_button_color cannot be null'); } $this->container['primary_button_color'] = $primary_button_color; @@ -583,10 +595,10 @@ public function getPrimaryButtonColorHover() * * @return self */ - public function setPrimaryButtonColorHover(?string $primary_button_color_hover) + public function setPrimaryButtonColorHover($primary_button_color_hover) { if (is_null($primary_button_color_hover)) { - throw new InvalidArgumentException('non-nullable primary_button_color_hover cannot be null'); + throw new \InvalidArgumentException('non-nullable primary_button_color_hover cannot be null'); } $this->container['primary_button_color_hover'] = $primary_button_color_hover; @@ -610,10 +622,10 @@ public function getPrimaryButtonTextColor() * * @return self */ - public function setPrimaryButtonTextColor(?string $primary_button_text_color) + public function setPrimaryButtonTextColor($primary_button_text_color) { if (is_null($primary_button_text_color)) { - throw new InvalidArgumentException('non-nullable primary_button_text_color cannot be null'); + throw new \InvalidArgumentException('non-nullable primary_button_text_color cannot be null'); } $this->container['primary_button_text_color'] = $primary_button_text_color; @@ -637,10 +649,10 @@ public function getPrimaryButtonTextColorHover() * * @return self */ - public function setPrimaryButtonTextColorHover(?string $primary_button_text_color_hover) + public function setPrimaryButtonTextColorHover($primary_button_text_color_hover) { if (is_null($primary_button_text_color_hover)) { - throw new InvalidArgumentException('non-nullable primary_button_text_color_hover cannot be null'); + throw new \InvalidArgumentException('non-nullable primary_button_text_color_hover cannot be null'); } $this->container['primary_button_text_color_hover'] = $primary_button_text_color_hover; @@ -664,10 +676,10 @@ public function getSecondaryButtonColor() * * @return self */ - public function setSecondaryButtonColor(?string $secondary_button_color) + public function setSecondaryButtonColor($secondary_button_color) { if (is_null($secondary_button_color)) { - throw new InvalidArgumentException('non-nullable secondary_button_color cannot be null'); + throw new \InvalidArgumentException('non-nullable secondary_button_color cannot be null'); } $this->container['secondary_button_color'] = $secondary_button_color; @@ -691,10 +703,10 @@ public function getSecondaryButtonColorHover() * * @return self */ - public function setSecondaryButtonColorHover(?string $secondary_button_color_hover) + public function setSecondaryButtonColorHover($secondary_button_color_hover) { if (is_null($secondary_button_color_hover)) { - throw new InvalidArgumentException('non-nullable secondary_button_color_hover cannot be null'); + throw new \InvalidArgumentException('non-nullable secondary_button_color_hover cannot be null'); } $this->container['secondary_button_color_hover'] = $secondary_button_color_hover; @@ -718,10 +730,10 @@ public function getSecondaryButtonTextColor() * * @return self */ - public function setSecondaryButtonTextColor(?string $secondary_button_text_color) + public function setSecondaryButtonTextColor($secondary_button_text_color) { if (is_null($secondary_button_text_color)) { - throw new InvalidArgumentException('non-nullable secondary_button_text_color cannot be null'); + throw new \InvalidArgumentException('non-nullable secondary_button_text_color cannot be null'); } $this->container['secondary_button_text_color'] = $secondary_button_text_color; @@ -745,10 +757,10 @@ public function getSecondaryButtonTextColorHover() * * @return self */ - public function setSecondaryButtonTextColorHover(?string $secondary_button_text_color_hover) + public function setSecondaryButtonTextColorHover($secondary_button_text_color_hover) { if (is_null($secondary_button_text_color_hover)) { - throw new InvalidArgumentException('non-nullable secondary_button_text_color_hover cannot be null'); + throw new \InvalidArgumentException('non-nullable secondary_button_text_color_hover cannot be null'); } $this->container['secondary_button_text_color_hover'] = $secondary_button_text_color_hover; @@ -772,10 +784,10 @@ public function getTextColor1() * * @return self */ - public function setTextColor1(?string $text_color1) + public function setTextColor1($text_color1) { if (is_null($text_color1)) { - throw new InvalidArgumentException('non-nullable text_color1 cannot be null'); + throw new \InvalidArgumentException('non-nullable text_color1 cannot be null'); } $this->container['text_color1'] = $text_color1; @@ -799,10 +811,10 @@ public function getTextColor2() * * @return self */ - public function setTextColor2(?string $text_color2) + public function setTextColor2($text_color2) { if (is_null($text_color2)) { - throw new InvalidArgumentException('non-nullable text_color2 cannot be null'); + throw new \InvalidArgumentException('non-nullable text_color2 cannot be null'); } $this->container['text_color2'] = $text_color2; @@ -826,22 +838,23 @@ public function getResetToDefault() * * @return self */ - public function setResetToDefault(?bool $reset_to_default) + public function setResetToDefault($reset_to_default) { if (is_null($reset_to_default)) { - throw new InvalidArgumentException('non-nullable reset_to_default cannot be null'); + throw new \InvalidArgumentException('non-nullable reset_to_default cannot be null'); } $this->container['reset_to_default'] = $reset_to_default; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -850,11 +863,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -865,8 +878,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -879,9 +894,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -889,12 +906,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -923,3 +940,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TeamAddMemberRequest.php b/sdks/php/src/Model/TeamAddMemberRequest.php index e38abb02f..a584db5f0 100644 --- a/sdks/php/src/Model/TeamAddMemberRequest.php +++ b/sdks/php/src/Model/TeamAddMemberRequest.php @@ -1,11 +1,14 @@ */ -class TeamAddMemberRequest implements ModelInterface, ArrayAccess, JsonSerializable +class TeamAddMemberRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamAddMemberRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account_id' => 'string', 'email_address' => 'string', - 'role' => 'string', + 'role' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account_id' => null, 'email_address' => 'email', - 'role' => null, + 'role' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'account_id' => false, 'email_address' => false, - 'role' => false, + 'role' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'account_id' => 'account_id', 'email_address' => 'email_address', - 'role' => 'role', + 'role' => 'role' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'account_id' => 'setAccountId', 'email_address' => 'setEmailAddress', - 'role' => 'setRole', + 'role' => 'setRole' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'account_id' => 'getAccountId', 'email_address' => 'getEmailAddress', - 'role' => 'getRole', + 'role' => 'getRole' ]; /** @@ -262,43 +272,44 @@ public function getRoleAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('account_id', $data ?? [], null); $this->setIfExists('email_address', $data ?? [], null); $this->setIfExists('role', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TeamAddMemberRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TeamAddMemberRequest { /** @var TeamAddMemberRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TeamAddMemberRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -340,6 +351,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets account_id * @@ -357,10 +369,10 @@ public function getAccountId() * * @return self */ - public function setAccountId(?string $account_id) + public function setAccountId($account_id) { if (is_null($account_id)) { - throw new InvalidArgumentException('non-nullable account_id cannot be null'); + throw new \InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -384,10 +396,10 @@ public function getEmailAddress() * * @return self */ - public function setEmailAddress(?string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -411,14 +423,14 @@ public function getRole() * * @return self */ - public function setRole(?string $role) + public function setRole($role) { if (is_null($role)) { - throw new InvalidArgumentException('non-nullable role cannot be null'); + throw new \InvalidArgumentException('non-nullable role cannot be null'); } $allowedValues = $this->getRoleAllowableValues(); if (!in_array($role, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'role', must be one of '%s'", $role, @@ -430,13 +442,14 @@ public function setRole(?string $role) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -445,11 +458,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -460,8 +473,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -474,9 +489,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -484,12 +501,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -518,3 +535,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TeamCreateRequest.php b/sdks/php/src/Model/TeamCreateRequest.php index 6ba37cc71..8b59366d8 100644 --- a/sdks/php/src/Model/TeamCreateRequest.php +++ b/sdks/php/src/Model/TeamCreateRequest.php @@ -1,11 +1,14 @@ */ -class TeamCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class TeamCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamCreateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'name' => 'string', + 'name' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'name' => null, + 'name' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'name' => false, + 'name' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -109,6 +111,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -118,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -128,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -137,6 +141,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -145,6 +152,9 @@ 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 { @@ -158,7 +168,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'name' => 'name', + 'name' => 'name' ]; /** @@ -167,7 +177,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'name' => 'setName', + 'name' => 'setName' ]; /** @@ -176,7 +186,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'name' => 'getName', + 'name' => 'getName' ]; /** @@ -220,6 +230,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -230,41 +241,42 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], 'Untitled Team'); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TeamCreateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TeamCreateRequest { /** @var TeamCreateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TeamCreateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -281,7 +293,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -295,6 +309,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets name * @@ -308,26 +323,27 @@ public function getName() /** * Sets name * - * @param string|null $name the name of your Team + * @param string|null $name The name of your Team. * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -336,11 +352,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -351,8 +367,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -365,9 +383,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -375,12 +395,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -409,3 +429,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TeamGetInfoResponse.php b/sdks/php/src/Model/TeamGetInfoResponse.php index cfac0efbb..4dfa3ae35 100644 --- a/sdks/php/src/Model/TeamGetInfoResponse.php +++ b/sdks/php/src/Model/TeamGetInfoResponse.php @@ -1,11 +1,14 @@ */ -class TeamGetInfoResponse implements ModelInterface, ArrayAccess, JsonSerializable +class TeamGetInfoResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamGetInfoResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'team' => '\Dropbox\Sign\Model\TeamInfoResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'team' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'team' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'team' => 'team', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'team' => 'setTeam', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'team' => 'getTeam', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('team', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TeamGetInfoResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TeamGetInfoResponse { /** @var TeamGetInfoResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TeamGetInfoResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,6 +319,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets team * @@ -324,10 +337,10 @@ public function getTeam() * * @return self */ - public function setTeam(TeamInfoResponse $team) + public function setTeam($team) { if (is_null($team)) { - throw new InvalidArgumentException('non-nullable team cannot be null'); + throw new \InvalidArgumentException('non-nullable team cannot be null'); } $this->container['team'] = $team; @@ -347,26 +360,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -375,11 +389,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,8 +404,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -404,9 +420,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -414,12 +432,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -448,3 +466,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TeamGetResponse.php b/sdks/php/src/Model/TeamGetResponse.php index 6d23ddc3b..e8de3940f 100644 --- a/sdks/php/src/Model/TeamGetResponse.php +++ b/sdks/php/src/Model/TeamGetResponse.php @@ -1,11 +1,14 @@ */ -class TeamGetResponse implements ModelInterface, ArrayAccess, JsonSerializable +class TeamGetResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamGetResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'team' => '\Dropbox\Sign\Model\TeamResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'team' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'team' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'team' => 'team', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'team' => 'setTeam', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'team' => 'getTeam', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('team', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TeamGetResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TeamGetResponse { /** @var TeamGetResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TeamGetResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,6 +319,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets team * @@ -324,10 +337,10 @@ public function getTeam() * * @return self */ - public function setTeam(TeamResponse $team) + public function setTeam($team) { if (is_null($team)) { - throw new InvalidArgumentException('non-nullable team cannot be null'); + throw new \InvalidArgumentException('non-nullable team cannot be null'); } $this->container['team'] = $team; @@ -347,26 +360,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -375,11 +389,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,8 +404,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -404,9 +420,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -414,12 +432,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -448,3 +466,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TeamInfoResponse.php b/sdks/php/src/Model/TeamInfoResponse.php index 3d5ad124a..8e1353353 100644 --- a/sdks/php/src/Model/TeamInfoResponse.php +++ b/sdks/php/src/Model/TeamInfoResponse.php @@ -1,11 +1,14 @@ */ -class TeamInfoResponse implements ModelInterface, ArrayAccess, JsonSerializable +class TeamInfoResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamInfoResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'team_id' => 'string', 'team_parent' => '\Dropbox\Sign\Model\TeamParentResponse', 'name' => 'string', 'num_members' => 'int', - 'num_sub_teams' => 'int', + 'num_sub_teams' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'team_id' => null, 'team_parent' => null, 'name' => null, 'num_members' => null, - 'num_sub_teams' => null, + 'num_sub_teams' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'team_id' => false, 'team_parent' => true, 'name' => false, 'num_members' => false, - 'num_sub_teams' => false, + 'num_sub_teams' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -121,6 +123,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -130,7 +134,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -140,7 +144,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -149,6 +153,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -157,6 +164,9 @@ 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 { @@ -174,7 +184,7 @@ public function isNullableSetToNull(string $property): bool 'team_parent' => 'team_parent', 'name' => 'name', 'num_members' => 'num_members', - 'num_sub_teams' => 'num_sub_teams', + 'num_sub_teams' => 'num_sub_teams' ]; /** @@ -187,7 +197,7 @@ public function isNullableSetToNull(string $property): bool 'team_parent' => 'setTeamParent', 'name' => 'setName', 'num_members' => 'setNumMembers', - 'num_sub_teams' => 'setNumSubTeams', + 'num_sub_teams' => 'setNumSubTeams' ]; /** @@ -200,7 +210,7 @@ public function isNullableSetToNull(string $property): bool 'team_parent' => 'getTeamParent', 'name' => 'getName', 'num_members' => 'getNumMembers', - 'num_sub_teams' => 'getNumSubTeams', + 'num_sub_teams' => 'getNumSubTeams' ]; /** @@ -244,6 +254,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -254,10 +265,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('team_id', $data ?? [], null); $this->setIfExists('team_parent', $data ?? [], null); @@ -266,33 +277,34 @@ public function __construct(array $data = null) $this->setIfExists('num_sub_teams', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TeamInfoResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TeamInfoResponse { /** @var TeamInfoResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TeamInfoResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -309,7 +321,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -323,6 +337,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets team_id * @@ -340,10 +355,10 @@ public function getTeamId() * * @return self */ - public function setTeamId(?string $team_id) + public function setTeamId($team_id) { if (is_null($team_id)) { - throw new InvalidArgumentException('non-nullable team_id cannot be null'); + throw new \InvalidArgumentException('non-nullable team_id cannot be null'); } $this->container['team_id'] = $team_id; @@ -367,13 +382,13 @@ public function getTeamParent() * * @return self */ - public function setTeamParent(?TeamParentResponse $team_parent) + public function setTeamParent($team_parent) { if (is_null($team_parent)) { array_push($this->openAPINullablesSetToNull, 'team_parent'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('team_parent', $nullablesSetToNull); + $index = array_search('team_parent', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -401,10 +416,10 @@ public function getName() * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -428,10 +443,10 @@ public function getNumMembers() * * @return self */ - public function setNumMembers(?int $num_members) + public function setNumMembers($num_members) { if (is_null($num_members)) { - throw new InvalidArgumentException('non-nullable num_members cannot be null'); + throw new \InvalidArgumentException('non-nullable num_members cannot be null'); } $this->container['num_members'] = $num_members; @@ -455,22 +470,23 @@ public function getNumSubTeams() * * @return self */ - public function setNumSubTeams(?int $num_sub_teams) + public function setNumSubTeams($num_sub_teams) { if (is_null($num_sub_teams)) { - throw new InvalidArgumentException('non-nullable num_sub_teams cannot be null'); + throw new \InvalidArgumentException('non-nullable num_sub_teams cannot be null'); } $this->container['num_sub_teams'] = $num_sub_teams; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -479,11 +495,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -494,8 +510,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -508,9 +526,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -518,12 +538,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -552,3 +572,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TeamInviteResponse.php b/sdks/php/src/Model/TeamInviteResponse.php index d37dae050..a1cdc493b 100644 --- a/sdks/php/src/Model/TeamInviteResponse.php +++ b/sdks/php/src/Model/TeamInviteResponse.php @@ -1,11 +1,14 @@ */ -class TeamInviteResponse implements ModelInterface, ArrayAccess, JsonSerializable +class TeamInviteResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamInviteResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'email_address' => 'string', 'team_id' => 'string', 'role' => 'string', 'sent_at' => 'int', 'redeemed_at' => 'int', - 'expires_at' => 'int', + 'expires_at' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'email_address' => null, 'team_id' => null, 'role' => null, 'sent_at' => null, 'redeemed_at' => null, - 'expires_at' => null, + 'expires_at' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'email_address' => false, 'team_id' => false, 'role' => false, 'sent_at' => false, 'redeemed_at' => false, - 'expires_at' => false, + 'expires_at' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -124,6 +126,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -133,7 +137,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -143,7 +147,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -152,6 +156,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -160,6 +167,9 @@ 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 { @@ -178,7 +188,7 @@ public function isNullableSetToNull(string $property): bool 'role' => 'role', 'sent_at' => 'sent_at', 'redeemed_at' => 'redeemed_at', - 'expires_at' => 'expires_at', + 'expires_at' => 'expires_at' ]; /** @@ -192,7 +202,7 @@ public function isNullableSetToNull(string $property): bool 'role' => 'setRole', 'sent_at' => 'setSentAt', 'redeemed_at' => 'setRedeemedAt', - 'expires_at' => 'setExpiresAt', + 'expires_at' => 'setExpiresAt' ]; /** @@ -206,7 +216,7 @@ public function isNullableSetToNull(string $property): bool 'role' => 'getRole', 'sent_at' => 'getSentAt', 'redeemed_at' => 'getRedeemedAt', - 'expires_at' => 'getExpiresAt', + 'expires_at' => 'getExpiresAt' ]; /** @@ -250,6 +260,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -260,10 +271,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('email_address', $data ?? [], null); $this->setIfExists('team_id', $data ?? [], null); @@ -273,33 +284,34 @@ public function __construct(array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TeamInviteResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TeamInviteResponse { /** @var TeamInviteResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TeamInviteResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -316,7 +328,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -330,6 +344,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets email_address * @@ -343,14 +358,14 @@ public function getEmailAddress() /** * Sets email_address * - * @param string|null $email_address email address of the user invited to this team + * @param string|null $email_address Email address of the user invited to this team. * * @return self */ - public function setEmailAddress(?string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -370,14 +385,14 @@ public function getTeamId() /** * Sets team_id * - * @param string|null $team_id id of the team + * @param string|null $team_id Id of the team. * * @return self */ - public function setTeamId(?string $team_id) + public function setTeamId($team_id) { if (is_null($team_id)) { - throw new InvalidArgumentException('non-nullable team_id cannot be null'); + throw new \InvalidArgumentException('non-nullable team_id cannot be null'); } $this->container['team_id'] = $team_id; @@ -397,14 +412,14 @@ public function getRole() /** * Sets role * - * @param string|null $role role of the user invited to this team + * @param string|null $role Role of the user invited to this team. * * @return self */ - public function setRole(?string $role) + public function setRole($role) { if (is_null($role)) { - throw new InvalidArgumentException('non-nullable role cannot be null'); + throw new \InvalidArgumentException('non-nullable role cannot be null'); } $this->container['role'] = $role; @@ -424,14 +439,14 @@ public function getSentAt() /** * Sets sent_at * - * @param int|null $sent_at timestamp when the invitation was sent + * @param int|null $sent_at Timestamp when the invitation was sent. * * @return self */ - public function setSentAt(?int $sent_at) + public function setSentAt($sent_at) { if (is_null($sent_at)) { - throw new InvalidArgumentException('non-nullable sent_at cannot be null'); + throw new \InvalidArgumentException('non-nullable sent_at cannot be null'); } $this->container['sent_at'] = $sent_at; @@ -451,14 +466,14 @@ public function getRedeemedAt() /** * Sets redeemed_at * - * @param int|null $redeemed_at timestamp when the invitation was redeemed + * @param int|null $redeemed_at Timestamp when the invitation was redeemed. * * @return self */ - public function setRedeemedAt(?int $redeemed_at) + public function setRedeemedAt($redeemed_at) { if (is_null($redeemed_at)) { - throw new InvalidArgumentException('non-nullable redeemed_at cannot be null'); + throw new \InvalidArgumentException('non-nullable redeemed_at cannot be null'); } $this->container['redeemed_at'] = $redeemed_at; @@ -478,26 +493,27 @@ public function getExpiresAt() /** * Sets expires_at * - * @param int|null $expires_at timestamp when the invitation is expiring + * @param int|null $expires_at Timestamp when the invitation is expiring. * * @return self */ - public function setExpiresAt(?int $expires_at) + public function setExpiresAt($expires_at) { if (is_null($expires_at)) { - throw new InvalidArgumentException('non-nullable expires_at cannot be null'); + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); } $this->container['expires_at'] = $expires_at; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -506,11 +522,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -521,8 +537,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -535,9 +553,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -545,12 +565,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -579,3 +599,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TeamInvitesResponse.php b/sdks/php/src/Model/TeamInvitesResponse.php index 31b58b939..124e5e8eb 100644 --- a/sdks/php/src/Model/TeamInvitesResponse.php +++ b/sdks/php/src/Model/TeamInvitesResponse.php @@ -1,11 +1,14 @@ */ -class TeamInvitesResponse implements ModelInterface, ArrayAccess, JsonSerializable +class TeamInvitesResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamInvitesResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'team_invites' => '\Dropbox\Sign\Model\TeamInviteResponse[]', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'team_invites' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'team_invites' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'team_invites' => 'team_invites', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'team_invites' => 'setTeamInvites', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'team_invites' => 'getTeamInvites', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('team_invites', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TeamInvitesResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TeamInvitesResponse { /** @var TeamInvitesResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TeamInvitesResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,6 +319,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets team_invites * @@ -320,14 +333,14 @@ public function getTeamInvites() /** * Sets team_invites * - * @param TeamInviteResponse[] $team_invites contains a list of team invites and their roles + * @param TeamInviteResponse[] $team_invites Contains a list of team invites and their roles. * * @return self */ - public function setTeamInvites(array $team_invites) + public function setTeamInvites($team_invites) { if (is_null($team_invites)) { - throw new InvalidArgumentException('non-nullable team_invites cannot be null'); + throw new \InvalidArgumentException('non-nullable team_invites cannot be null'); } $this->container['team_invites'] = $team_invites; @@ -351,22 +364,23 @@ public function getWarnings() * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -375,11 +389,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,8 +404,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -404,9 +420,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -414,12 +432,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -448,3 +466,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TeamMemberResponse.php b/sdks/php/src/Model/TeamMemberResponse.php index ee61fbdd3..4c0885de1 100644 --- a/sdks/php/src/Model/TeamMemberResponse.php +++ b/sdks/php/src/Model/TeamMemberResponse.php @@ -1,11 +1,14 @@ */ -class TeamMemberResponse implements ModelInterface, ArrayAccess, JsonSerializable +class TeamMemberResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamMemberResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account_id' => 'string', 'email_address' => 'string', - 'role' => 'string', + 'role' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account_id' => null, 'email_address' => null, - 'role' => null, + 'role' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'account_id' => false, 'email_address' => false, - 'role' => false, + 'role' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'account_id' => 'account_id', 'email_address' => 'email_address', - 'role' => 'role', + 'role' => 'role' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'account_id' => 'setAccountId', 'email_address' => 'setEmailAddress', - 'role' => 'setRole', + 'role' => 'setRole' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'account_id' => 'getAccountId', 'email_address' => 'getEmailAddress', - 'role' => 'getRole', + 'role' => 'getRole' ]; /** @@ -232,6 +242,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -242,43 +253,44 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('account_id', $data ?? [], null); $this->setIfExists('email_address', $data ?? [], null); $this->setIfExists('role', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TeamMemberResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TeamMemberResponse { /** @var TeamMemberResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TeamMemberResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -295,7 +307,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -309,6 +323,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets account_id * @@ -322,14 +337,14 @@ public function getAccountId() /** * Sets account_id * - * @param string|null $account_id account id of the team member + * @param string|null $account_id Account id of the team member. * * @return self */ - public function setAccountId(?string $account_id) + public function setAccountId($account_id) { if (is_null($account_id)) { - throw new InvalidArgumentException('non-nullable account_id cannot be null'); + throw new \InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -349,14 +364,14 @@ public function getEmailAddress() /** * Sets email_address * - * @param string|null $email_address email address of the team member + * @param string|null $email_address Email address of the team member. * * @return self */ - public function setEmailAddress(?string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -376,26 +391,27 @@ public function getRole() /** * Sets role * - * @param string|null $role the specific role a member has on the team + * @param string|null $role The specific role a member has on the team. * * @return self */ - public function setRole(?string $role) + public function setRole($role) { if (is_null($role)) { - throw new InvalidArgumentException('non-nullable role cannot be null'); + throw new \InvalidArgumentException('non-nullable role cannot be null'); } $this->container['role'] = $role; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -404,11 +420,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -419,8 +435,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -433,9 +451,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -443,12 +463,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -477,3 +497,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TeamMembersResponse.php b/sdks/php/src/Model/TeamMembersResponse.php index 681ad9af1..b0d29b515 100644 --- a/sdks/php/src/Model/TeamMembersResponse.php +++ b/sdks/php/src/Model/TeamMembersResponse.php @@ -1,11 +1,14 @@ */ -class TeamMembersResponse implements ModelInterface, ArrayAccess, JsonSerializable +class TeamMembersResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamMembersResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'team_members' => '\Dropbox\Sign\Model\TeamMemberResponse[]', 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'team_members' => null, 'list_info' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'team_members' => false, 'list_info' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'team_members' => 'team_members', 'list_info' => 'list_info', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'team_members' => 'setTeamMembers', 'list_info' => 'setListInfo', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'team_members' => 'getTeamMembers', 'list_info' => 'getListInfo', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -232,6 +242,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -242,43 +253,44 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('team_members', $data ?? [], null); $this->setIfExists('list_info', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TeamMembersResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TeamMembersResponse { /** @var TeamMembersResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TeamMembersResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -317,6 +329,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets team_members * @@ -330,14 +343,14 @@ public function getTeamMembers() /** * Sets team_members * - * @param TeamMemberResponse[] $team_members contains a list of team members and their roles for a specific team + * @param TeamMemberResponse[] $team_members Contains a list of team members and their roles for a specific team. * * @return self */ - public function setTeamMembers(array $team_members) + public function setTeamMembers($team_members) { if (is_null($team_members)) { - throw new InvalidArgumentException('non-nullable team_members cannot be null'); + throw new \InvalidArgumentException('non-nullable team_members cannot be null'); } $this->container['team_members'] = $team_members; @@ -361,10 +374,10 @@ public function getListInfo() * * @return self */ - public function setListInfo(ListInfoResponse $list_info) + public function setListInfo($list_info) { if (is_null($list_info)) { - throw new InvalidArgumentException('non-nullable list_info cannot be null'); + throw new \InvalidArgumentException('non-nullable list_info cannot be null'); } $this->container['list_info'] = $list_info; @@ -388,22 +401,23 @@ public function getWarnings() * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -412,11 +426,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -427,8 +441,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -441,9 +457,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -451,12 +469,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -485,3 +503,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TeamParentResponse.php b/sdks/php/src/Model/TeamParentResponse.php index d0d447285..4566b7d14 100644 --- a/sdks/php/src/Model/TeamParentResponse.php +++ b/sdks/php/src/Model/TeamParentResponse.php @@ -1,11 +1,14 @@ */ -class TeamParentResponse implements ModelInterface, ArrayAccess, JsonSerializable +class TeamParentResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamParentResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'team_id' => 'string', - 'name' => 'string', + 'name' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'team_id' => null, - 'name' => null, + 'name' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'team_id' => false, - 'name' => false, + 'name' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,6 +115,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -122,7 +126,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +136,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,6 +145,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -149,6 +156,9 @@ 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 { @@ -163,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'team_id' => 'team_id', - 'name' => 'name', + 'name' => 'name' ]; /** @@ -173,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'team_id' => 'setTeamId', - 'name' => 'setName', + 'name' => 'setName' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'team_id' => 'getTeamId', - 'name' => 'getName', + 'name' => 'getName' ]; /** @@ -227,6 +237,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -237,42 +248,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('team_id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TeamParentResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TeamParentResponse { /** @var TeamParentResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TeamParentResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -289,7 +301,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -303,6 +317,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets team_id * @@ -320,10 +335,10 @@ public function getTeamId() * * @return self */ - public function setTeamId(?string $team_id) + public function setTeamId($team_id) { if (is_null($team_id)) { - throw new InvalidArgumentException('non-nullable team_id cannot be null'); + throw new \InvalidArgumentException('non-nullable team_id cannot be null'); } $this->container['team_id'] = $team_id; @@ -347,22 +362,23 @@ public function getName() * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -371,11 +387,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -386,8 +402,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -400,9 +418,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -410,12 +430,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -444,3 +464,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TeamRemoveMemberRequest.php b/sdks/php/src/Model/TeamRemoveMemberRequest.php index 6d7413255..e8e7b9188 100644 --- a/sdks/php/src/Model/TeamRemoveMemberRequest.php +++ b/sdks/php/src/Model/TeamRemoveMemberRequest.php @@ -1,11 +1,14 @@ */ -class TeamRemoveMemberRequest implements ModelInterface, ArrayAccess, JsonSerializable +class TeamRemoveMemberRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamRemoveMemberRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account_id' => 'string', 'email_address' => 'string', 'new_owner_email_address' => 'string', 'new_team_id' => 'string', - 'new_role' => 'string', + 'new_role' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account_id' => null, 'email_address' => 'email', 'new_owner_email_address' => 'email', 'new_team_id' => null, - 'new_role' => null, + 'new_role' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'account_id' => false, 'email_address' => false, 'new_owner_email_address' => false, 'new_team_id' => false, - 'new_role' => false, + 'new_role' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -121,6 +123,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -130,7 +134,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -140,7 +144,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -149,6 +153,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -157,6 +164,9 @@ 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 { @@ -174,7 +184,7 @@ public function isNullableSetToNull(string $property): bool 'email_address' => 'email_address', 'new_owner_email_address' => 'new_owner_email_address', 'new_team_id' => 'new_team_id', - 'new_role' => 'new_role', + 'new_role' => 'new_role' ]; /** @@ -187,7 +197,7 @@ public function isNullableSetToNull(string $property): bool 'email_address' => 'setEmailAddress', 'new_owner_email_address' => 'setNewOwnerEmailAddress', 'new_team_id' => 'setNewTeamId', - 'new_role' => 'setNewRole', + 'new_role' => 'setNewRole' ]; /** @@ -200,7 +210,7 @@ public function isNullableSetToNull(string $property): bool 'email_address' => 'getEmailAddress', 'new_owner_email_address' => 'getNewOwnerEmailAddress', 'new_team_id' => 'getNewTeamId', - 'new_role' => 'getNewRole', + 'new_role' => 'getNewRole' ]; /** @@ -274,10 +284,10 @@ public function getNewRoleAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('account_id', $data ?? [], null); $this->setIfExists('email_address', $data ?? [], null); @@ -286,33 +296,34 @@ public function __construct(array $data = null) $this->setIfExists('new_role', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TeamRemoveMemberRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TeamRemoveMemberRequest { /** @var TeamRemoveMemberRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TeamRemoveMemberRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -354,6 +365,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets account_id * @@ -371,10 +383,10 @@ public function getAccountId() * * @return self */ - public function setAccountId(?string $account_id) + public function setAccountId($account_id) { if (is_null($account_id)) { - throw new InvalidArgumentException('non-nullable account_id cannot be null'); + throw new \InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -398,10 +410,10 @@ public function getEmailAddress() * * @return self */ - public function setEmailAddress(?string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -425,10 +437,10 @@ public function getNewOwnerEmailAddress() * * @return self */ - public function setNewOwnerEmailAddress(?string $new_owner_email_address) + public function setNewOwnerEmailAddress($new_owner_email_address) { if (is_null($new_owner_email_address)) { - throw new InvalidArgumentException('non-nullable new_owner_email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable new_owner_email_address cannot be null'); } $this->container['new_owner_email_address'] = $new_owner_email_address; @@ -448,14 +460,14 @@ public function getNewTeamId() /** * Sets new_team_id * - * @param string|null $new_team_id id of the new Team + * @param string|null $new_team_id Id of the new Team. * * @return self */ - public function setNewTeamId(?string $new_team_id) + public function setNewTeamId($new_team_id) { if (is_null($new_team_id)) { - throw new InvalidArgumentException('non-nullable new_team_id cannot be null'); + throw new \InvalidArgumentException('non-nullable new_team_id cannot be null'); } $this->container['new_team_id'] = $new_team_id; @@ -479,14 +491,14 @@ public function getNewRole() * * @return self */ - public function setNewRole(?string $new_role) + public function setNewRole($new_role) { if (is_null($new_role)) { - throw new InvalidArgumentException('non-nullable new_role cannot be null'); + throw new \InvalidArgumentException('non-nullable new_role cannot be null'); } $allowedValues = $this->getNewRoleAllowableValues(); if (!in_array($new_role, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'new_role', must be one of '%s'", $new_role, @@ -498,13 +510,14 @@ public function setNewRole(?string $new_role) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -513,11 +526,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -528,8 +541,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -542,9 +557,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -552,12 +569,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -586,3 +603,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TeamResponse.php b/sdks/php/src/Model/TeamResponse.php index 402916a49..7f30850a8 100644 --- a/sdks/php/src/Model/TeamResponse.php +++ b/sdks/php/src/Model/TeamResponse.php @@ -1,11 +1,14 @@ */ -class TeamResponse implements ModelInterface, ArrayAccess, JsonSerializable +class TeamResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', 'accounts' => '\Dropbox\Sign\Model\AccountResponse[]', 'invited_accounts' => '\Dropbox\Sign\Model\AccountResponse[]', - 'invited_emails' => 'string[]', + 'invited_emails' => 'string[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, 'accounts' => null, 'invited_accounts' => null, - 'invited_emails' => null, + 'invited_emails' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'name' => false, 'accounts' => false, 'invited_accounts' => false, - 'invited_emails' => false, + 'invited_emails' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -119,6 +121,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -128,7 +132,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +142,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,6 +151,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -155,6 +162,9 @@ 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 { @@ -171,7 +181,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'name', 'accounts' => 'accounts', 'invited_accounts' => 'invited_accounts', - 'invited_emails' => 'invited_emails', + 'invited_emails' => 'invited_emails' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'setName', 'accounts' => 'setAccounts', 'invited_accounts' => 'setInvitedAccounts', - 'invited_emails' => 'setInvitedEmails', + 'invited_emails' => 'setInvitedEmails' ]; /** @@ -195,7 +205,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'getName', 'accounts' => 'getAccounts', 'invited_accounts' => 'getInvitedAccounts', - 'invited_emails' => 'getInvitedEmails', + 'invited_emails' => 'getInvitedEmails' ]; /** @@ -239,6 +249,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -249,10 +260,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('accounts', $data ?? [], null); @@ -260,33 +271,34 @@ public function __construct(array $data = null) $this->setIfExists('invited_emails', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TeamResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TeamResponse { /** @var TeamResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TeamResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -303,7 +315,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -317,6 +331,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets name * @@ -334,10 +349,10 @@ public function getName() * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -361,10 +376,10 @@ public function getAccounts() * * @return self */ - public function setAccounts(?array $accounts) + public function setAccounts($accounts) { if (is_null($accounts)) { - throw new InvalidArgumentException('non-nullable accounts cannot be null'); + throw new \InvalidArgumentException('non-nullable accounts cannot be null'); } $this->container['accounts'] = $accounts; @@ -388,10 +403,10 @@ public function getInvitedAccounts() * * @return self */ - public function setInvitedAccounts(?array $invited_accounts) + public function setInvitedAccounts($invited_accounts) { if (is_null($invited_accounts)) { - throw new InvalidArgumentException('non-nullable invited_accounts cannot be null'); + throw new \InvalidArgumentException('non-nullable invited_accounts cannot be null'); } $this->container['invited_accounts'] = $invited_accounts; @@ -411,26 +426,27 @@ public function getInvitedEmails() /** * Sets invited_emails * - * @param string[]|null $invited_emails a list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account + * @param string[]|null $invited_emails A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account. * * @return self */ - public function setInvitedEmails(?array $invited_emails) + public function setInvitedEmails($invited_emails) { if (is_null($invited_emails)) { - throw new InvalidArgumentException('non-nullable invited_emails cannot be null'); + throw new \InvalidArgumentException('non-nullable invited_emails cannot be null'); } $this->container['invited_emails'] = $invited_emails; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -439,11 +455,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -454,8 +470,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -468,9 +486,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -478,12 +498,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -512,3 +532,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TeamSubTeamsResponse.php b/sdks/php/src/Model/TeamSubTeamsResponse.php index e3e9206c2..7af88b380 100644 --- a/sdks/php/src/Model/TeamSubTeamsResponse.php +++ b/sdks/php/src/Model/TeamSubTeamsResponse.php @@ -1,11 +1,14 @@ */ -class TeamSubTeamsResponse implements ModelInterface, ArrayAccess, JsonSerializable +class TeamSubTeamsResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamSubTeamsResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'sub_teams' => '\Dropbox\Sign\Model\SubTeamResponse[]', 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'sub_teams' => null, 'list_info' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'sub_teams' => false, 'list_info' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'sub_teams' => 'sub_teams', 'list_info' => 'list_info', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'sub_teams' => 'setSubTeams', 'list_info' => 'setListInfo', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'sub_teams' => 'getSubTeams', 'list_info' => 'getListInfo', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -232,6 +242,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -242,43 +253,44 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('sub_teams', $data ?? [], null); $this->setIfExists('list_info', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TeamSubTeamsResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TeamSubTeamsResponse { /** @var TeamSubTeamsResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TeamSubTeamsResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -317,6 +329,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets sub_teams * @@ -330,14 +343,14 @@ public function getSubTeams() /** * Sets sub_teams * - * @param SubTeamResponse[] $sub_teams contains a list with sub teams + * @param SubTeamResponse[] $sub_teams Contains a list with sub teams. * * @return self */ - public function setSubTeams(array $sub_teams) + public function setSubTeams($sub_teams) { if (is_null($sub_teams)) { - throw new InvalidArgumentException('non-nullable sub_teams cannot be null'); + throw new \InvalidArgumentException('non-nullable sub_teams cannot be null'); } $this->container['sub_teams'] = $sub_teams; @@ -361,10 +374,10 @@ public function getListInfo() * * @return self */ - public function setListInfo(ListInfoResponse $list_info) + public function setListInfo($list_info) { if (is_null($list_info)) { - throw new InvalidArgumentException('non-nullable list_info cannot be null'); + throw new \InvalidArgumentException('non-nullable list_info cannot be null'); } $this->container['list_info'] = $list_info; @@ -388,22 +401,23 @@ public function getWarnings() * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -412,11 +426,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -427,8 +441,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -441,9 +457,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -451,12 +469,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -485,3 +503,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TeamUpdateRequest.php b/sdks/php/src/Model/TeamUpdateRequest.php index 6606b7676..1f074d9b5 100644 --- a/sdks/php/src/Model/TeamUpdateRequest.php +++ b/sdks/php/src/Model/TeamUpdateRequest.php @@ -1,11 +1,14 @@ */ -class TeamUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class TeamUpdateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamUpdateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'name' => 'string', + 'name' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'name' => null, + 'name' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'name' => false, + 'name' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -109,6 +111,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -118,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -128,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -137,6 +141,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -145,6 +152,9 @@ 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 { @@ -158,7 +168,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'name' => 'name', + 'name' => 'name' ]; /** @@ -167,7 +177,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'name' => 'setName', + 'name' => 'setName' ]; /** @@ -176,7 +186,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'name' => 'getName', + 'name' => 'getName' ]; /** @@ -220,6 +230,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -230,41 +241,42 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TeamUpdateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TeamUpdateRequest { /** @var TeamUpdateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TeamUpdateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -281,7 +293,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -295,6 +309,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets name * @@ -308,26 +323,27 @@ public function getName() /** * Sets name * - * @param string|null $name the name of your Team + * @param string|null $name The name of your Team. * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -336,11 +352,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -351,8 +367,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -365,9 +383,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -375,12 +395,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -409,3 +429,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateAddUserRequest.php b/sdks/php/src/Model/TemplateAddUserRequest.php index ea87103ad..268cde9a0 100644 --- a/sdks/php/src/Model/TemplateAddUserRequest.php +++ b/sdks/php/src/Model/TemplateAddUserRequest.php @@ -1,11 +1,14 @@ */ -class TemplateAddUserRequest implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateAddUserRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateAddUserRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account_id' => 'string', 'email_address' => 'string', - 'skip_notification' => 'bool', + 'skip_notification' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account_id' => null, 'email_address' => 'email', - 'skip_notification' => null, + 'skip_notification' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'account_id' => false, 'email_address' => false, - 'skip_notification' => false, + 'skip_notification' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'account_id' => 'account_id', 'email_address' => 'email_address', - 'skip_notification' => 'skip_notification', + 'skip_notification' => 'skip_notification' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'account_id' => 'setAccountId', 'email_address' => 'setEmailAddress', - 'skip_notification' => 'setSkipNotification', + 'skip_notification' => 'setSkipNotification' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'account_id' => 'getAccountId', 'email_address' => 'getEmailAddress', - 'skip_notification' => 'getSkipNotification', + 'skip_notification' => 'getSkipNotification' ]; /** @@ -232,6 +242,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -242,43 +253,44 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('account_id', $data ?? [], null); $this->setIfExists('email_address', $data ?? [], null); $this->setIfExists('skip_notification', $data ?? [], false); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateAddUserRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateAddUserRequest { /** @var TemplateAddUserRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateAddUserRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -295,7 +307,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -309,6 +323,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets account_id * @@ -326,10 +341,10 @@ public function getAccountId() * * @return self */ - public function setAccountId(?string $account_id) + public function setAccountId($account_id) { if (is_null($account_id)) { - throw new InvalidArgumentException('non-nullable account_id cannot be null'); + throw new \InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -353,10 +368,10 @@ public function getEmailAddress() * * @return self */ - public function setEmailAddress(?string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -380,22 +395,23 @@ public function getSkipNotification() * * @return self */ - public function setSkipNotification(?bool $skip_notification) + public function setSkipNotification($skip_notification) { if (is_null($skip_notification)) { - throw new InvalidArgumentException('non-nullable skip_notification cannot be null'); + throw new \InvalidArgumentException('non-nullable skip_notification cannot be null'); } $this->container['skip_notification'] = $skip_notification; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -404,11 +420,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -419,8 +435,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -433,9 +451,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -443,12 +463,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -477,3 +497,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateCreateEmbeddedDraftRequest.php b/sdks/php/src/Model/TemplateCreateEmbeddedDraftRequest.php index fe626a83a..9575759d5 100644 --- a/sdks/php/src/Model/TemplateCreateEmbeddedDraftRequest.php +++ b/sdks/php/src/Model/TemplateCreateEmbeddedDraftRequest.php @@ -1,11 +1,14 @@ */ -class TemplateCreateEmbeddedDraftRequest implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateCreateEmbeddedDraftRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateCreateEmbeddedDraftRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'client_id' => 'string', 'files' => '\SplFileObject[]', @@ -82,16 +83,16 @@ class TemplateCreateEmbeddedDraftRequest implements ModelInterface, ArrayAccess, 'subject' => 'string', 'test_mode' => 'bool', 'title' => 'string', - 'use_preexisting_fields' => 'bool', + 'use_preexisting_fields' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'client_id' => null, 'files' => 'binary', @@ -117,14 +118,14 @@ class TemplateCreateEmbeddedDraftRequest implements ModelInterface, ArrayAccess, 'subject' => null, 'test_mode' => null, 'title' => null, - 'use_preexisting_fields' => null, + 'use_preexisting_fields' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'client_id' => false, 'files' => false, @@ -150,14 +151,14 @@ class TemplateCreateEmbeddedDraftRequest implements ModelInterface, ArrayAccess, 'subject' => false, 'test_mode' => false, 'title' => false, - 'use_preexisting_fields' => false, + 'use_preexisting_fields' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -182,6 +183,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -191,7 +194,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -201,7 +204,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -210,6 +213,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -218,6 +224,9 @@ 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 { @@ -255,7 +264,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'subject', 'test_mode' => 'test_mode', 'title' => 'title', - 'use_preexisting_fields' => 'use_preexisting_fields', + 'use_preexisting_fields' => 'use_preexisting_fields' ]; /** @@ -288,7 +297,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'setSubject', 'test_mode' => 'setTestMode', 'title' => 'setTitle', - 'use_preexisting_fields' => 'setUsePreexistingFields', + 'use_preexisting_fields' => 'setUsePreexistingFields' ]; /** @@ -321,7 +330,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'getSubject', 'test_mode' => 'getTestMode', 'title' => 'getTitle', - 'use_preexisting_fields' => 'getUsePreexistingFields', + 'use_preexisting_fields' => 'getUsePreexistingFields' ]; /** @@ -365,6 +374,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -375,10 +385,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('client_id', $data ?? [], null); $this->setIfExists('files', $data ?? [], null); @@ -407,33 +417,34 @@ public function __construct(array $data = null) $this->setIfExists('use_preexisting_fields', $data ?? [], false); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateCreateEmbeddedDraftRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateCreateEmbeddedDraftRequest { /** @var TemplateCreateEmbeddedDraftRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateCreateEmbeddedDraftRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -477,6 +488,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets client_id * @@ -494,10 +506,10 @@ public function getClientId() * * @return self */ - public function setClientId(string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -507,7 +519,7 @@ public function setClientId(string $client_id) /** * Gets files * - * @return SplFileObject[]|null + * @return \SplFileObject[]|null */ public function getFiles() { @@ -517,14 +529,14 @@ public function getFiles() /** * Sets files * - * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles(?array $files) + public function setFiles($files) { if (is_null($files)) { - throw new InvalidArgumentException('non-nullable files cannot be null'); + throw new \InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -548,10 +560,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls(?array $file_urls) + public function setFileUrls($file_urls) { if (is_null($file_urls)) { - throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -571,14 +583,14 @@ public function getAllowCcs() /** * Sets allow_ccs * - * @param bool|null $allow_ccs this allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template + * @param bool|null $allow_ccs This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template. * * @return self */ - public function setAllowCcs(?bool $allow_ccs) + public function setAllowCcs($allow_ccs) { if (is_null($allow_ccs)) { - throw new InvalidArgumentException('non-nullable allow_ccs cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_ccs cannot be null'); } $this->container['allow_ccs'] = $allow_ccs; @@ -602,10 +614,10 @@ public function getAllowReassign() * * @return self */ - public function setAllowReassign(?bool $allow_reassign) + public function setAllowReassign($allow_reassign) { if (is_null($allow_reassign)) { - throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_reassign cannot be null'); } $this->container['allow_reassign'] = $allow_reassign; @@ -629,10 +641,10 @@ public function getAttachments() * * @return self */ - public function setAttachments(?array $attachments) + public function setAttachments($attachments) { if (is_null($attachments)) { - throw new InvalidArgumentException('non-nullable attachments cannot be null'); + throw new \InvalidArgumentException('non-nullable attachments cannot be null'); } $this->container['attachments'] = $attachments; @@ -656,10 +668,10 @@ public function getCcRoles() * * @return self */ - public function setCcRoles(?array $cc_roles) + public function setCcRoles($cc_roles) { if (is_null($cc_roles)) { - throw new InvalidArgumentException('non-nullable cc_roles cannot be null'); + throw new \InvalidArgumentException('non-nullable cc_roles cannot be null'); } $this->container['cc_roles'] = $cc_roles; @@ -683,10 +695,10 @@ public function getEditorOptions() * * @return self */ - public function setEditorOptions(?SubEditorOptions $editor_options) + public function setEditorOptions($editor_options) { if (is_null($editor_options)) { - throw new InvalidArgumentException('non-nullable editor_options cannot be null'); + throw new \InvalidArgumentException('non-nullable editor_options cannot be null'); } $this->container['editor_options'] = $editor_options; @@ -710,10 +722,10 @@ public function getFieldOptions() * * @return self */ - public function setFieldOptions(?SubFieldOptions $field_options) + public function setFieldOptions($field_options) { if (is_null($field_options)) { - throw new InvalidArgumentException('non-nullable field_options cannot be null'); + throw new \InvalidArgumentException('non-nullable field_options cannot be null'); } $this->container['field_options'] = $field_options; @@ -733,14 +745,14 @@ public function getForceSignerRoles() /** * Sets force_signer_roles * - * @param bool|null $force_signer_roles provide users the ability to review/edit the template signer roles + * @param bool|null $force_signer_roles Provide users the ability to review/edit the template signer roles. * * @return self */ - public function setForceSignerRoles(?bool $force_signer_roles) + public function setForceSignerRoles($force_signer_roles) { if (is_null($force_signer_roles)) { - throw new InvalidArgumentException('non-nullable force_signer_roles cannot be null'); + throw new \InvalidArgumentException('non-nullable force_signer_roles cannot be null'); } $this->container['force_signer_roles'] = $force_signer_roles; @@ -760,14 +772,14 @@ public function getForceSubjectMessage() /** * Sets force_subject_message * - * @param bool|null $force_subject_message provide users the ability to review/edit the template subject and message + * @param bool|null $force_subject_message Provide users the ability to review/edit the template subject and message. * * @return self */ - public function setForceSubjectMessage(?bool $force_subject_message) + public function setForceSubjectMessage($force_subject_message) { if (is_null($force_subject_message)) { - throw new InvalidArgumentException('non-nullable force_subject_message cannot be null'); + throw new \InvalidArgumentException('non-nullable force_subject_message cannot be null'); } $this->container['force_subject_message'] = $force_subject_message; @@ -791,10 +803,10 @@ public function getFormFieldGroups() * * @return self */ - public function setFormFieldGroups(?array $form_field_groups) + public function setFormFieldGroups($form_field_groups) { if (is_null($form_field_groups)) { - throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); + throw new \InvalidArgumentException('non-nullable form_field_groups cannot be null'); } $this->container['form_field_groups'] = $form_field_groups; @@ -814,14 +826,14 @@ public function getFormFieldRules() /** * Sets form_field_rules * - * @param SubFormFieldRule[]|null $form_field_rules conditional Logic rules for fields defined in `form_fields_per_document` + * @param SubFormFieldRule[]|null $form_field_rules Conditional Logic rules for fields defined in `form_fields_per_document`. * * @return self */ - public function setFormFieldRules(?array $form_field_rules) + public function setFormFieldRules($form_field_rules) { if (is_null($form_field_rules)) { - throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); + throw new \InvalidArgumentException('non-nullable form_field_rules cannot be null'); } $this->container['form_field_rules'] = $form_field_rules; @@ -845,10 +857,10 @@ public function getFormFieldsPerDocument() * * @return self */ - public function setFormFieldsPerDocument(?array $form_fields_per_document) + public function setFormFieldsPerDocument($form_fields_per_document) { if (is_null($form_fields_per_document)) { - throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + throw new \InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); } $this->container['form_fields_per_document'] = $form_fields_per_document; @@ -872,10 +884,10 @@ public function getMergeFields() * * @return self */ - public function setMergeFields(?array $merge_fields) + public function setMergeFields($merge_fields) { if (is_null($merge_fields)) { - throw new InvalidArgumentException('non-nullable merge_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable merge_fields cannot be null'); } $this->container['merge_fields'] = $merge_fields; @@ -895,17 +907,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message the default template email message + * @param string|null $message The default template email message. * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { - throw new InvalidArgumentException('non-nullable message cannot be null'); + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - if (mb_strlen($message) > 5000) { - throw new InvalidArgumentException('invalid length for $message when calling TemplateCreateEmbeddedDraftRequest., must be smaller than or equal to 5000.'); + if ((mb_strlen($message) > 5000)) { + throw new \InvalidArgumentException('invalid length for $message when calling TemplateCreateEmbeddedDraftRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -930,12 +942,13 @@ public function getMetadata() * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } + $this->container['metadata'] = $metadata; return $this; @@ -958,10 +971,10 @@ public function getShowPreview() * * @return self */ - public function setShowPreview(?bool $show_preview) + public function setShowPreview($show_preview) { if (is_null($show_preview)) { - throw new InvalidArgumentException('non-nullable show_preview cannot be null'); + throw new \InvalidArgumentException('non-nullable show_preview cannot be null'); } $this->container['show_preview'] = $show_preview; @@ -981,14 +994,14 @@ public function getShowProgressStepper() /** * Sets show_progress_stepper * - * @param bool|null $show_progress_stepper when only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden + * @param bool|null $show_progress_stepper When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * * @return self */ - public function setShowProgressStepper(?bool $show_progress_stepper) + public function setShowProgressStepper($show_progress_stepper) { if (is_null($show_progress_stepper)) { - throw new InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); + throw new \InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); } $this->container['show_progress_stepper'] = $show_progress_stepper; @@ -1008,14 +1021,14 @@ public function getSignerRoles() /** * Sets signer_roles * - * @param SubTemplateRole[]|null $signer_roles an array of the designated signer roles that must be specified when sending a SignatureRequest using this Template + * @param SubTemplateRole[]|null $signer_roles An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. * * @return self */ - public function setSignerRoles(?array $signer_roles) + public function setSignerRoles($signer_roles) { if (is_null($signer_roles)) { - throw new InvalidArgumentException('non-nullable signer_roles cannot be null'); + throw new \InvalidArgumentException('non-nullable signer_roles cannot be null'); } $this->container['signer_roles'] = $signer_roles; @@ -1039,10 +1052,10 @@ public function getSkipMeNow() * * @return self */ - public function setSkipMeNow(?bool $skip_me_now) + public function setSkipMeNow($skip_me_now) { if (is_null($skip_me_now)) { - throw new InvalidArgumentException('non-nullable skip_me_now cannot be null'); + throw new \InvalidArgumentException('non-nullable skip_me_now cannot be null'); } $this->container['skip_me_now'] = $skip_me_now; @@ -1062,17 +1075,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject the template title (alias) + * @param string|null $subject The template title (alias). * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { - throw new InvalidArgumentException('non-nullable subject cannot be null'); + throw new \InvalidArgumentException('non-nullable subject cannot be null'); } - if (mb_strlen($subject) > 200) { - throw new InvalidArgumentException('invalid length for $subject when calling TemplateCreateEmbeddedDraftRequest., must be smaller than or equal to 200.'); + if ((mb_strlen($subject) > 200)) { + throw new \InvalidArgumentException('invalid length for $subject when calling TemplateCreateEmbeddedDraftRequest., must be smaller than or equal to 200.'); } $this->container['subject'] = $subject; @@ -1097,10 +1110,10 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -1120,14 +1133,14 @@ public function getTitle() /** * Sets title * - * @param string|null $title the title you want to assign to the SignatureRequest + * @param string|null $title The title you want to assign to the SignatureRequest. * * @return self */ - public function setTitle(?string $title) + public function setTitle($title) { if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); + throw new \InvalidArgumentException('non-nullable title cannot be null'); } $this->container['title'] = $title; @@ -1147,26 +1160,27 @@ public function getUsePreexistingFields() /** * Sets use_preexisting_fields * - * @param bool|null $use_preexisting_fields enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`) + * @param bool|null $use_preexisting_fields Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). * * @return self */ - public function setUsePreexistingFields(?bool $use_preexisting_fields) + public function setUsePreexistingFields($use_preexisting_fields) { if (is_null($use_preexisting_fields)) { - throw new InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); } $this->container['use_preexisting_fields'] = $use_preexisting_fields; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1175,11 +1189,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1190,8 +1204,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1204,9 +1220,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1214,12 +1232,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1248,3 +1266,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponse.php b/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponse.php index 49266a669..7bdf706ac 100644 --- a/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponse.php +++ b/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponse.php @@ -1,11 +1,14 @@ */ -class TemplateCreateEmbeddedDraftResponse implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateCreateEmbeddedDraftResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateCreateEmbeddedDraftResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template' => '\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponseTemplate', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'template' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'template' => 'template', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'template' => 'setTemplate', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'template' => 'getTemplate', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('template', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateCreateEmbeddedDraftResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateCreateEmbeddedDraftResponse { /** @var TemplateCreateEmbeddedDraftResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateCreateEmbeddedDraftResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,6 +319,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets template * @@ -324,10 +337,10 @@ public function getTemplate() * * @return self */ - public function setTemplate(TemplateCreateEmbeddedDraftResponseTemplate $template) + public function setTemplate($template) { if (is_null($template)) { - throw new InvalidArgumentException('non-nullable template cannot be null'); + throw new \InvalidArgumentException('non-nullable template cannot be null'); } $this->container['template'] = $template; @@ -347,26 +360,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -375,11 +389,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,8 +404,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -404,9 +420,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -414,12 +432,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -448,3 +466,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponseTemplate.php b/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponseTemplate.php index 44031ce16..921ffe8fc 100644 --- a/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponseTemplate.php +++ b/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponseTemplate.php @@ -1,11 +1,14 @@ */ -class TemplateCreateEmbeddedDraftResponseTemplate implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateCreateEmbeddedDraftResponseTemplate implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateCreateEmbeddedDraftResponseTemplate'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template_id' => 'string', 'edit_url' => 'string', 'expires_at' => 'int', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template_id' => null, 'edit_url' => null, 'expires_at' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'template_id' => false, 'edit_url' => false, 'expires_at' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -119,6 +121,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -128,7 +132,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +142,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,6 +151,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -155,6 +162,9 @@ 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 { @@ -171,7 +181,7 @@ public function isNullableSetToNull(string $property): bool 'template_id' => 'template_id', 'edit_url' => 'edit_url', 'expires_at' => 'expires_at', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool 'template_id' => 'setTemplateId', 'edit_url' => 'setEditUrl', 'expires_at' => 'setExpiresAt', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -195,7 +205,7 @@ public function isNullableSetToNull(string $property): bool 'template_id' => 'getTemplateId', 'edit_url' => 'getEditUrl', 'expires_at' => 'getExpiresAt', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -239,6 +249,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -249,10 +260,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('template_id', $data ?? [], null); $this->setIfExists('edit_url', $data ?? [], null); @@ -260,33 +271,34 @@ public function __construct(array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateCreateEmbeddedDraftResponseTemplate { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateCreateEmbeddedDraftResponseTemplate { /** @var TemplateCreateEmbeddedDraftResponseTemplate */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateCreateEmbeddedDraftResponseTemplate::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -303,7 +315,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -317,6 +331,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets template_id * @@ -330,14 +345,14 @@ public function getTemplateId() /** * Sets template_id * - * @param string|null $template_id the id of the Template + * @param string|null $template_id The id of the Template. * * @return self */ - public function setTemplateId(?string $template_id) + public function setTemplateId($template_id) { if (is_null($template_id)) { - throw new InvalidArgumentException('non-nullable template_id cannot be null'); + throw new \InvalidArgumentException('non-nullable template_id cannot be null'); } $this->container['template_id'] = $template_id; @@ -357,14 +372,14 @@ public function getEditUrl() /** * Sets edit_url * - * @param string|null $edit_url link to edit the template + * @param string|null $edit_url Link to edit the template. * * @return self */ - public function setEditUrl(?string $edit_url) + public function setEditUrl($edit_url) { if (is_null($edit_url)) { - throw new InvalidArgumentException('non-nullable edit_url cannot be null'); + throw new \InvalidArgumentException('non-nullable edit_url cannot be null'); } $this->container['edit_url'] = $edit_url; @@ -384,14 +399,14 @@ public function getExpiresAt() /** * Sets expires_at * - * @param int|null $expires_at when the link expires + * @param int|null $expires_at When the link expires. * * @return self */ - public function setExpiresAt(?int $expires_at) + public function setExpiresAt($expires_at) { if (is_null($expires_at)) { - throw new InvalidArgumentException('non-nullable expires_at cannot be null'); + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); } $this->container['expires_at'] = $expires_at; @@ -412,27 +427,28 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self * @deprecated */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -441,11 +457,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -456,8 +472,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -470,9 +488,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -480,12 +500,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -514,3 +534,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateCreateRequest.php b/sdks/php/src/Model/TemplateCreateRequest.php index ec6890622..52142ce8a 100644 --- a/sdks/php/src/Model/TemplateCreateRequest.php +++ b/sdks/php/src/Model/TemplateCreateRequest.php @@ -1,11 +1,14 @@ */ -class TemplateCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateCreateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'form_fields_per_document' => '\Dropbox\Sign\Model\SubFormFieldsPerDocumentBase[]', 'signer_roles' => '\Dropbox\Sign\Model\SubTemplateRole[]', @@ -75,16 +76,16 @@ class TemplateCreateRequest implements ModelInterface, ArrayAccess, JsonSerializ 'subject' => 'string', 'test_mode' => 'bool', 'title' => 'string', - 'use_preexisting_fields' => 'bool', + 'use_preexisting_fields' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'form_fields_per_document' => null, 'signer_roles' => null, @@ -103,14 +104,14 @@ class TemplateCreateRequest implements ModelInterface, ArrayAccess, JsonSerializ 'subject' => null, 'test_mode' => null, 'title' => null, - 'use_preexisting_fields' => null, + 'use_preexisting_fields' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'form_fields_per_document' => false, 'signer_roles' => false, @@ -129,14 +130,14 @@ class TemplateCreateRequest implements ModelInterface, ArrayAccess, JsonSerializ 'subject' => false, 'test_mode' => false, 'title' => false, - 'use_preexisting_fields' => false, + 'use_preexisting_fields' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -161,6 +162,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -170,7 +173,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -180,7 +183,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -189,6 +192,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -197,6 +203,9 @@ 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 { @@ -227,7 +236,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'subject', 'test_mode' => 'test_mode', 'title' => 'title', - 'use_preexisting_fields' => 'use_preexisting_fields', + 'use_preexisting_fields' => 'use_preexisting_fields' ]; /** @@ -253,7 +262,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'setSubject', 'test_mode' => 'setTestMode', 'title' => 'setTitle', - 'use_preexisting_fields' => 'setUsePreexistingFields', + 'use_preexisting_fields' => 'setUsePreexistingFields' ]; /** @@ -279,7 +288,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'getSubject', 'test_mode' => 'getTestMode', 'title' => 'getTitle', - 'use_preexisting_fields' => 'getUsePreexistingFields', + 'use_preexisting_fields' => 'getUsePreexistingFields' ]; /** @@ -323,6 +332,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -333,10 +343,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('form_fields_per_document', $data ?? [], null); $this->setIfExists('signer_roles', $data ?? [], null); @@ -358,33 +368,34 @@ public function __construct(array $data = null) $this->setIfExists('use_preexisting_fields', $data ?? [], false); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateCreateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateCreateRequest { /** @var TemplateCreateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateCreateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -431,6 +442,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets form_fields_per_document * @@ -448,10 +460,10 @@ public function getFormFieldsPerDocument() * * @return self */ - public function setFormFieldsPerDocument(array $form_fields_per_document) + public function setFormFieldsPerDocument($form_fields_per_document) { if (is_null($form_fields_per_document)) { - throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + throw new \InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); } $this->container['form_fields_per_document'] = $form_fields_per_document; @@ -471,14 +483,14 @@ public function getSignerRoles() /** * Sets signer_roles * - * @param SubTemplateRole[] $signer_roles an array of the designated signer roles that must be specified when sending a SignatureRequest using this Template + * @param SubTemplateRole[] $signer_roles An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. * * @return self */ - public function setSignerRoles(array $signer_roles) + public function setSignerRoles($signer_roles) { if (is_null($signer_roles)) { - throw new InvalidArgumentException('non-nullable signer_roles cannot be null'); + throw new \InvalidArgumentException('non-nullable signer_roles cannot be null'); } $this->container['signer_roles'] = $signer_roles; @@ -488,7 +500,7 @@ public function setSignerRoles(array $signer_roles) /** * Gets files * - * @return SplFileObject[]|null + * @return \SplFileObject[]|null */ public function getFiles() { @@ -498,14 +510,14 @@ public function getFiles() /** * Sets files * - * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles(?array $files) + public function setFiles($files) { if (is_null($files)) { - throw new InvalidArgumentException('non-nullable files cannot be null'); + throw new \InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -529,10 +541,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls(?array $file_urls) + public function setFileUrls($file_urls) { if (is_null($file_urls)) { - throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -556,10 +568,10 @@ public function getAllowReassign() * * @return self */ - public function setAllowReassign(?bool $allow_reassign) + public function setAllowReassign($allow_reassign) { if (is_null($allow_reassign)) { - throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_reassign cannot be null'); } $this->container['allow_reassign'] = $allow_reassign; @@ -583,10 +595,10 @@ public function getAttachments() * * @return self */ - public function setAttachments(?array $attachments) + public function setAttachments($attachments) { if (is_null($attachments)) { - throw new InvalidArgumentException('non-nullable attachments cannot be null'); + throw new \InvalidArgumentException('non-nullable attachments cannot be null'); } $this->container['attachments'] = $attachments; @@ -610,10 +622,10 @@ public function getCcRoles() * * @return self */ - public function setCcRoles(?array $cc_roles) + public function setCcRoles($cc_roles) { if (is_null($cc_roles)) { - throw new InvalidArgumentException('non-nullable cc_roles cannot be null'); + throw new \InvalidArgumentException('non-nullable cc_roles cannot be null'); } $this->container['cc_roles'] = $cc_roles; @@ -637,10 +649,10 @@ public function getClientId() * * @return self */ - public function setClientId(?string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -664,10 +676,10 @@ public function getFieldOptions() * * @return self */ - public function setFieldOptions(?SubFieldOptions $field_options) + public function setFieldOptions($field_options) { if (is_null($field_options)) { - throw new InvalidArgumentException('non-nullable field_options cannot be null'); + throw new \InvalidArgumentException('non-nullable field_options cannot be null'); } $this->container['field_options'] = $field_options; @@ -691,10 +703,10 @@ public function getFormFieldGroups() * * @return self */ - public function setFormFieldGroups(?array $form_field_groups) + public function setFormFieldGroups($form_field_groups) { if (is_null($form_field_groups)) { - throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); + throw new \InvalidArgumentException('non-nullable form_field_groups cannot be null'); } $this->container['form_field_groups'] = $form_field_groups; @@ -714,14 +726,14 @@ public function getFormFieldRules() /** * Sets form_field_rules * - * @param SubFormFieldRule[]|null $form_field_rules conditional Logic rules for fields defined in `form_fields_per_document` + * @param SubFormFieldRule[]|null $form_field_rules Conditional Logic rules for fields defined in `form_fields_per_document`. * * @return self */ - public function setFormFieldRules(?array $form_field_rules) + public function setFormFieldRules($form_field_rules) { if (is_null($form_field_rules)) { - throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); + throw new \InvalidArgumentException('non-nullable form_field_rules cannot be null'); } $this->container['form_field_rules'] = $form_field_rules; @@ -745,10 +757,10 @@ public function getMergeFields() * * @return self */ - public function setMergeFields(?array $merge_fields) + public function setMergeFields($merge_fields) { if (is_null($merge_fields)) { - throw new InvalidArgumentException('non-nullable merge_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable merge_fields cannot be null'); } $this->container['merge_fields'] = $merge_fields; @@ -768,17 +780,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message the default template email message + * @param string|null $message The default template email message. * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { - throw new InvalidArgumentException('non-nullable message cannot be null'); + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - if (mb_strlen($message) > 5000) { - throw new InvalidArgumentException('invalid length for $message when calling TemplateCreateRequest., must be smaller than or equal to 5000.'); + if ((mb_strlen($message) > 5000)) { + throw new \InvalidArgumentException('invalid length for $message when calling TemplateCreateRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -803,12 +815,13 @@ public function getMetadata() * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } + $this->container['metadata'] = $metadata; return $this; @@ -827,17 +840,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject the template title (alias) + * @param string|null $subject The template title (alias). * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { - throw new InvalidArgumentException('non-nullable subject cannot be null'); + throw new \InvalidArgumentException('non-nullable subject cannot be null'); } - if (mb_strlen($subject) > 200) { - throw new InvalidArgumentException('invalid length for $subject when calling TemplateCreateRequest., must be smaller than or equal to 200.'); + if ((mb_strlen($subject) > 200)) { + throw new \InvalidArgumentException('invalid length for $subject when calling TemplateCreateRequest., must be smaller than or equal to 200.'); } $this->container['subject'] = $subject; @@ -862,10 +875,10 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -885,14 +898,14 @@ public function getTitle() /** * Sets title * - * @param string|null $title the title you want to assign to the SignatureRequest + * @param string|null $title The title you want to assign to the SignatureRequest. * * @return self */ - public function setTitle(?string $title) + public function setTitle($title) { if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); + throw new \InvalidArgumentException('non-nullable title cannot be null'); } $this->container['title'] = $title; @@ -912,26 +925,27 @@ public function getUsePreexistingFields() /** * Sets use_preexisting_fields * - * @param bool|null $use_preexisting_fields enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`) + * @param bool|null $use_preexisting_fields Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). * * @return self */ - public function setUsePreexistingFields(?bool $use_preexisting_fields) + public function setUsePreexistingFields($use_preexisting_fields) { if (is_null($use_preexisting_fields)) { - throw new InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); } $this->container['use_preexisting_fields'] = $use_preexisting_fields; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -940,11 +954,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -955,8 +969,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -969,9 +985,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -979,12 +997,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1013,3 +1031,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateCreateResponse.php b/sdks/php/src/Model/TemplateCreateResponse.php index e17ce910a..415e51eb0 100644 --- a/sdks/php/src/Model/TemplateCreateResponse.php +++ b/sdks/php/src/Model/TemplateCreateResponse.php @@ -1,11 +1,14 @@ */ -class TemplateCreateResponse implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateCreateResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateCreateResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template' => '\Dropbox\Sign\Model\TemplateCreateResponseTemplate', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'template' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'template' => 'template', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'template' => 'setTemplate', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'template' => 'getTemplate', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('template', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateCreateResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateCreateResponse { /** @var TemplateCreateResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateCreateResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,6 +319,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets template * @@ -324,10 +337,10 @@ public function getTemplate() * * @return self */ - public function setTemplate(TemplateCreateResponseTemplate $template) + public function setTemplate($template) { if (is_null($template)) { - throw new InvalidArgumentException('non-nullable template cannot be null'); + throw new \InvalidArgumentException('non-nullable template cannot be null'); } $this->container['template'] = $template; @@ -347,26 +360,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -375,11 +389,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,8 +404,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -404,9 +420,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -414,12 +432,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -448,3 +466,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateCreateResponseTemplate.php b/sdks/php/src/Model/TemplateCreateResponseTemplate.php index 199aa3f74..542415f53 100644 --- a/sdks/php/src/Model/TemplateCreateResponseTemplate.php +++ b/sdks/php/src/Model/TemplateCreateResponseTemplate.php @@ -1,11 +1,14 @@ */ -class TemplateCreateResponseTemplate implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateCreateResponseTemplate implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateCreateResponseTemplate'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'template_id' => 'string', + 'template_id' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'template_id' => null, + 'template_id' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'template_id' => false, + 'template_id' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,6 +112,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -119,7 +123,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -129,7 +133,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -138,6 +142,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -146,6 +153,9 @@ 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 { @@ -159,7 +169,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'template_id' => 'template_id', + 'template_id' => 'template_id' ]; /** @@ -168,7 +178,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'template_id' => 'setTemplateId', + 'template_id' => 'setTemplateId' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'template_id' => 'getTemplateId', + 'template_id' => 'getTemplateId' ]; /** @@ -221,6 +231,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -231,41 +242,42 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('template_id', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateCreateResponseTemplate { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateCreateResponseTemplate { /** @var TemplateCreateResponseTemplate */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateCreateResponseTemplate::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -282,7 +294,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -296,6 +310,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets template_id * @@ -309,26 +324,27 @@ public function getTemplateId() /** * Sets template_id * - * @param string|null $template_id the id of the Template + * @param string|null $template_id The id of the Template. * * @return self */ - public function setTemplateId(?string $template_id) + public function setTemplateId($template_id) { if (is_null($template_id)) { - throw new InvalidArgumentException('non-nullable template_id cannot be null'); + throw new \InvalidArgumentException('non-nullable template_id cannot be null'); } $this->container['template_id'] = $template_id; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -337,11 +353,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -352,8 +368,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -366,9 +384,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -376,12 +396,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -410,3 +430,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateEditResponse.php b/sdks/php/src/Model/TemplateEditResponse.php index 0ef5462cf..4874580eb 100644 --- a/sdks/php/src/Model/TemplateEditResponse.php +++ b/sdks/php/src/Model/TemplateEditResponse.php @@ -1,11 +1,14 @@ */ -class TemplateEditResponse implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateEditResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateEditResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'template_id' => 'string', + 'template_id' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'template_id' => null, + 'template_id' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'template_id' => false, + 'template_id' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -109,6 +111,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -118,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -128,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -137,6 +141,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -145,6 +152,9 @@ 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 { @@ -158,7 +168,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'template_id' => 'template_id', + 'template_id' => 'template_id' ]; /** @@ -167,7 +177,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'template_id' => 'setTemplateId', + 'template_id' => 'setTemplateId' ]; /** @@ -176,7 +186,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'template_id' => 'getTemplateId', + 'template_id' => 'getTemplateId' ]; /** @@ -220,6 +230,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -230,41 +241,42 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('template_id', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateEditResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateEditResponse { /** @var TemplateEditResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateEditResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -300,6 +312,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets template_id * @@ -313,26 +326,27 @@ public function getTemplateId() /** * Sets template_id * - * @param string $template_id the id of the Template + * @param string $template_id The id of the Template. * * @return self */ - public function setTemplateId(string $template_id) + public function setTemplateId($template_id) { if (is_null($template_id)) { - throw new InvalidArgumentException('non-nullable template_id cannot be null'); + throw new \InvalidArgumentException('non-nullable template_id cannot be null'); } $this->container['template_id'] = $template_id; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -341,11 +355,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -356,8 +370,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -370,9 +386,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -380,12 +398,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -414,3 +432,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateGetResponse.php b/sdks/php/src/Model/TemplateGetResponse.php index 45b89ba15..04c96d08e 100644 --- a/sdks/php/src/Model/TemplateGetResponse.php +++ b/sdks/php/src/Model/TemplateGetResponse.php @@ -1,11 +1,14 @@ */ -class TemplateGetResponse implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateGetResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateGetResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template' => '\Dropbox\Sign\Model\TemplateResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'template' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'template' => 'template', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'template' => 'setTemplate', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'template' => 'getTemplate', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('template', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateGetResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateGetResponse { /** @var TemplateGetResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateGetResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,6 +319,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets template * @@ -324,10 +337,10 @@ public function getTemplate() * * @return self */ - public function setTemplate(TemplateResponse $template) + public function setTemplate($template) { if (is_null($template)) { - throw new InvalidArgumentException('non-nullable template cannot be null'); + throw new \InvalidArgumentException('non-nullable template cannot be null'); } $this->container['template'] = $template; @@ -347,26 +360,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -375,11 +389,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,8 +404,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -404,9 +420,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -414,12 +432,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -448,3 +466,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateListResponse.php b/sdks/php/src/Model/TemplateListResponse.php index 49974663e..4c64ea3b2 100644 --- a/sdks/php/src/Model/TemplateListResponse.php +++ b/sdks/php/src/Model/TemplateListResponse.php @@ -1,11 +1,14 @@ */ -class TemplateListResponse implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateListResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateListResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'templates' => '\Dropbox\Sign\Model\TemplateResponse[]', 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'templates' => null, 'list_info' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'templates' => false, 'list_info' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,6 +117,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -124,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,6 +147,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -151,6 +158,9 @@ 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 { @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'templates' => 'templates', 'list_info' => 'list_info', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'templates' => 'setTemplates', 'list_info' => 'setListInfo', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -188,7 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'templates' => 'getTemplates', 'list_info' => 'getListInfo', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -232,6 +242,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -242,43 +253,44 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('templates', $data ?? [], null); $this->setIfExists('list_info', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateListResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateListResponse { /** @var TemplateListResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateListResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -317,6 +329,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets templates * @@ -330,14 +343,14 @@ public function getTemplates() /** * Sets templates * - * @param TemplateResponse[] $templates list of templates that the API caller has access to + * @param TemplateResponse[] $templates List of templates that the API caller has access to. * * @return self */ - public function setTemplates(array $templates) + public function setTemplates($templates) { if (is_null($templates)) { - throw new InvalidArgumentException('non-nullable templates cannot be null'); + throw new \InvalidArgumentException('non-nullable templates cannot be null'); } $this->container['templates'] = $templates; @@ -361,10 +374,10 @@ public function getListInfo() * * @return self */ - public function setListInfo(ListInfoResponse $list_info) + public function setListInfo($list_info) { if (is_null($list_info)) { - throw new InvalidArgumentException('non-nullable list_info cannot be null'); + throw new \InvalidArgumentException('non-nullable list_info cannot be null'); } $this->container['list_info'] = $list_info; @@ -384,26 +397,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -412,11 +426,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -427,8 +441,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -441,9 +457,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -451,12 +469,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -485,3 +503,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateRemoveUserRequest.php b/sdks/php/src/Model/TemplateRemoveUserRequest.php index d7a8582f9..116cf8d5f 100644 --- a/sdks/php/src/Model/TemplateRemoveUserRequest.php +++ b/sdks/php/src/Model/TemplateRemoveUserRequest.php @@ -1,11 +1,14 @@ */ -class TemplateRemoveUserRequest implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateRemoveUserRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateRemoveUserRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account_id' => 'string', - 'email_address' => 'string', + 'email_address' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account_id' => null, - 'email_address' => 'email', + 'email_address' => 'email' ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'account_id' => false, - 'email_address' => false, + 'email_address' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'account_id' => 'account_id', - 'email_address' => 'email_address', + 'email_address' => 'email_address' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'account_id' => 'setAccountId', - 'email_address' => 'setEmailAddress', + 'email_address' => 'setEmailAddress' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'account_id' => 'getAccountId', - 'email_address' => 'getEmailAddress', + 'email_address' => 'getEmailAddress' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('account_id', $data ?? [], null); $this->setIfExists('email_address', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateRemoveUserRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateRemoveUserRequest { /** @var TemplateRemoveUserRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateRemoveUserRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -288,7 +300,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -302,6 +316,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets account_id * @@ -319,10 +334,10 @@ public function getAccountId() * * @return self */ - public function setAccountId(?string $account_id) + public function setAccountId($account_id) { if (is_null($account_id)) { - throw new InvalidArgumentException('non-nullable account_id cannot be null'); + throw new \InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -346,22 +361,23 @@ public function getEmailAddress() * * @return self */ - public function setEmailAddress(?string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -370,11 +386,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -385,8 +401,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -399,9 +417,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -409,12 +429,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -443,3 +463,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponse.php b/sdks/php/src/Model/TemplateResponse.php index 6bc51cfb9..e6382e300 100644 --- a/sdks/php/src/Model/TemplateResponse.php +++ b/sdks/php/src/Model/TemplateResponse.php @@ -1,11 +1,14 @@ */ -class TemplateResponse implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template_id' => 'string', 'title' => 'string', @@ -73,16 +75,16 @@ class TemplateResponse implements ModelInterface, ArrayAccess, JsonSerializable 'custom_fields' => '\Dropbox\Sign\Model\TemplateResponseDocumentCustomFieldBase[]', 'named_form_fields' => '\Dropbox\Sign\Model\TemplateResponseDocumentFormFieldBase[]', 'accounts' => '\Dropbox\Sign\Model\TemplateResponseAccount[]', - 'attachments' => '\Dropbox\Sign\Model\SignatureRequestResponseAttachment[]', + 'attachments' => '\Dropbox\Sign\Model\SignatureRequestResponseAttachment[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template_id' => null, 'title' => null, @@ -99,14 +101,14 @@ class TemplateResponse implements ModelInterface, ArrayAccess, JsonSerializable 'custom_fields' => null, 'named_form_fields' => null, 'accounts' => null, - 'attachments' => null, + 'attachments' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'template_id' => false, 'title' => false, @@ -123,14 +125,14 @@ class TemplateResponse implements ModelInterface, ArrayAccess, JsonSerializable 'custom_fields' => true, 'named_form_fields' => true, 'accounts' => false, - 'attachments' => false, + 'attachments' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -155,6 +157,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -164,7 +168,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -174,7 +178,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -183,6 +187,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -191,6 +198,9 @@ 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 { @@ -219,7 +229,7 @@ public function isNullableSetToNull(string $property): bool 'custom_fields' => 'custom_fields', 'named_form_fields' => 'named_form_fields', 'accounts' => 'accounts', - 'attachments' => 'attachments', + 'attachments' => 'attachments' ]; /** @@ -243,7 +253,7 @@ public function isNullableSetToNull(string $property): bool 'custom_fields' => 'setCustomFields', 'named_form_fields' => 'setNamedFormFields', 'accounts' => 'setAccounts', - 'attachments' => 'setAttachments', + 'attachments' => 'setAttachments' ]; /** @@ -267,7 +277,7 @@ public function isNullableSetToNull(string $property): bool 'custom_fields' => 'getCustomFields', 'named_form_fields' => 'getNamedFormFields', 'accounts' => 'getAccounts', - 'attachments' => 'getAttachments', + 'attachments' => 'getAttachments' ]; /** @@ -311,6 +321,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -321,10 +332,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('template_id', $data ?? [], null); $this->setIfExists('title', $data ?? [], null); @@ -344,33 +355,34 @@ public function __construct(array $data = null) $this->setIfExists('attachments', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponse { /** @var TemplateResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -387,7 +399,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -401,6 +415,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets template_id * @@ -414,14 +429,14 @@ public function getTemplateId() /** * Sets template_id * - * @param string|null $template_id the id of the Template + * @param string|null $template_id The id of the Template. * * @return self */ - public function setTemplateId(?string $template_id) + public function setTemplateId($template_id) { if (is_null($template_id)) { - throw new InvalidArgumentException('non-nullable template_id cannot be null'); + throw new \InvalidArgumentException('non-nullable template_id cannot be null'); } $this->container['template_id'] = $template_id; @@ -445,10 +460,10 @@ public function getTitle() * * @return self */ - public function setTitle(?string $title) + public function setTitle($title) { if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); + throw new \InvalidArgumentException('non-nullable title cannot be null'); } $this->container['title'] = $title; @@ -472,10 +487,10 @@ public function getMessage() * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { - throw new InvalidArgumentException('non-nullable message cannot be null'); + throw new \InvalidArgumentException('non-nullable message cannot be null'); } $this->container['message'] = $message; @@ -495,14 +510,14 @@ public function getUpdatedAt() /** * Sets updated_at * - * @param int|null $updated_at time the template was last updated + * @param int|null $updated_at Time the template was last updated. * * @return self */ - public function setUpdatedAt(?int $updated_at) + public function setUpdatedAt($updated_at) { if (is_null($updated_at)) { - throw new InvalidArgumentException('non-nullable updated_at cannot be null'); + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); } $this->container['updated_at'] = $updated_at; @@ -526,13 +541,13 @@ public function getIsEmbedded() * * @return self */ - public function setIsEmbedded(?bool $is_embedded) + public function setIsEmbedded($is_embedded) { if (is_null($is_embedded)) { array_push($this->openAPINullablesSetToNull, 'is_embedded'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('is_embedded', $nullablesSetToNull); + $index = array_search('is_embedded', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -556,14 +571,14 @@ public function getIsCreator() /** * Sets is_creator * - * @param bool|null $is_creator `true` if you are the owner of this template, `false` if it's been shared with you by a team member + * @param bool|null $is_creator `true` if you are the owner of this template, `false` if it's been shared with you by a team member. * * @return self */ - public function setIsCreator(?bool $is_creator) + public function setIsCreator($is_creator) { if (is_null($is_creator)) { - throw new InvalidArgumentException('non-nullable is_creator cannot be null'); + throw new \InvalidArgumentException('non-nullable is_creator cannot be null'); } $this->container['is_creator'] = $is_creator; @@ -583,14 +598,14 @@ public function getCanEdit() /** * Sets can_edit * - * @param bool|null $can_edit indicates whether edit rights have been granted to you by the owner (always `true` if that's you) + * @param bool|null $can_edit Indicates whether edit rights have been granted to you by the owner (always `true` if that's you). * * @return self */ - public function setCanEdit(?bool $can_edit) + public function setCanEdit($can_edit) { if (is_null($can_edit)) { - throw new InvalidArgumentException('non-nullable can_edit cannot be null'); + throw new \InvalidArgumentException('non-nullable can_edit cannot be null'); } $this->container['can_edit'] = $can_edit; @@ -614,10 +629,10 @@ public function getIsLocked() * * @return self */ - public function setIsLocked(?bool $is_locked) + public function setIsLocked($is_locked) { if (is_null($is_locked)) { - throw new InvalidArgumentException('non-nullable is_locked cannot be null'); + throw new \InvalidArgumentException('non-nullable is_locked cannot be null'); } $this->container['is_locked'] = $is_locked; @@ -637,14 +652,14 @@ public function getMetadata() /** * Sets metadata * - * @param array|null $metadata the metadata attached to the template + * @param array|null $metadata The metadata attached to the template. * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } $this->container['metadata'] = $metadata; @@ -664,14 +679,14 @@ public function getSignerRoles() /** * Sets signer_roles * - * @param TemplateResponseSignerRole[]|null $signer_roles an array of the designated signer roles that must be specified when sending a SignatureRequest using this Template + * @param TemplateResponseSignerRole[]|null $signer_roles An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. * * @return self */ - public function setSignerRoles(?array $signer_roles) + public function setSignerRoles($signer_roles) { if (is_null($signer_roles)) { - throw new InvalidArgumentException('non-nullable signer_roles cannot be null'); + throw new \InvalidArgumentException('non-nullable signer_roles cannot be null'); } $this->container['signer_roles'] = $signer_roles; @@ -691,14 +706,14 @@ public function getCcRoles() /** * Sets cc_roles * - * @param TemplateResponseCCRole[]|null $cc_roles an array of the designated CC roles that must be specified when sending a SignatureRequest using this Template + * @param TemplateResponseCCRole[]|null $cc_roles An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. * * @return self */ - public function setCcRoles(?array $cc_roles) + public function setCcRoles($cc_roles) { if (is_null($cc_roles)) { - throw new InvalidArgumentException('non-nullable cc_roles cannot be null'); + throw new \InvalidArgumentException('non-nullable cc_roles cannot be null'); } $this->container['cc_roles'] = $cc_roles; @@ -722,10 +737,10 @@ public function getDocuments() * * @return self */ - public function setDocuments(?array $documents) + public function setDocuments($documents) { if (is_null($documents)) { - throw new InvalidArgumentException('non-nullable documents cannot be null'); + throw new \InvalidArgumentException('non-nullable documents cannot be null'); } $this->container['documents'] = $documents; @@ -751,13 +766,13 @@ public function getCustomFields() * @return self * @deprecated */ - public function setCustomFields(?array $custom_fields) + public function setCustomFields($custom_fields) { if (is_null($custom_fields)) { array_push($this->openAPINullablesSetToNull, 'custom_fields'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('custom_fields', $nullablesSetToNull); + $index = array_search('custom_fields', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -787,13 +802,13 @@ public function getNamedFormFields() * @return self * @deprecated */ - public function setNamedFormFields(?array $named_form_fields) + public function setNamedFormFields($named_form_fields) { if (is_null($named_form_fields)) { array_push($this->openAPINullablesSetToNull, 'named_form_fields'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('named_form_fields', $nullablesSetToNull); + $index = array_search('named_form_fields', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -817,14 +832,14 @@ public function getAccounts() /** * Sets accounts * - * @param TemplateResponseAccount[]|null $accounts an array of the Accounts that can use this Template + * @param TemplateResponseAccount[]|null $accounts An array of the Accounts that can use this Template. * * @return self */ - public function setAccounts(?array $accounts) + public function setAccounts($accounts) { if (is_null($accounts)) { - throw new InvalidArgumentException('non-nullable accounts cannot be null'); + throw new \InvalidArgumentException('non-nullable accounts cannot be null'); } $this->container['accounts'] = $accounts; @@ -844,26 +859,27 @@ public function getAttachments() /** * Sets attachments * - * @param SignatureRequestResponseAttachment[]|null $attachments signer attachments + * @param SignatureRequestResponseAttachment[]|null $attachments Signer attachments. * * @return self */ - public function setAttachments(?array $attachments) + public function setAttachments($attachments) { if (is_null($attachments)) { - throw new InvalidArgumentException('non-nullable attachments cannot be null'); + throw new \InvalidArgumentException('non-nullable attachments cannot be null'); } $this->container['attachments'] = $attachments; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -872,11 +888,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -887,8 +903,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -901,9 +919,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -911,12 +931,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -945,3 +965,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseAccount.php b/sdks/php/src/Model/TemplateResponseAccount.php index 47ddefabe..c3061cce1 100644 --- a/sdks/php/src/Model/TemplateResponseAccount.php +++ b/sdks/php/src/Model/TemplateResponseAccount.php @@ -1,11 +1,14 @@ */ -class TemplateResponseAccount implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateResponseAccount implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseAccount'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account_id' => 'string', 'email_address' => 'string', 'is_locked' => 'bool', 'is_paid_hs' => 'bool', 'is_paid_hf' => 'bool', - 'quotas' => '\Dropbox\Sign\Model\TemplateResponseAccountQuota', + 'quotas' => '\Dropbox\Sign\Model\TemplateResponseAccountQuota' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account_id' => null, 'email_address' => null, 'is_locked' => null, 'is_paid_hs' => null, 'is_paid_hf' => null, - 'quotas' => null, + 'quotas' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'account_id' => false, 'email_address' => false, 'is_locked' => false, 'is_paid_hs' => false, 'is_paid_hf' => false, - 'quotas' => false, + 'quotas' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -124,6 +126,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -133,7 +137,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -143,7 +147,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -152,6 +156,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -160,6 +167,9 @@ 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 { @@ -178,7 +188,7 @@ public function isNullableSetToNull(string $property): bool 'is_locked' => 'is_locked', 'is_paid_hs' => 'is_paid_hs', 'is_paid_hf' => 'is_paid_hf', - 'quotas' => 'quotas', + 'quotas' => 'quotas' ]; /** @@ -192,7 +202,7 @@ public function isNullableSetToNull(string $property): bool 'is_locked' => 'setIsLocked', 'is_paid_hs' => 'setIsPaidHs', 'is_paid_hf' => 'setIsPaidHf', - 'quotas' => 'setQuotas', + 'quotas' => 'setQuotas' ]; /** @@ -206,7 +216,7 @@ public function isNullableSetToNull(string $property): bool 'is_locked' => 'getIsLocked', 'is_paid_hs' => 'getIsPaidHs', 'is_paid_hf' => 'getIsPaidHf', - 'quotas' => 'getQuotas', + 'quotas' => 'getQuotas' ]; /** @@ -250,6 +260,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -260,10 +271,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('account_id', $data ?? [], null); $this->setIfExists('email_address', $data ?? [], null); @@ -273,33 +284,34 @@ public function __construct(array $data = null) $this->setIfExists('quotas', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseAccount { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseAccount { /** @var TemplateResponseAccount */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseAccount::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -316,7 +328,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -330,6 +344,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets account_id * @@ -343,14 +358,14 @@ public function getAccountId() /** * Sets account_id * - * @param string|null $account_id the id of the Account + * @param string|null $account_id The id of the Account. * * @return self */ - public function setAccountId(?string $account_id) + public function setAccountId($account_id) { if (is_null($account_id)) { - throw new InvalidArgumentException('non-nullable account_id cannot be null'); + throw new \InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -370,14 +385,14 @@ public function getEmailAddress() /** * Sets email_address * - * @param string|null $email_address the email address associated with the Account + * @param string|null $email_address The email address associated with the Account. * * @return self */ - public function setEmailAddress(?string $email_address) + public function setEmailAddress($email_address) { if (is_null($email_address)) { - throw new InvalidArgumentException('non-nullable email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -397,14 +412,14 @@ public function getIsLocked() /** * Sets is_locked * - * @param bool|null $is_locked returns `true` if the user has been locked out of their account by a team admin + * @param bool|null $is_locked Returns `true` if the user has been locked out of their account by a team admin. * * @return self */ - public function setIsLocked(?bool $is_locked) + public function setIsLocked($is_locked) { if (is_null($is_locked)) { - throw new InvalidArgumentException('non-nullable is_locked cannot be null'); + throw new \InvalidArgumentException('non-nullable is_locked cannot be null'); } $this->container['is_locked'] = $is_locked; @@ -424,14 +439,14 @@ public function getIsPaidHs() /** * Sets is_paid_hs * - * @param bool|null $is_paid_hs returns `true` if the user has a paid Dropbox Sign account + * @param bool|null $is_paid_hs Returns `true` if the user has a paid Dropbox Sign account. * * @return self */ - public function setIsPaidHs(?bool $is_paid_hs) + public function setIsPaidHs($is_paid_hs) { if (is_null($is_paid_hs)) { - throw new InvalidArgumentException('non-nullable is_paid_hs cannot be null'); + throw new \InvalidArgumentException('non-nullable is_paid_hs cannot be null'); } $this->container['is_paid_hs'] = $is_paid_hs; @@ -451,14 +466,14 @@ public function getIsPaidHf() /** * Sets is_paid_hf * - * @param bool|null $is_paid_hf returns `true` if the user has a paid HelloFax account + * @param bool|null $is_paid_hf Returns `true` if the user has a paid HelloFax account. * * @return self */ - public function setIsPaidHf(?bool $is_paid_hf) + public function setIsPaidHf($is_paid_hf) { if (is_null($is_paid_hf)) { - throw new InvalidArgumentException('non-nullable is_paid_hf cannot be null'); + throw new \InvalidArgumentException('non-nullable is_paid_hf cannot be null'); } $this->container['is_paid_hf'] = $is_paid_hf; @@ -482,22 +497,23 @@ public function getQuotas() * * @return self */ - public function setQuotas(?TemplateResponseAccountQuota $quotas) + public function setQuotas($quotas) { if (is_null($quotas)) { - throw new InvalidArgumentException('non-nullable quotas cannot be null'); + throw new \InvalidArgumentException('non-nullable quotas cannot be null'); } $this->container['quotas'] = $quotas; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -506,11 +522,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -521,8 +537,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -535,9 +553,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -545,12 +565,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -579,3 +599,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseAccountQuota.php b/sdks/php/src/Model/TemplateResponseAccountQuota.php index 46386d6ec..291aba3c6 100644 --- a/sdks/php/src/Model/TemplateResponseAccountQuota.php +++ b/sdks/php/src/Model/TemplateResponseAccountQuota.php @@ -1,11 +1,14 @@ */ -class TemplateResponseAccountQuota implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateResponseAccountQuota implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseAccountQuota'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'templates_left' => 'int', 'api_signature_requests_left' => 'int', 'documents_left' => 'int', - 'sms_verifications_left' => 'int', + 'sms_verifications_left' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'templates_left' => null, 'api_signature_requests_left' => null, 'documents_left' => null, - 'sms_verifications_left' => null, + 'sms_verifications_left' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'templates_left' => false, 'api_signature_requests_left' => false, 'documents_left' => false, - 'sms_verifications_left' => false, + 'sms_verifications_left' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -119,6 +121,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -128,7 +132,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +142,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,6 +151,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -155,6 +162,9 @@ 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 { @@ -171,7 +181,7 @@ public function isNullableSetToNull(string $property): bool 'templates_left' => 'templates_left', 'api_signature_requests_left' => 'api_signature_requests_left', 'documents_left' => 'documents_left', - 'sms_verifications_left' => 'sms_verifications_left', + 'sms_verifications_left' => 'sms_verifications_left' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool 'templates_left' => 'setTemplatesLeft', 'api_signature_requests_left' => 'setApiSignatureRequestsLeft', 'documents_left' => 'setDocumentsLeft', - 'sms_verifications_left' => 'setSmsVerificationsLeft', + 'sms_verifications_left' => 'setSmsVerificationsLeft' ]; /** @@ -195,7 +205,7 @@ public function isNullableSetToNull(string $property): bool 'templates_left' => 'getTemplatesLeft', 'api_signature_requests_left' => 'getApiSignatureRequestsLeft', 'documents_left' => 'getDocumentsLeft', - 'sms_verifications_left' => 'getSmsVerificationsLeft', + 'sms_verifications_left' => 'getSmsVerificationsLeft' ]; /** @@ -239,6 +249,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -249,10 +260,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('templates_left', $data ?? [], null); $this->setIfExists('api_signature_requests_left', $data ?? [], null); @@ -260,33 +271,34 @@ public function __construct(array $data = null) $this->setIfExists('sms_verifications_left', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseAccountQuota { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseAccountQuota { /** @var TemplateResponseAccountQuota */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseAccountQuota::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -303,7 +315,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -317,6 +331,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets templates_left * @@ -330,14 +345,14 @@ public function getTemplatesLeft() /** * Sets templates_left * - * @param int|null $templates_left API templates remaining + * @param int|null $templates_left API templates remaining. * * @return self */ - public function setTemplatesLeft(?int $templates_left) + public function setTemplatesLeft($templates_left) { if (is_null($templates_left)) { - throw new InvalidArgumentException('non-nullable templates_left cannot be null'); + throw new \InvalidArgumentException('non-nullable templates_left cannot be null'); } $this->container['templates_left'] = $templates_left; @@ -357,14 +372,14 @@ public function getApiSignatureRequestsLeft() /** * Sets api_signature_requests_left * - * @param int|null $api_signature_requests_left API signature requests remaining + * @param int|null $api_signature_requests_left API signature requests remaining. * * @return self */ - public function setApiSignatureRequestsLeft(?int $api_signature_requests_left) + public function setApiSignatureRequestsLeft($api_signature_requests_left) { if (is_null($api_signature_requests_left)) { - throw new InvalidArgumentException('non-nullable api_signature_requests_left cannot be null'); + throw new \InvalidArgumentException('non-nullable api_signature_requests_left cannot be null'); } $this->container['api_signature_requests_left'] = $api_signature_requests_left; @@ -384,14 +399,14 @@ public function getDocumentsLeft() /** * Sets documents_left * - * @param int|null $documents_left signature requests remaining + * @param int|null $documents_left Signature requests remaining. * * @return self */ - public function setDocumentsLeft(?int $documents_left) + public function setDocumentsLeft($documents_left) { if (is_null($documents_left)) { - throw new InvalidArgumentException('non-nullable documents_left cannot be null'); + throw new \InvalidArgumentException('non-nullable documents_left cannot be null'); } $this->container['documents_left'] = $documents_left; @@ -411,26 +426,27 @@ public function getSmsVerificationsLeft() /** * Sets sms_verifications_left * - * @param int|null $sms_verifications_left SMS verifications remaining + * @param int|null $sms_verifications_left SMS verifications remaining. * * @return self */ - public function setSmsVerificationsLeft(?int $sms_verifications_left) + public function setSmsVerificationsLeft($sms_verifications_left) { if (is_null($sms_verifications_left)) { - throw new InvalidArgumentException('non-nullable sms_verifications_left cannot be null'); + throw new \InvalidArgumentException('non-nullable sms_verifications_left cannot be null'); } $this->container['sms_verifications_left'] = $sms_verifications_left; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -439,11 +455,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -454,8 +470,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -468,9 +486,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -478,12 +498,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -512,3 +532,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseCCRole.php b/sdks/php/src/Model/TemplateResponseCCRole.php index 06ee33219..d1813c4dc 100644 --- a/sdks/php/src/Model/TemplateResponseCCRole.php +++ b/sdks/php/src/Model/TemplateResponseCCRole.php @@ -1,11 +1,14 @@ */ -class TemplateResponseCCRole implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateResponseCCRole implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseCCRole'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'name' => 'string', + 'name' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'name' => null, + 'name' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'name' => false, + 'name' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -109,6 +111,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -118,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -128,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -137,6 +141,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -145,6 +152,9 @@ 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 { @@ -158,7 +168,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'name' => 'name', + 'name' => 'name' ]; /** @@ -167,7 +177,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'name' => 'setName', + 'name' => 'setName' ]; /** @@ -176,7 +186,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'name' => 'getName', + 'name' => 'getName' ]; /** @@ -220,6 +230,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -230,41 +241,42 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseCCRole { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseCCRole { /** @var TemplateResponseCCRole */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseCCRole::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -281,7 +293,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -295,6 +309,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets name * @@ -308,26 +323,27 @@ public function getName() /** * Sets name * - * @param string|null $name the name of the Role + * @param string|null $name The name of the Role. * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -336,11 +352,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -351,8 +367,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -365,9 +383,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -375,12 +395,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -409,3 +429,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocument.php b/sdks/php/src/Model/TemplateResponseDocument.php index 02a88387d..32b46391d 100644 --- a/sdks/php/src/Model/TemplateResponseDocument.php +++ b/sdks/php/src/Model/TemplateResponseDocument.php @@ -1,11 +1,14 @@ */ -class TemplateResponseDocument implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateResponseDocument implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocument'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', 'index' => 'int', 'field_groups' => '\Dropbox\Sign\Model\TemplateResponseDocumentFieldGroup[]', 'form_fields' => '\Dropbox\Sign\Model\TemplateResponseDocumentFormFieldBase[]', 'custom_fields' => '\Dropbox\Sign\Model\TemplateResponseDocumentCustomFieldBase[]', - 'static_fields' => '\Dropbox\Sign\Model\TemplateResponseDocumentStaticFieldBase[]', + 'static_fields' => '\Dropbox\Sign\Model\TemplateResponseDocumentStaticFieldBase[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, 'index' => null, 'field_groups' => null, 'form_fields' => null, 'custom_fields' => null, - 'static_fields' => null, + 'static_fields' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'name' => false, 'index' => false, 'field_groups' => false, 'form_fields' => false, 'custom_fields' => false, - 'static_fields' => false, + 'static_fields' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -124,6 +126,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -133,7 +137,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -143,7 +147,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -152,6 +156,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -160,6 +167,9 @@ 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 { @@ -178,7 +188,7 @@ public function isNullableSetToNull(string $property): bool 'field_groups' => 'field_groups', 'form_fields' => 'form_fields', 'custom_fields' => 'custom_fields', - 'static_fields' => 'static_fields', + 'static_fields' => 'static_fields' ]; /** @@ -192,7 +202,7 @@ public function isNullableSetToNull(string $property): bool 'field_groups' => 'setFieldGroups', 'form_fields' => 'setFormFields', 'custom_fields' => 'setCustomFields', - 'static_fields' => 'setStaticFields', + 'static_fields' => 'setStaticFields' ]; /** @@ -206,7 +216,7 @@ public function isNullableSetToNull(string $property): bool 'field_groups' => 'getFieldGroups', 'form_fields' => 'getFormFields', 'custom_fields' => 'getCustomFields', - 'static_fields' => 'getStaticFields', + 'static_fields' => 'getStaticFields' ]; /** @@ -250,6 +260,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -260,10 +271,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('index', $data ?? [], null); @@ -273,33 +284,34 @@ public function __construct(array $data = null) $this->setIfExists('static_fields', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocument { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocument { /** @var TemplateResponseDocument */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocument::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -316,7 +328,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -330,6 +344,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets name * @@ -343,14 +358,14 @@ public function getName() /** * Sets name * - * @param string|null $name name of the associated file + * @param string|null $name Name of the associated file. * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -370,14 +385,14 @@ public function getIndex() /** * Sets index * - * @param int|null $index document ordering, the lowest index is displayed first and the highest last (0-based indexing) + * @param int|null $index Document ordering, the lowest index is displayed first and the highest last (0-based indexing). * * @return self */ - public function setIndex(?int $index) + public function setIndex($index) { if (is_null($index)) { - throw new InvalidArgumentException('non-nullable index cannot be null'); + throw new \InvalidArgumentException('non-nullable index cannot be null'); } $this->container['index'] = $index; @@ -397,14 +412,14 @@ public function getFieldGroups() /** * Sets field_groups * - * @param TemplateResponseDocumentFieldGroup[]|null $field_groups an array of Form Field Group objects + * @param TemplateResponseDocumentFieldGroup[]|null $field_groups An array of Form Field Group objects. * * @return self */ - public function setFieldGroups(?array $field_groups) + public function setFieldGroups($field_groups) { if (is_null($field_groups)) { - throw new InvalidArgumentException('non-nullable field_groups cannot be null'); + throw new \InvalidArgumentException('non-nullable field_groups cannot be null'); } $this->container['field_groups'] = $field_groups; @@ -424,14 +439,14 @@ public function getFormFields() /** * Sets form_fields * - * @param TemplateResponseDocumentFormFieldBase[]|null $form_fields an array of Form Field objects containing the name and type of each named field + * @param TemplateResponseDocumentFormFieldBase[]|null $form_fields An array of Form Field objects containing the name and type of each named field. * * @return self */ - public function setFormFields(?array $form_fields) + public function setFormFields($form_fields) { if (is_null($form_fields)) { - throw new InvalidArgumentException('non-nullable form_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable form_fields cannot be null'); } $this->container['form_fields'] = $form_fields; @@ -451,14 +466,14 @@ public function getCustomFields() /** * Sets custom_fields * - * @param TemplateResponseDocumentCustomFieldBase[]|null $custom_fields an array of Form Field objects containing the name and type of each named field + * @param TemplateResponseDocumentCustomFieldBase[]|null $custom_fields An array of Form Field objects containing the name and type of each named field. * * @return self */ - public function setCustomFields(?array $custom_fields) + public function setCustomFields($custom_fields) { if (is_null($custom_fields)) { - throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -482,22 +497,23 @@ public function getStaticFields() * * @return self */ - public function setStaticFields(?array $static_fields) + public function setStaticFields($static_fields) { if (is_null($static_fields)) { - throw new InvalidArgumentException('non-nullable static_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable static_fields cannot be null'); } $this->container['static_fields'] = $static_fields; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -506,11 +522,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -521,8 +537,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -535,9 +553,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -545,12 +565,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -579,3 +599,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentCustomFieldBase.php b/sdks/php/src/Model/TemplateResponseDocumentCustomFieldBase.php index 011502522..06772c49f 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentCustomFieldBase.php +++ b/sdks/php/src/Model/TemplateResponseDocumentCustomFieldBase.php @@ -1,11 +1,14 @@ */ -class TemplateResponseDocumentCustomFieldBase implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateResponseDocumentCustomFieldBase implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = 'type'; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentCustomFieldBase'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'api_id' => 'string', @@ -67,16 +69,16 @@ class TemplateResponseDocumentCustomFieldBase implements ModelInterface, ArrayAc 'width' => 'int', 'height' => 'int', 'required' => 'bool', - 'group' => 'string', + 'group' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'api_id' => null, @@ -87,14 +89,14 @@ class TemplateResponseDocumentCustomFieldBase implements ModelInterface, ArrayAc 'width' => null, 'height' => null, 'required' => null, - 'group' => null, + 'group' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, 'api_id' => false, @@ -105,14 +107,14 @@ class TemplateResponseDocumentCustomFieldBase implements ModelInterface, ArrayAc 'width' => false, 'height' => false, 'required' => false, - 'group' => true, + 'group' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -137,6 +139,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -146,7 +150,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -156,7 +160,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -165,6 +169,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -173,6 +180,9 @@ 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 { @@ -195,7 +205,7 @@ public function isNullableSetToNull(string $property): bool 'width' => 'width', 'height' => 'height', 'required' => 'required', - 'group' => 'group', + 'group' => 'group' ]; /** @@ -213,7 +223,7 @@ public function isNullableSetToNull(string $property): bool 'width' => 'setWidth', 'height' => 'setHeight', 'required' => 'setRequired', - 'group' => 'setGroup', + 'group' => 'setGroup' ]; /** @@ -231,7 +241,7 @@ public function isNullableSetToNull(string $property): bool 'width' => 'getWidth', 'height' => 'getHeight', 'required' => 'getRequired', - 'group' => 'getGroup', + 'group' => 'getGroup' ]; /** @@ -275,6 +285,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -285,10 +296,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('api_id', $data ?? [], null); @@ -305,6 +316,7 @@ public function __construct(array $data = null) $this->container['type'] = static::$openAPIModelName; } + public static function discriminatorClassName(array $data): ?string { if (!array_key_exists('type', $data)) { @@ -322,12 +334,14 @@ public static function discriminatorClassName(array $data): ?string } /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -363,6 +377,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -380,10 +395,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -403,14 +418,14 @@ public function getApiId() /** * Sets api_id * - * @param string|null $api_id the unique ID for this field + * @param string|null $api_id The unique ID for this field. * * @return self */ - public function setApiId(?string $api_id) + public function setApiId($api_id) { if (is_null($api_id)) { - throw new InvalidArgumentException('non-nullable api_id cannot be null'); + throw new \InvalidArgumentException('non-nullable api_id cannot be null'); } $this->container['api_id'] = $api_id; @@ -430,14 +445,14 @@ public function getName() /** * Sets name * - * @param string|null $name the name of the Custom Field + * @param string|null $name The name of the Custom Field. * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -461,13 +476,13 @@ public function getSigner() * * @return self */ - public function setSigner(?string $signer) + public function setSigner($signer) { if (is_null($signer)) { array_push($this->openAPINullablesSetToNull, 'signer'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signer', $nullablesSetToNull); + $index = array_search('signer', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -491,14 +506,14 @@ public function getX() /** * Sets x * - * @param int|null $x the horizontal offset in pixels for this form field + * @param int|null $x The horizontal offset in pixels for this form field. * * @return self */ - public function setX(?int $x) + public function setX($x) { if (is_null($x)) { - throw new InvalidArgumentException('non-nullable x cannot be null'); + throw new \InvalidArgumentException('non-nullable x cannot be null'); } $this->container['x'] = $x; @@ -518,14 +533,14 @@ public function getY() /** * Sets y * - * @param int|null $y the vertical offset in pixels for this form field + * @param int|null $y The vertical offset in pixels for this form field. * * @return self */ - public function setY(?int $y) + public function setY($y) { if (is_null($y)) { - throw new InvalidArgumentException('non-nullable y cannot be null'); + throw new \InvalidArgumentException('non-nullable y cannot be null'); } $this->container['y'] = $y; @@ -545,14 +560,14 @@ public function getWidth() /** * Sets width * - * @param int|null $width the width in pixels of this form field + * @param int|null $width The width in pixels of this form field. * * @return self */ - public function setWidth(?int $width) + public function setWidth($width) { if (is_null($width)) { - throw new InvalidArgumentException('non-nullable width cannot be null'); + throw new \InvalidArgumentException('non-nullable width cannot be null'); } $this->container['width'] = $width; @@ -572,14 +587,14 @@ public function getHeight() /** * Sets height * - * @param int|null $height the height in pixels of this form field + * @param int|null $height The height in pixels of this form field. * * @return self */ - public function setHeight(?int $height) + public function setHeight($height) { if (is_null($height)) { - throw new InvalidArgumentException('non-nullable height cannot be null'); + throw new \InvalidArgumentException('non-nullable height cannot be null'); } $this->container['height'] = $height; @@ -599,14 +614,14 @@ public function getRequired() /** * Sets required * - * @param bool|null $required boolean showing whether or not this field is required + * @param bool|null $required Boolean showing whether or not this field is required. * * @return self */ - public function setRequired(?bool $required) + public function setRequired($required) { if (is_null($required)) { - throw new InvalidArgumentException('non-nullable required cannot be null'); + throw new \InvalidArgumentException('non-nullable required cannot be null'); } $this->container['required'] = $required; @@ -630,13 +645,13 @@ public function getGroup() * * @return self */ - public function setGroup(?string $group) + public function setGroup($group) { if (is_null($group)) { array_push($this->openAPINullablesSetToNull, 'group'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('group', $nullablesSetToNull); + $index = array_search('group', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -646,13 +661,14 @@ public function setGroup(?string $group) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -661,11 +677,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -676,8 +692,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -690,9 +708,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -700,12 +720,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -734,3 +754,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentCustomFieldCheckbox.php b/sdks/php/src/Model/TemplateResponseDocumentCustomFieldCheckbox.php index 7ec8dc018..f54eceb0f 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentCustomFieldCheckbox.php +++ b/sdks/php/src/Model/TemplateResponseDocumentCustomFieldCheckbox.php @@ -1,11 +1,14 @@ */ class TemplateResponseDocumentCustomFieldCheckbox extends TemplateResponseDocumentCustomFieldBase @@ -44,46 +46,46 @@ class TemplateResponseDocumentCustomFieldCheckbox extends TemplateResponseDocume public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentCustomFieldCheckbox'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string', + 'type' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null, + 'type' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'type' => false, + 'type' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -108,6 +110,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -117,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -127,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -136,6 +140,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -144,6 +151,9 @@ 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 { @@ -157,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', + 'type' => 'type' ]; /** @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', + 'type' => 'setType' ]; /** @@ -175,7 +185,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', + 'type' => 'getType' ]; /** @@ -219,46 +229,49 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); $this->setIfExists('type', $data ?? [], 'checkbox'); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentCustomFieldCheckbox { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentCustomFieldCheckbox { /** @var TemplateResponseDocumentCustomFieldCheckbox */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentCustomFieldCheckbox::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,6 +307,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -311,22 +325,23 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -335,11 +350,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -350,8 +365,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -364,9 +381,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -374,12 +393,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -408,3 +427,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentCustomFieldText.php b/sdks/php/src/Model/TemplateResponseDocumentCustomFieldText.php index e63a73978..34bffbce8 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentCustomFieldText.php +++ b/sdks/php/src/Model/TemplateResponseDocumentCustomFieldText.php @@ -1,11 +1,14 @@ */ class TemplateResponseDocumentCustomFieldText extends TemplateResponseDocumentCustomFieldBase @@ -44,58 +46,58 @@ class TemplateResponseDocumentCustomFieldText extends TemplateResponseDocumentCu public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentCustomFieldText'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'avg_text_length' => '\Dropbox\Sign\Model\TemplateResponseFieldAvgTextLength', 'is_multiline' => 'bool', 'original_font_size' => 'int', - 'font_family' => 'string', + 'font_family' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'avg_text_length' => null, 'is_multiline' => null, 'original_font_size' => null, - 'font_family' => null, + 'font_family' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, 'avg_text_length' => false, 'is_multiline' => false, 'original_font_size' => false, - 'font_family' => false, + 'font_family' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -120,6 +122,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -129,7 +133,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -139,7 +143,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -148,6 +152,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -156,6 +163,9 @@ 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 { @@ -173,7 +183,7 @@ public function isNullableSetToNull(string $property): bool 'avg_text_length' => 'avg_text_length', 'is_multiline' => 'isMultiline', 'original_font_size' => 'originalFontSize', - 'font_family' => 'fontFamily', + 'font_family' => 'fontFamily' ]; /** @@ -186,7 +196,7 @@ public function isNullableSetToNull(string $property): bool 'avg_text_length' => 'setAvgTextLength', 'is_multiline' => 'setIsMultiline', 'original_font_size' => 'setOriginalFontSize', - 'font_family' => 'setFontFamily', + 'font_family' => 'setFontFamily' ]; /** @@ -199,7 +209,7 @@ public function isNullableSetToNull(string $property): bool 'avg_text_length' => 'getAvgTextLength', 'is_multiline' => 'getIsMultiline', 'original_font_size' => 'getOriginalFontSize', - 'font_family' => 'getFontFamily', + 'font_family' => 'getFontFamily' ]; /** @@ -243,13 +253,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -260,33 +272,34 @@ public function __construct(array $data = null) $this->setIfExists('font_family', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentCustomFieldText { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentCustomFieldText { /** @var TemplateResponseDocumentCustomFieldText */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentCustomFieldText::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -322,6 +335,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -339,10 +353,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -366,10 +380,10 @@ public function getAvgTextLength() * * @return self */ - public function setAvgTextLength(?TemplateResponseFieldAvgTextLength $avg_text_length) + public function setAvgTextLength($avg_text_length) { if (is_null($avg_text_length)) { - throw new InvalidArgumentException('non-nullable avg_text_length cannot be null'); + throw new \InvalidArgumentException('non-nullable avg_text_length cannot be null'); } $this->container['avg_text_length'] = $avg_text_length; @@ -389,14 +403,14 @@ public function getIsMultiline() /** * Sets is_multiline * - * @param bool|null $is_multiline whether this form field is multiline text + * @param bool|null $is_multiline Whether this form field is multiline text. * * @return self */ - public function setIsMultiline(?bool $is_multiline) + public function setIsMultiline($is_multiline) { if (is_null($is_multiline)) { - throw new InvalidArgumentException('non-nullable is_multiline cannot be null'); + throw new \InvalidArgumentException('non-nullable is_multiline cannot be null'); } $this->container['is_multiline'] = $is_multiline; @@ -416,14 +430,14 @@ public function getOriginalFontSize() /** * Sets original_font_size * - * @param int|null $original_font_size original font size used in this form field's text + * @param int|null $original_font_size Original font size used in this form field's text. * * @return self */ - public function setOriginalFontSize(?int $original_font_size) + public function setOriginalFontSize($original_font_size) { if (is_null($original_font_size)) { - throw new InvalidArgumentException('non-nullable original_font_size cannot be null'); + throw new \InvalidArgumentException('non-nullable original_font_size cannot be null'); } $this->container['original_font_size'] = $original_font_size; @@ -443,26 +457,27 @@ public function getFontFamily() /** * Sets font_family * - * @param string|null $font_family font family used in this form field's text + * @param string|null $font_family Font family used in this form field's text. * * @return self */ - public function setFontFamily(?string $font_family) + public function setFontFamily($font_family) { if (is_null($font_family)) { - throw new InvalidArgumentException('non-nullable font_family cannot be null'); + throw new \InvalidArgumentException('non-nullable font_family cannot be null'); } $this->container['font_family'] = $font_family; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -471,11 +486,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -486,8 +501,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -500,9 +517,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -510,12 +529,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -544,3 +563,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentFieldGroup.php b/sdks/php/src/Model/TemplateResponseDocumentFieldGroup.php index 541714841..5cac4e00b 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFieldGroup.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFieldGroup.php @@ -1,11 +1,14 @@ */ -class TemplateResponseDocumentFieldGroup implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateResponseDocumentFieldGroup implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFieldGroup'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', - 'rule' => '\Dropbox\Sign\Model\TemplateResponseDocumentFieldGroupRule', + 'rule' => '\Dropbox\Sign\Model\TemplateResponseDocumentFieldGroupRule' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, - 'rule' => null, + 'rule' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'name' => false, - 'rule' => false, + 'rule' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'name' => 'name', - 'rule' => 'rule', + 'rule' => 'rule' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'name' => 'setName', - 'rule' => 'setRule', + 'rule' => 'setRule' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'name' => 'getName', - 'rule' => 'getRule', + 'rule' => 'getRule' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('rule', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentFieldGroup { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentFieldGroup { /** @var TemplateResponseDocumentFieldGroup */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentFieldGroup::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -288,7 +300,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -302,6 +316,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets name * @@ -315,14 +330,14 @@ public function getName() /** * Sets name * - * @param string|null $name the name of the form field group + * @param string|null $name The name of the form field group. * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -346,22 +361,23 @@ public function getRule() * * @return self */ - public function setRule(?TemplateResponseDocumentFieldGroupRule $rule) + public function setRule($rule) { if (is_null($rule)) { - throw new InvalidArgumentException('non-nullable rule cannot be null'); + throw new \InvalidArgumentException('non-nullable rule cannot be null'); } $this->container['rule'] = $rule; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -370,11 +386,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -385,8 +401,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -399,9 +417,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -409,12 +429,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -443,3 +463,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentFieldGroupRule.php b/sdks/php/src/Model/TemplateResponseDocumentFieldGroupRule.php index 1bd31bde9..b2001def1 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFieldGroupRule.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFieldGroupRule.php @@ -1,11 +1,14 @@ */ -class TemplateResponseDocumentFieldGroupRule implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateResponseDocumentFieldGroupRule implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFieldGroupRule'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'requirement' => 'string', - 'group_label' => 'string', + 'group_label' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'requirement' => null, - 'group_label' => null, + 'group_label' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'requirement' => false, - 'group_label' => false, + 'group_label' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,6 +115,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -122,7 +126,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +136,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,6 +145,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -149,6 +156,9 @@ 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 { @@ -163,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'requirement' => 'requirement', - 'group_label' => 'groupLabel', + 'group_label' => 'groupLabel' ]; /** @@ -173,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'requirement' => 'setRequirement', - 'group_label' => 'setGroupLabel', + 'group_label' => 'setGroupLabel' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'requirement' => 'getRequirement', - 'group_label' => 'getGroupLabel', + 'group_label' => 'getGroupLabel' ]; /** @@ -227,6 +237,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -237,42 +248,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('requirement', $data ?? [], null); $this->setIfExists('group_label', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentFieldGroupRule { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentFieldGroupRule { /** @var TemplateResponseDocumentFieldGroupRule */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentFieldGroupRule::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -289,7 +301,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -303,6 +317,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets requirement * @@ -320,10 +335,10 @@ public function getRequirement() * * @return self */ - public function setRequirement(?string $requirement) + public function setRequirement($requirement) { if (is_null($requirement)) { - throw new InvalidArgumentException('non-nullable requirement cannot be null'); + throw new \InvalidArgumentException('non-nullable requirement cannot be null'); } $this->container['requirement'] = $requirement; @@ -347,22 +362,23 @@ public function getGroupLabel() * * @return self */ - public function setGroupLabel(?string $group_label) + public function setGroupLabel($group_label) { if (is_null($group_label)) { - throw new InvalidArgumentException('non-nullable group_label cannot be null'); + throw new \InvalidArgumentException('non-nullable group_label cannot be null'); } $this->container['group_label'] = $group_label; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -371,11 +387,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -386,8 +402,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -400,9 +418,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -410,12 +430,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -444,3 +464,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldBase.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldBase.php index ecc03a7db..877f84bdd 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldBase.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldBase.php @@ -1,11 +1,14 @@ */ -class TemplateResponseDocumentFormFieldBase implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateResponseDocumentFormFieldBase implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = 'type'; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFormFieldBase'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'api_id' => 'string', @@ -66,16 +68,16 @@ class TemplateResponseDocumentFormFieldBase implements ModelInterface, ArrayAcce 'y' => 'int', 'width' => 'int', 'height' => 'int', - 'required' => 'bool', + 'required' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'api_id' => null, @@ -85,14 +87,14 @@ class TemplateResponseDocumentFormFieldBase implements ModelInterface, ArrayAcce 'y' => null, 'width' => null, 'height' => null, - 'required' => null, + 'required' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, 'api_id' => false, @@ -102,14 +104,14 @@ class TemplateResponseDocumentFormFieldBase implements ModelInterface, ArrayAcce 'y' => false, 'width' => false, 'height' => false, - 'required' => false, + 'required' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -134,6 +136,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -143,7 +147,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -153,7 +157,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -162,6 +166,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -170,6 +177,9 @@ 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 { @@ -191,7 +201,7 @@ public function isNullableSetToNull(string $property): bool 'y' => 'y', 'width' => 'width', 'height' => 'height', - 'required' => 'required', + 'required' => 'required' ]; /** @@ -208,7 +218,7 @@ public function isNullableSetToNull(string $property): bool 'y' => 'setY', 'width' => 'setWidth', 'height' => 'setHeight', - 'required' => 'setRequired', + 'required' => 'setRequired' ]; /** @@ -225,7 +235,7 @@ public function isNullableSetToNull(string $property): bool 'y' => 'getY', 'width' => 'getWidth', 'height' => 'getHeight', - 'required' => 'getRequired', + 'required' => 'getRequired' ]; /** @@ -269,6 +279,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -279,10 +290,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('api_id', $data ?? [], null); @@ -298,6 +309,7 @@ public function __construct(array $data = null) $this->container['type'] = static::$openAPIModelName; } + public static function discriminatorClassName(array $data): ?string { if (!array_key_exists('type', $data)) { @@ -333,12 +345,14 @@ public static function discriminatorClassName(array $data): ?string } /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -374,6 +388,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -391,10 +406,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -414,14 +429,14 @@ public function getApiId() /** * Sets api_id * - * @param string|null $api_id a unique id for the form field + * @param string|null $api_id A unique id for the form field. * * @return self */ - public function setApiId(?string $api_id) + public function setApiId($api_id) { if (is_null($api_id)) { - throw new InvalidArgumentException('non-nullable api_id cannot be null'); + throw new \InvalidArgumentException('non-nullable api_id cannot be null'); } $this->container['api_id'] = $api_id; @@ -441,14 +456,14 @@ public function getName() /** * Sets name * - * @param string|null $name the name of the form field + * @param string|null $name The name of the form field. * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -468,14 +483,14 @@ public function getSigner() /** * Sets signer * - * @param string|null $signer the signer of the Form Field + * @param string|null $signer The signer of the Form Field. * * @return self */ - public function setSigner(?string $signer) + public function setSigner($signer) { if (is_null($signer)) { - throw new InvalidArgumentException('non-nullable signer cannot be null'); + throw new \InvalidArgumentException('non-nullable signer cannot be null'); } $this->container['signer'] = $signer; @@ -495,14 +510,14 @@ public function getX() /** * Sets x * - * @param int|null $x the horizontal offset in pixels for this form field + * @param int|null $x The horizontal offset in pixels for this form field. * * @return self */ - public function setX(?int $x) + public function setX($x) { if (is_null($x)) { - throw new InvalidArgumentException('non-nullable x cannot be null'); + throw new \InvalidArgumentException('non-nullable x cannot be null'); } $this->container['x'] = $x; @@ -522,14 +537,14 @@ public function getY() /** * Sets y * - * @param int|null $y the vertical offset in pixels for this form field + * @param int|null $y The vertical offset in pixels for this form field. * * @return self */ - public function setY(?int $y) + public function setY($y) { if (is_null($y)) { - throw new InvalidArgumentException('non-nullable y cannot be null'); + throw new \InvalidArgumentException('non-nullable y cannot be null'); } $this->container['y'] = $y; @@ -549,14 +564,14 @@ public function getWidth() /** * Sets width * - * @param int|null $width the width in pixels of this form field + * @param int|null $width The width in pixels of this form field. * * @return self */ - public function setWidth(?int $width) + public function setWidth($width) { if (is_null($width)) { - throw new InvalidArgumentException('non-nullable width cannot be null'); + throw new \InvalidArgumentException('non-nullable width cannot be null'); } $this->container['width'] = $width; @@ -576,14 +591,14 @@ public function getHeight() /** * Sets height * - * @param int|null $height the height in pixels of this form field + * @param int|null $height The height in pixels of this form field. * * @return self */ - public function setHeight(?int $height) + public function setHeight($height) { if (is_null($height)) { - throw new InvalidArgumentException('non-nullable height cannot be null'); + throw new \InvalidArgumentException('non-nullable height cannot be null'); } $this->container['height'] = $height; @@ -603,26 +618,27 @@ public function getRequired() /** * Sets required * - * @param bool|null $required boolean showing whether or not this field is required + * @param bool|null $required Boolean showing whether or not this field is required. * * @return self */ - public function setRequired(?bool $required) + public function setRequired($required) { if (is_null($required)) { - throw new InvalidArgumentException('non-nullable required cannot be null'); + throw new \InvalidArgumentException('non-nullable required cannot be null'); } $this->container['required'] = $required; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -631,11 +647,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -646,8 +662,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -660,9 +678,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -670,12 +690,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -704,3 +724,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldCheckbox.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldCheckbox.php index a30010fc1..59cd4a9f2 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldCheckbox.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldCheckbox.php @@ -1,11 +1,14 @@ */ class TemplateResponseDocumentFormFieldCheckbox extends TemplateResponseDocumentFormFieldBase @@ -44,49 +46,49 @@ class TemplateResponseDocumentFormFieldCheckbox extends TemplateResponseDocument public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFormFieldCheckbox'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'group' => 'string', + 'group' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'group' => null, + 'group' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, - 'group' => true, + 'group' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,6 +113,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -120,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -130,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -139,6 +143,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -147,6 +154,9 @@ 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 { @@ -161,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'group' => 'group', + 'group' => 'group' ]; /** @@ -171,7 +181,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'group' => 'setGroup', + 'group' => 'setGroup' ]; /** @@ -181,7 +191,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'group' => 'getGroup', + 'group' => 'getGroup' ]; /** @@ -225,13 +235,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -239,33 +251,34 @@ public function __construct(array $data = null) $this->setIfExists('group', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldCheckbox { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentFormFieldCheckbox { /** @var TemplateResponseDocumentFormFieldCheckbox */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldCheckbox::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -301,6 +314,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -318,10 +332,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -345,13 +359,13 @@ public function getGroup() * * @return self */ - public function setGroup(?string $group) + public function setGroup($group) { if (is_null($group)) { array_push($this->openAPINullablesSetToNull, 'group'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('group', $nullablesSetToNull); + $index = array_search('group', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -361,13 +375,14 @@ public function setGroup(?string $group) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -376,11 +391,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -391,8 +406,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -405,9 +422,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -415,12 +434,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -449,3 +468,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldDateSigned.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldDateSigned.php index bd6072350..d7f7a2dc4 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldDateSigned.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldDateSigned.php @@ -1,11 +1,14 @@ */ class TemplateResponseDocumentFormFieldDateSigned extends TemplateResponseDocumentFormFieldBase @@ -44,49 +46,49 @@ class TemplateResponseDocumentFormFieldDateSigned extends TemplateResponseDocume public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFormFieldDateSigned'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'group' => 'string', + 'group' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'group' => null, + 'group' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, - 'group' => true, + 'group' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,6 +113,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -120,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -130,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -139,6 +143,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -147,6 +154,9 @@ 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 { @@ -161,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'group' => 'group', + 'group' => 'group' ]; /** @@ -171,7 +181,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'group' => 'setGroup', + 'group' => 'setGroup' ]; /** @@ -181,7 +191,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'group' => 'getGroup', + 'group' => 'getGroup' ]; /** @@ -225,13 +235,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -239,33 +251,34 @@ public function __construct(array $data = null) $this->setIfExists('group', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldDateSigned { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentFormFieldDateSigned { /** @var TemplateResponseDocumentFormFieldDateSigned */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldDateSigned::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -301,6 +314,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -318,10 +332,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -345,13 +359,13 @@ public function getGroup() * * @return self */ - public function setGroup(?string $group) + public function setGroup($group) { if (is_null($group)) { array_push($this->openAPINullablesSetToNull, 'group'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('group', $nullablesSetToNull); + $index = array_search('group', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -361,13 +375,14 @@ public function setGroup(?string $group) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -376,11 +391,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -391,8 +406,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -405,9 +422,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -415,12 +434,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -449,3 +468,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldDropdown.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldDropdown.php index 3e4a827da..d9ed9a1d7 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldDropdown.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldDropdown.php @@ -1,11 +1,14 @@ */ class TemplateResponseDocumentFormFieldDropdown extends TemplateResponseDocumentFormFieldBase @@ -44,49 +46,49 @@ class TemplateResponseDocumentFormFieldDropdown extends TemplateResponseDocument public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFormFieldDropdown'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'group' => 'string', + 'group' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'group' => null, + 'group' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, - 'group' => true, + 'group' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,6 +113,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -120,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -130,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -139,6 +143,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -147,6 +154,9 @@ 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 { @@ -161,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'group' => 'group', + 'group' => 'group' ]; /** @@ -171,7 +181,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'group' => 'setGroup', + 'group' => 'setGroup' ]; /** @@ -181,7 +191,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'group' => 'getGroup', + 'group' => 'getGroup' ]; /** @@ -225,13 +235,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -239,33 +251,34 @@ public function __construct(array $data = null) $this->setIfExists('group', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldDropdown { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentFormFieldDropdown { /** @var TemplateResponseDocumentFormFieldDropdown */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldDropdown::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -301,6 +314,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -318,10 +332,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -345,13 +359,13 @@ public function getGroup() * * @return self */ - public function setGroup(?string $group) + public function setGroup($group) { if (is_null($group)) { array_push($this->openAPINullablesSetToNull, 'group'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('group', $nullablesSetToNull); + $index = array_search('group', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -361,13 +375,14 @@ public function setGroup(?string $group) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -376,11 +391,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -391,8 +406,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -405,9 +422,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -415,12 +434,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -449,3 +468,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldHyperlink.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldHyperlink.php index 687269f79..e69dc9b66 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldHyperlink.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldHyperlink.php @@ -1,11 +1,14 @@ */ class TemplateResponseDocumentFormFieldHyperlink extends TemplateResponseDocumentFormFieldBase @@ -44,61 +46,61 @@ class TemplateResponseDocumentFormFieldHyperlink extends TemplateResponseDocumen public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFormFieldHyperlink'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'avg_text_length' => '\Dropbox\Sign\Model\TemplateResponseFieldAvgTextLength', 'is_multiline' => 'bool', 'original_font_size' => 'int', 'font_family' => 'string', - 'group' => 'string', + 'group' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'avg_text_length' => null, 'is_multiline' => null, 'original_font_size' => null, 'font_family' => null, - 'group' => null, + 'group' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, 'avg_text_length' => false, 'is_multiline' => false, 'original_font_size' => false, 'font_family' => false, - 'group' => true, + 'group' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -123,6 +125,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -132,7 +136,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -142,7 +146,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -151,6 +155,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -159,6 +166,9 @@ 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 { @@ -177,7 +187,7 @@ public function isNullableSetToNull(string $property): bool 'is_multiline' => 'isMultiline', 'original_font_size' => 'originalFontSize', 'font_family' => 'fontFamily', - 'group' => 'group', + 'group' => 'group' ]; /** @@ -191,7 +201,7 @@ public function isNullableSetToNull(string $property): bool 'is_multiline' => 'setIsMultiline', 'original_font_size' => 'setOriginalFontSize', 'font_family' => 'setFontFamily', - 'group' => 'setGroup', + 'group' => 'setGroup' ]; /** @@ -205,7 +215,7 @@ public function isNullableSetToNull(string $property): bool 'is_multiline' => 'getIsMultiline', 'original_font_size' => 'getOriginalFontSize', 'font_family' => 'getFontFamily', - 'group' => 'getGroup', + 'group' => 'getGroup' ]; /** @@ -249,13 +259,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -267,33 +279,34 @@ public function __construct(array $data = null) $this->setIfExists('group', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldHyperlink { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentFormFieldHyperlink { /** @var TemplateResponseDocumentFormFieldHyperlink */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldHyperlink::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -329,6 +342,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -346,10 +360,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -373,10 +387,10 @@ public function getAvgTextLength() * * @return self */ - public function setAvgTextLength(?TemplateResponseFieldAvgTextLength $avg_text_length) + public function setAvgTextLength($avg_text_length) { if (is_null($avg_text_length)) { - throw new InvalidArgumentException('non-nullable avg_text_length cannot be null'); + throw new \InvalidArgumentException('non-nullable avg_text_length cannot be null'); } $this->container['avg_text_length'] = $avg_text_length; @@ -396,14 +410,14 @@ public function getIsMultiline() /** * Sets is_multiline * - * @param bool|null $is_multiline whether this form field is multiline text + * @param bool|null $is_multiline Whether this form field is multiline text. * * @return self */ - public function setIsMultiline(?bool $is_multiline) + public function setIsMultiline($is_multiline) { if (is_null($is_multiline)) { - throw new InvalidArgumentException('non-nullable is_multiline cannot be null'); + throw new \InvalidArgumentException('non-nullable is_multiline cannot be null'); } $this->container['is_multiline'] = $is_multiline; @@ -423,14 +437,14 @@ public function getOriginalFontSize() /** * Sets original_font_size * - * @param int|null $original_font_size original font size used in this form field's text + * @param int|null $original_font_size Original font size used in this form field's text. * * @return self */ - public function setOriginalFontSize(?int $original_font_size) + public function setOriginalFontSize($original_font_size) { if (is_null($original_font_size)) { - throw new InvalidArgumentException('non-nullable original_font_size cannot be null'); + throw new \InvalidArgumentException('non-nullable original_font_size cannot be null'); } $this->container['original_font_size'] = $original_font_size; @@ -450,14 +464,14 @@ public function getFontFamily() /** * Sets font_family * - * @param string|null $font_family font family used in this form field's text + * @param string|null $font_family Font family used in this form field's text. * * @return self */ - public function setFontFamily(?string $font_family) + public function setFontFamily($font_family) { if (is_null($font_family)) { - throw new InvalidArgumentException('non-nullable font_family cannot be null'); + throw new \InvalidArgumentException('non-nullable font_family cannot be null'); } $this->container['font_family'] = $font_family; @@ -481,13 +495,13 @@ public function getGroup() * * @return self */ - public function setGroup(?string $group) + public function setGroup($group) { if (is_null($group)) { array_push($this->openAPINullablesSetToNull, 'group'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('group', $nullablesSetToNull); + $index = array_search('group', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -497,13 +511,14 @@ public function setGroup(?string $group) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -512,11 +527,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -527,8 +542,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -541,9 +558,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -551,12 +570,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -585,3 +604,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldInitials.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldInitials.php index 101a6e955..6658108c4 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldInitials.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldInitials.php @@ -1,11 +1,14 @@ */ class TemplateResponseDocumentFormFieldInitials extends TemplateResponseDocumentFormFieldBase @@ -44,49 +46,49 @@ class TemplateResponseDocumentFormFieldInitials extends TemplateResponseDocument public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFormFieldInitials'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'group' => 'string', + 'group' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'group' => null, + 'group' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, - 'group' => true, + 'group' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,6 +113,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -120,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -130,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -139,6 +143,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -147,6 +154,9 @@ 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 { @@ -161,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'group' => 'group', + 'group' => 'group' ]; /** @@ -171,7 +181,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'group' => 'setGroup', + 'group' => 'setGroup' ]; /** @@ -181,7 +191,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'group' => 'getGroup', + 'group' => 'getGroup' ]; /** @@ -225,13 +235,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -239,33 +251,34 @@ public function __construct(array $data = null) $this->setIfExists('group', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldInitials { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentFormFieldInitials { /** @var TemplateResponseDocumentFormFieldInitials */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldInitials::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -301,6 +314,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -318,10 +332,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -345,13 +359,13 @@ public function getGroup() * * @return self */ - public function setGroup(?string $group) + public function setGroup($group) { if (is_null($group)) { array_push($this->openAPINullablesSetToNull, 'group'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('group', $nullablesSetToNull); + $index = array_search('group', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -361,13 +375,14 @@ public function setGroup(?string $group) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -376,11 +391,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -391,8 +406,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -405,9 +422,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -415,12 +434,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -449,3 +468,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldRadio.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldRadio.php index 8fd494678..873d0f328 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldRadio.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldRadio.php @@ -1,11 +1,14 @@ */ class TemplateResponseDocumentFormFieldRadio extends TemplateResponseDocumentFormFieldBase @@ -44,49 +46,49 @@ class TemplateResponseDocumentFormFieldRadio extends TemplateResponseDocumentFor public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFormFieldRadio'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'group' => 'string', + 'group' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'group' => null, + 'group' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, - 'group' => false, + 'group' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,6 +113,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -120,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -130,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -139,6 +143,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -147,6 +154,9 @@ 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 { @@ -161,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'group' => 'group', + 'group' => 'group' ]; /** @@ -171,7 +181,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'group' => 'setGroup', + 'group' => 'setGroup' ]; /** @@ -181,7 +191,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'group' => 'getGroup', + 'group' => 'getGroup' ]; /** @@ -225,13 +235,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -239,33 +251,34 @@ public function __construct(array $data = null) $this->setIfExists('group', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldRadio { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentFormFieldRadio { /** @var TemplateResponseDocumentFormFieldRadio */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldRadio::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -304,6 +317,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -321,10 +335,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -348,22 +362,23 @@ public function getGroup() * * @return self */ - public function setGroup(string $group) + public function setGroup($group) { if (is_null($group)) { - throw new InvalidArgumentException('non-nullable group cannot be null'); + throw new \InvalidArgumentException('non-nullable group cannot be null'); } $this->container['group'] = $group; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -372,11 +387,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -387,8 +402,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -401,9 +418,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -411,12 +430,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -445,3 +464,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldSignature.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldSignature.php index 777777464..9323e0dff 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldSignature.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldSignature.php @@ -1,11 +1,14 @@ */ class TemplateResponseDocumentFormFieldSignature extends TemplateResponseDocumentFormFieldBase @@ -44,49 +46,49 @@ class TemplateResponseDocumentFormFieldSignature extends TemplateResponseDocumen public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFormFieldSignature'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'group' => 'string', + 'group' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'group' => null, + 'group' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, - 'group' => true, + 'group' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,6 +113,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -120,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -130,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -139,6 +143,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -147,6 +154,9 @@ 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 { @@ -161,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'group' => 'group', + 'group' => 'group' ]; /** @@ -171,7 +181,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'group' => 'setGroup', + 'group' => 'setGroup' ]; /** @@ -181,7 +191,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'group' => 'getGroup', + 'group' => 'getGroup' ]; /** @@ -225,13 +235,15 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -239,33 +251,34 @@ public function __construct(array $data = null) $this->setIfExists('group', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldSignature { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentFormFieldSignature { /** @var TemplateResponseDocumentFormFieldSignature */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldSignature::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -301,6 +314,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -318,10 +332,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -345,13 +359,13 @@ public function getGroup() * * @return self */ - public function setGroup(?string $group) + public function setGroup($group) { if (is_null($group)) { array_push($this->openAPINullablesSetToNull, 'group'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('group', $nullablesSetToNull); + $index = array_search('group', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -361,13 +375,14 @@ public function setGroup(?string $group) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -376,11 +391,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -391,8 +406,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -405,9 +422,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -415,12 +434,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -449,3 +468,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldText.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldText.php index 42c15b9ed..f789baa78 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldText.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldText.php @@ -1,11 +1,14 @@ */ class TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentFormFieldBase @@ -44,17 +46,17 @@ class TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentForm public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFormFieldText'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'avg_text_length' => '\Dropbox\Sign\Model\TemplateResponseFieldAvgTextLength', @@ -62,16 +64,16 @@ class TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentForm 'original_font_size' => 'int', 'font_family' => 'string', 'validation_type' => 'string', - 'group' => 'string', + 'group' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'avg_text_length' => null, @@ -79,14 +81,14 @@ class TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentForm 'original_font_size' => null, 'font_family' => null, 'validation_type' => null, - 'group' => null, + 'group' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, 'avg_text_length' => false, @@ -94,14 +96,14 @@ class TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentForm 'original_font_size' => false, 'font_family' => false, 'validation_type' => true, - 'group' => true, + 'group' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -126,6 +128,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -135,7 +139,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -145,7 +149,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -154,6 +158,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -162,6 +169,9 @@ 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 { @@ -181,7 +191,7 @@ public function isNullableSetToNull(string $property): bool 'original_font_size' => 'originalFontSize', 'font_family' => 'fontFamily', 'validation_type' => 'validation_type', - 'group' => 'group', + 'group' => 'group' ]; /** @@ -196,7 +206,7 @@ public function isNullableSetToNull(string $property): bool 'original_font_size' => 'setOriginalFontSize', 'font_family' => 'setFontFamily', 'validation_type' => 'setValidationType', - 'group' => 'setGroup', + 'group' => 'setGroup' ]; /** @@ -211,7 +221,7 @@ public function isNullableSetToNull(string $property): bool 'original_font_size' => 'getOriginalFontSize', 'font_family' => 'getFontFamily', 'validation_type' => 'getValidationType', - 'group' => 'getGroup', + 'group' => 'getGroup' ]; /** @@ -287,13 +297,14 @@ public function getValidationTypeAllowableValues() ]; } + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); @@ -306,33 +317,34 @@ public function __construct(array $data = null) $this->setIfExists('group', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldText { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentFormFieldText { /** @var TemplateResponseDocumentFormFieldText */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldText::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -377,6 +389,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -394,10 +407,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -421,10 +434,10 @@ public function getAvgTextLength() * * @return self */ - public function setAvgTextLength(?TemplateResponseFieldAvgTextLength $avg_text_length) + public function setAvgTextLength($avg_text_length) { if (is_null($avg_text_length)) { - throw new InvalidArgumentException('non-nullable avg_text_length cannot be null'); + throw new \InvalidArgumentException('non-nullable avg_text_length cannot be null'); } $this->container['avg_text_length'] = $avg_text_length; @@ -444,14 +457,14 @@ public function getIsMultiline() /** * Sets is_multiline * - * @param bool|null $is_multiline whether this form field is multiline text + * @param bool|null $is_multiline Whether this form field is multiline text. * * @return self */ - public function setIsMultiline(?bool $is_multiline) + public function setIsMultiline($is_multiline) { if (is_null($is_multiline)) { - throw new InvalidArgumentException('non-nullable is_multiline cannot be null'); + throw new \InvalidArgumentException('non-nullable is_multiline cannot be null'); } $this->container['is_multiline'] = $is_multiline; @@ -471,14 +484,14 @@ public function getOriginalFontSize() /** * Sets original_font_size * - * @param int|null $original_font_size original font size used in this form field's text + * @param int|null $original_font_size Original font size used in this form field's text. * * @return self */ - public function setOriginalFontSize(?int $original_font_size) + public function setOriginalFontSize($original_font_size) { if (is_null($original_font_size)) { - throw new InvalidArgumentException('non-nullable original_font_size cannot be null'); + throw new \InvalidArgumentException('non-nullable original_font_size cannot be null'); } $this->container['original_font_size'] = $original_font_size; @@ -498,14 +511,14 @@ public function getFontFamily() /** * Sets font_family * - * @param string|null $font_family font family used in this form field's text + * @param string|null $font_family Font family used in this form field's text. * * @return self */ - public function setFontFamily(?string $font_family) + public function setFontFamily($font_family) { if (is_null($font_family)) { - throw new InvalidArgumentException('non-nullable font_family cannot be null'); + throw new \InvalidArgumentException('non-nullable font_family cannot be null'); } $this->container['font_family'] = $font_family; @@ -529,13 +542,13 @@ public function getValidationType() * * @return self */ - public function setValidationType(?string $validation_type) + public function setValidationType($validation_type) { if (is_null($validation_type)) { array_push($this->openAPINullablesSetToNull, 'validation_type'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('validation_type', $nullablesSetToNull); + $index = array_search('validation_type', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -543,7 +556,7 @@ public function setValidationType(?string $validation_type) } $allowedValues = $this->getValidationTypeAllowableValues(); if (!is_null($validation_type) && !in_array($validation_type, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'validation_type', must be one of '%s'", $validation_type, @@ -573,13 +586,13 @@ public function getGroup() * * @return self */ - public function setGroup(?string $group) + public function setGroup($group) { if (is_null($group)) { array_push($this->openAPINullablesSetToNull, 'group'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('group', $nullablesSetToNull); + $index = array_search('group', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -589,13 +602,14 @@ public function setGroup(?string $group) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -604,11 +618,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -619,8 +633,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -633,9 +649,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -643,12 +661,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -677,3 +695,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldBase.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldBase.php index bd18e1847..2aab358c2 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldBase.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldBase.php @@ -1,11 +1,14 @@ */ -class TemplateResponseDocumentStaticFieldBase implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateResponseDocumentStaticFieldBase implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = 'type'; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentStaticFieldBase'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'api_id' => 'string', @@ -67,16 +69,16 @@ class TemplateResponseDocumentStaticFieldBase implements ModelInterface, ArrayAc 'width' => 'int', 'height' => 'int', 'required' => 'bool', - 'group' => 'string', + 'group' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'api_id' => null, @@ -87,14 +89,14 @@ class TemplateResponseDocumentStaticFieldBase implements ModelInterface, ArrayAc 'width' => null, 'height' => null, 'required' => null, - 'group' => null, + 'group' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, 'api_id' => false, @@ -105,14 +107,14 @@ class TemplateResponseDocumentStaticFieldBase implements ModelInterface, ArrayAc 'width' => false, 'height' => false, 'required' => false, - 'group' => true, + 'group' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -137,6 +139,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -146,7 +150,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -156,7 +160,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -165,6 +169,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -173,6 +180,9 @@ 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 { @@ -195,7 +205,7 @@ public function isNullableSetToNull(string $property): bool 'width' => 'width', 'height' => 'height', 'required' => 'required', - 'group' => 'group', + 'group' => 'group' ]; /** @@ -213,7 +223,7 @@ public function isNullableSetToNull(string $property): bool 'width' => 'setWidth', 'height' => 'setHeight', 'required' => 'setRequired', - 'group' => 'setGroup', + 'group' => 'setGroup' ]; /** @@ -231,7 +241,7 @@ public function isNullableSetToNull(string $property): bool 'width' => 'getWidth', 'height' => 'getHeight', 'required' => 'getRequired', - 'group' => 'getGroup', + 'group' => 'getGroup' ]; /** @@ -275,6 +285,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -285,10 +296,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('api_id', $data ?? [], null); @@ -305,6 +316,7 @@ public function __construct(array $data = null) $this->container['type'] = static::$openAPIModelName; } + public static function discriminatorClassName(array $data): ?string { if (!array_key_exists('type', $data)) { @@ -340,12 +352,14 @@ public static function discriminatorClassName(array $data): ?string } /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -381,6 +395,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -398,10 +413,10 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -421,14 +436,14 @@ public function getApiId() /** * Sets api_id * - * @param string|null $api_id a unique id for the static field + * @param string|null $api_id A unique id for the static field. * * @return self */ - public function setApiId(?string $api_id) + public function setApiId($api_id) { if (is_null($api_id)) { - throw new InvalidArgumentException('non-nullable api_id cannot be null'); + throw new \InvalidArgumentException('non-nullable api_id cannot be null'); } $this->container['api_id'] = $api_id; @@ -448,14 +463,14 @@ public function getName() /** * Sets name * - * @param string|null $name the name of the static field + * @param string|null $name The name of the static field. * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -475,14 +490,14 @@ public function getSigner() /** * Sets signer * - * @param string|null $signer the signer of the Static Field + * @param string|null $signer The signer of the Static Field. * * @return self */ - public function setSigner(?string $signer) + public function setSigner($signer) { if (is_null($signer)) { - throw new InvalidArgumentException('non-nullable signer cannot be null'); + throw new \InvalidArgumentException('non-nullable signer cannot be null'); } $this->container['signer'] = $signer; @@ -502,14 +517,14 @@ public function getX() /** * Sets x * - * @param int|null $x the horizontal offset in pixels for this static field + * @param int|null $x The horizontal offset in pixels for this static field. * * @return self */ - public function setX(?int $x) + public function setX($x) { if (is_null($x)) { - throw new InvalidArgumentException('non-nullable x cannot be null'); + throw new \InvalidArgumentException('non-nullable x cannot be null'); } $this->container['x'] = $x; @@ -529,14 +544,14 @@ public function getY() /** * Sets y * - * @param int|null $y the vertical offset in pixels for this static field + * @param int|null $y The vertical offset in pixels for this static field. * * @return self */ - public function setY(?int $y) + public function setY($y) { if (is_null($y)) { - throw new InvalidArgumentException('non-nullable y cannot be null'); + throw new \InvalidArgumentException('non-nullable y cannot be null'); } $this->container['y'] = $y; @@ -556,14 +571,14 @@ public function getWidth() /** * Sets width * - * @param int|null $width the width in pixels of this static field + * @param int|null $width The width in pixels of this static field. * * @return self */ - public function setWidth(?int $width) + public function setWidth($width) { if (is_null($width)) { - throw new InvalidArgumentException('non-nullable width cannot be null'); + throw new \InvalidArgumentException('non-nullable width cannot be null'); } $this->container['width'] = $width; @@ -583,14 +598,14 @@ public function getHeight() /** * Sets height * - * @param int|null $height the height in pixels of this static field + * @param int|null $height The height in pixels of this static field. * * @return self */ - public function setHeight(?int $height) + public function setHeight($height) { if (is_null($height)) { - throw new InvalidArgumentException('non-nullable height cannot be null'); + throw new \InvalidArgumentException('non-nullable height cannot be null'); } $this->container['height'] = $height; @@ -610,14 +625,14 @@ public function getRequired() /** * Sets required * - * @param bool|null $required boolean showing whether or not this field is required + * @param bool|null $required Boolean showing whether or not this field is required. * * @return self */ - public function setRequired(?bool $required) + public function setRequired($required) { if (is_null($required)) { - throw new InvalidArgumentException('non-nullable required cannot be null'); + throw new \InvalidArgumentException('non-nullable required cannot be null'); } $this->container['required'] = $required; @@ -641,13 +656,13 @@ public function getGroup() * * @return self */ - public function setGroup(?string $group) + public function setGroup($group) { if (is_null($group)) { array_push($this->openAPINullablesSetToNull, 'group'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('group', $nullablesSetToNull); + $index = array_search('group', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -657,13 +672,14 @@ public function setGroup(?string $group) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -672,11 +688,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -687,8 +703,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -701,9 +719,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -711,12 +731,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -745,3 +765,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldCheckbox.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldCheckbox.php index 9739d2e05..972c67a11 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldCheckbox.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldCheckbox.php @@ -1,11 +1,14 @@ */ class TemplateResponseDocumentStaticFieldCheckbox extends TemplateResponseDocumentStaticFieldBase @@ -44,46 +46,46 @@ class TemplateResponseDocumentStaticFieldCheckbox extends TemplateResponseDocume public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentStaticFieldCheckbox'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string', + 'type' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null, + 'type' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'type' => false, + 'type' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -108,6 +110,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -117,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -127,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -136,6 +140,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -144,6 +151,9 @@ 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 { @@ -157,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', + 'type' => 'type' ]; /** @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', + 'type' => 'setType' ]; /** @@ -175,7 +185,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', + 'type' => 'getType' ]; /** @@ -219,46 +229,49 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); $this->setIfExists('type', $data ?? [], 'checkbox'); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldCheckbox { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentStaticFieldCheckbox { /** @var TemplateResponseDocumentStaticFieldCheckbox */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldCheckbox::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,6 +307,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -311,22 +325,23 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -335,11 +350,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -350,8 +365,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -364,9 +381,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -374,12 +393,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -408,3 +427,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDateSigned.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDateSigned.php index 911febf8d..1aba44059 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDateSigned.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDateSigned.php @@ -1,11 +1,14 @@ */ class TemplateResponseDocumentStaticFieldDateSigned extends TemplateResponseDocumentStaticFieldBase @@ -44,46 +46,46 @@ class TemplateResponseDocumentStaticFieldDateSigned extends TemplateResponseDocu public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentStaticFieldDateSigned'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string', + 'type' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null, + 'type' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'type' => false, + 'type' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -108,6 +110,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -117,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -127,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -136,6 +140,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -144,6 +151,9 @@ 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 { @@ -157,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', + 'type' => 'type' ]; /** @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', + 'type' => 'setType' ]; /** @@ -175,7 +185,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', + 'type' => 'getType' ]; /** @@ -219,46 +229,49 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); $this->setIfExists('type', $data ?? [], 'date_signed'); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldDateSigned { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentStaticFieldDateSigned { /** @var TemplateResponseDocumentStaticFieldDateSigned */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldDateSigned::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,6 +307,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -311,22 +325,23 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -335,11 +350,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -350,8 +365,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -364,9 +381,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -374,12 +393,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -408,3 +427,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDropdown.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDropdown.php index 6022f9289..e58467649 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDropdown.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDropdown.php @@ -1,11 +1,14 @@ */ class TemplateResponseDocumentStaticFieldDropdown extends TemplateResponseDocumentStaticFieldBase @@ -44,46 +46,46 @@ class TemplateResponseDocumentStaticFieldDropdown extends TemplateResponseDocume public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentStaticFieldDropdown'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string', + 'type' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null, + 'type' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'type' => false, + 'type' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -108,6 +110,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -117,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -127,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -136,6 +140,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -144,6 +151,9 @@ 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 { @@ -157,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', + 'type' => 'type' ]; /** @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', + 'type' => 'setType' ]; /** @@ -175,7 +185,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', + 'type' => 'getType' ]; /** @@ -219,46 +229,49 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); $this->setIfExists('type', $data ?? [], 'dropdown'); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldDropdown { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentStaticFieldDropdown { /** @var TemplateResponseDocumentStaticFieldDropdown */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldDropdown::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,6 +307,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -311,22 +325,23 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -335,11 +350,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -350,8 +365,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -364,9 +381,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -374,12 +393,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -408,3 +427,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldHyperlink.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldHyperlink.php index 246bea450..94c10d2f9 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldHyperlink.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldHyperlink.php @@ -1,11 +1,14 @@ */ class TemplateResponseDocumentStaticFieldHyperlink extends TemplateResponseDocumentStaticFieldBase @@ -44,46 +46,46 @@ class TemplateResponseDocumentStaticFieldHyperlink extends TemplateResponseDocum public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentStaticFieldHyperlink'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string', + 'type' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null, + 'type' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'type' => false, + 'type' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -108,6 +110,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -117,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -127,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -136,6 +140,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -144,6 +151,9 @@ 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 { @@ -157,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', + 'type' => 'type' ]; /** @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', + 'type' => 'setType' ]; /** @@ -175,7 +185,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', + 'type' => 'getType' ]; /** @@ -219,46 +229,49 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); $this->setIfExists('type', $data ?? [], 'hyperlink'); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldHyperlink { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentStaticFieldHyperlink { /** @var TemplateResponseDocumentStaticFieldHyperlink */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldHyperlink::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,6 +307,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -311,22 +325,23 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -335,11 +350,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -350,8 +365,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -364,9 +381,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -374,12 +393,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -408,3 +427,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldInitials.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldInitials.php index 339b3a2a5..88fb3e103 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldInitials.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldInitials.php @@ -1,11 +1,14 @@ */ class TemplateResponseDocumentStaticFieldInitials extends TemplateResponseDocumentStaticFieldBase @@ -44,46 +46,46 @@ class TemplateResponseDocumentStaticFieldInitials extends TemplateResponseDocume public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentStaticFieldInitials'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string', + 'type' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null, + 'type' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'type' => false, + 'type' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -108,6 +110,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -117,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -127,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -136,6 +140,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -144,6 +151,9 @@ 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 { @@ -157,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', + 'type' => 'type' ]; /** @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', + 'type' => 'setType' ]; /** @@ -175,7 +185,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', + 'type' => 'getType' ]; /** @@ -219,46 +229,49 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); $this->setIfExists('type', $data ?? [], 'initials'); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldInitials { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentStaticFieldInitials { /** @var TemplateResponseDocumentStaticFieldInitials */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldInitials::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,6 +307,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -311,22 +325,23 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -335,11 +350,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -350,8 +365,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -364,9 +381,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -374,12 +393,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -408,3 +427,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldRadio.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldRadio.php index 8dc139712..372620d66 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldRadio.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldRadio.php @@ -1,11 +1,14 @@ */ class TemplateResponseDocumentStaticFieldRadio extends TemplateResponseDocumentStaticFieldBase @@ -44,46 +46,46 @@ class TemplateResponseDocumentStaticFieldRadio extends TemplateResponseDocumentS public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentStaticFieldRadio'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string', + 'type' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null, + 'type' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'type' => false, + 'type' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -108,6 +110,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -117,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -127,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -136,6 +140,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -144,6 +151,9 @@ 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 { @@ -157,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', + 'type' => 'type' ]; /** @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', + 'type' => 'setType' ]; /** @@ -175,7 +185,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', + 'type' => 'getType' ]; /** @@ -219,46 +229,49 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); $this->setIfExists('type', $data ?? [], 'radio'); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldRadio { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentStaticFieldRadio { /** @var TemplateResponseDocumentStaticFieldRadio */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldRadio::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,6 +307,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -311,22 +325,23 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -335,11 +350,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -350,8 +365,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -364,9 +381,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -374,12 +393,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -408,3 +427,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldSignature.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldSignature.php index c86d1c9a3..bcfffe5bc 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldSignature.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldSignature.php @@ -1,11 +1,14 @@ */ class TemplateResponseDocumentStaticFieldSignature extends TemplateResponseDocumentStaticFieldBase @@ -44,46 +46,46 @@ class TemplateResponseDocumentStaticFieldSignature extends TemplateResponseDocum public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentStaticFieldSignature'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string', + 'type' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null, + 'type' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'type' => false, + 'type' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -108,6 +110,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -117,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -127,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -136,6 +140,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -144,6 +151,9 @@ 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 { @@ -157,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', + 'type' => 'type' ]; /** @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', + 'type' => 'setType' ]; /** @@ -175,7 +185,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', + 'type' => 'getType' ]; /** @@ -219,46 +229,49 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); $this->setIfExists('type', $data ?? [], 'signature'); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldSignature { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentStaticFieldSignature { /** @var TemplateResponseDocumentStaticFieldSignature */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldSignature::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,6 +307,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -311,22 +325,23 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -335,11 +350,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -350,8 +365,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -364,9 +381,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -374,12 +393,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -408,3 +427,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldText.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldText.php index ec89541e3..aaf93f541 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldText.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldText.php @@ -1,11 +1,14 @@ */ class TemplateResponseDocumentStaticFieldText extends TemplateResponseDocumentStaticFieldBase @@ -44,46 +46,46 @@ class TemplateResponseDocumentStaticFieldText extends TemplateResponseDocumentSt public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentStaticFieldText'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string', + 'type' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null, + 'type' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'type' => false, + 'type' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -108,6 +110,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -117,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -127,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -136,6 +140,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -144,6 +151,9 @@ 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 { @@ -157,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', + 'type' => 'type' ]; /** @@ -166,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', + 'type' => 'setType' ]; /** @@ -175,7 +185,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', + 'type' => 'getType' ]; /** @@ -219,46 +229,49 @@ public function getModelName() return self::$openAPIModelName; } + + /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { parent::__construct($data); $this->setIfExists('type', $data ?? [], 'text'); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldText { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseDocumentStaticFieldText { /** @var TemplateResponseDocumentStaticFieldText */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldText::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,6 +307,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -311,22 +325,23 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -335,11 +350,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -350,8 +365,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -364,9 +381,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -374,12 +393,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -408,3 +427,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseFieldAvgTextLength.php b/sdks/php/src/Model/TemplateResponseFieldAvgTextLength.php index 9277db26a..7940f49e4 100644 --- a/sdks/php/src/Model/TemplateResponseFieldAvgTextLength.php +++ b/sdks/php/src/Model/TemplateResponseFieldAvgTextLength.php @@ -1,11 +1,14 @@ */ -class TemplateResponseFieldAvgTextLength implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateResponseFieldAvgTextLength implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseFieldAvgTextLength'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'num_lines' => 'int', - 'num_chars_per_line' => 'int', + 'num_chars_per_line' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'num_lines' => null, - 'num_chars_per_line' => null, + 'num_chars_per_line' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'num_lines' => false, - 'num_chars_per_line' => false, + 'num_chars_per_line' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,6 +115,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -122,7 +126,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +136,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,6 +145,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -149,6 +156,9 @@ 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 { @@ -163,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'num_lines' => 'num_lines', - 'num_chars_per_line' => 'num_chars_per_line', + 'num_chars_per_line' => 'num_chars_per_line' ]; /** @@ -173,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'num_lines' => 'setNumLines', - 'num_chars_per_line' => 'setNumCharsPerLine', + 'num_chars_per_line' => 'setNumCharsPerLine' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'num_lines' => 'getNumLines', - 'num_chars_per_line' => 'getNumCharsPerLine', + 'num_chars_per_line' => 'getNumCharsPerLine' ]; /** @@ -227,6 +237,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -237,42 +248,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('num_lines', $data ?? [], null); $this->setIfExists('num_chars_per_line', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseFieldAvgTextLength { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseFieldAvgTextLength { /** @var TemplateResponseFieldAvgTextLength */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseFieldAvgTextLength::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -289,7 +301,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -303,6 +317,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets num_lines * @@ -316,14 +331,14 @@ public function getNumLines() /** * Sets num_lines * - * @param int|null $num_lines number of lines + * @param int|null $num_lines Number of lines. * * @return self */ - public function setNumLines(?int $num_lines) + public function setNumLines($num_lines) { if (is_null($num_lines)) { - throw new InvalidArgumentException('non-nullable num_lines cannot be null'); + throw new \InvalidArgumentException('non-nullable num_lines cannot be null'); } $this->container['num_lines'] = $num_lines; @@ -343,26 +358,27 @@ public function getNumCharsPerLine() /** * Sets num_chars_per_line * - * @param int|null $num_chars_per_line number of characters per line + * @param int|null $num_chars_per_line Number of characters per line. * * @return self */ - public function setNumCharsPerLine(?int $num_chars_per_line) + public function setNumCharsPerLine($num_chars_per_line) { if (is_null($num_chars_per_line)) { - throw new InvalidArgumentException('non-nullable num_chars_per_line cannot be null'); + throw new \InvalidArgumentException('non-nullable num_chars_per_line cannot be null'); } $this->container['num_chars_per_line'] = $num_chars_per_line; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -371,11 +387,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -386,8 +402,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -400,9 +418,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -410,12 +430,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -444,3 +464,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateResponseSignerRole.php b/sdks/php/src/Model/TemplateResponseSignerRole.php index 98a80c6e0..9f00c671e 100644 --- a/sdks/php/src/Model/TemplateResponseSignerRole.php +++ b/sdks/php/src/Model/TemplateResponseSignerRole.php @@ -1,11 +1,14 @@ */ -class TemplateResponseSignerRole implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateResponseSignerRole implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseSignerRole'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', - 'order' => 'int', + 'order' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, - 'order' => null, + 'order' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'name' => false, - 'order' => false, + 'order' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'name' => 'name', - 'order' => 'order', + 'order' => 'order' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'name' => 'setName', - 'order' => 'setOrder', + 'order' => 'setOrder' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'name' => 'getName', - 'order' => 'getOrder', + 'order' => 'getOrder' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('order', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateResponseSignerRole { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateResponseSignerRole { /** @var TemplateResponseSignerRole */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateResponseSignerRole::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -288,7 +300,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -302,6 +316,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets name * @@ -315,14 +330,14 @@ public function getName() /** * Sets name * - * @param string|null $name the name of the Role + * @param string|null $name The name of the Role. * * @return self */ - public function setName(?string $name) + public function setName($name) { if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -342,26 +357,27 @@ public function getOrder() /** * Sets order * - * @param int|null $order if signer order is assigned this is the 0-based index for this role + * @param int|null $order If signer order is assigned this is the 0-based index for this role. * * @return self */ - public function setOrder(?int $order) + public function setOrder($order) { if (is_null($order)) { - throw new InvalidArgumentException('non-nullable order cannot be null'); + throw new \InvalidArgumentException('non-nullable order cannot be null'); } $this->container['order'] = $order; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -370,11 +386,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -385,8 +401,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -399,9 +417,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -409,12 +429,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -443,3 +463,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateUpdateFilesRequest.php b/sdks/php/src/Model/TemplateUpdateFilesRequest.php index 7c165ff7d..6475a935a 100644 --- a/sdks/php/src/Model/TemplateUpdateFilesRequest.php +++ b/sdks/php/src/Model/TemplateUpdateFilesRequest.php @@ -1,11 +1,14 @@ */ -class TemplateUpdateFilesRequest implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateUpdateFilesRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateUpdateFilesRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'client_id' => 'string', 'files' => '\SplFileObject[]', 'file_urls' => 'string[]', 'message' => 'string', 'subject' => 'string', - 'test_mode' => 'bool', + 'test_mode' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'client_id' => null, 'files' => 'binary', 'file_urls' => null, 'message' => null, 'subject' => null, - 'test_mode' => null, + 'test_mode' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'client_id' => false, 'files' => false, 'file_urls' => false, 'message' => false, 'subject' => false, - 'test_mode' => false, + 'test_mode' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -125,6 +126,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -134,7 +137,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -144,7 +147,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -153,6 +156,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -161,6 +167,9 @@ 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 { @@ -179,7 +188,7 @@ public function isNullableSetToNull(string $property): bool 'file_urls' => 'file_urls', 'message' => 'message', 'subject' => 'subject', - 'test_mode' => 'test_mode', + 'test_mode' => 'test_mode' ]; /** @@ -193,7 +202,7 @@ public function isNullableSetToNull(string $property): bool 'file_urls' => 'setFileUrls', 'message' => 'setMessage', 'subject' => 'setSubject', - 'test_mode' => 'setTestMode', + 'test_mode' => 'setTestMode' ]; /** @@ -207,7 +216,7 @@ public function isNullableSetToNull(string $property): bool 'file_urls' => 'getFileUrls', 'message' => 'getMessage', 'subject' => 'getSubject', - 'test_mode' => 'getTestMode', + 'test_mode' => 'getTestMode' ]; /** @@ -251,6 +260,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -261,10 +271,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('client_id', $data ?? [], null); $this->setIfExists('files', $data ?? [], null); @@ -274,33 +284,34 @@ public function __construct(array $data = null) $this->setIfExists('test_mode', $data ?? [], false); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateUpdateFilesRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateUpdateFilesRequest { /** @var TemplateUpdateFilesRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateUpdateFilesRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -341,6 +352,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets client_id * @@ -354,14 +366,14 @@ public function getClientId() /** * Sets client_id * - * @param string|null $client_id client id of the app you're using to update this template + * @param string|null $client_id Client id of the app you're using to update this template. * * @return self */ - public function setClientId(?string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -371,7 +383,7 @@ public function setClientId(?string $client_id) /** * Gets files * - * @return SplFileObject[]|null + * @return \SplFileObject[]|null */ public function getFiles() { @@ -381,14 +393,14 @@ public function getFiles() /** * Sets files * - * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles(?array $files) + public function setFiles($files) { if (is_null($files)) { - throw new InvalidArgumentException('non-nullable files cannot be null'); + throw new \InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -412,10 +424,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls(?array $file_urls) + public function setFileUrls($file_urls) { if (is_null($file_urls)) { - throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -435,17 +447,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message the new default template email message + * @param string|null $message The new default template email message. * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { - throw new InvalidArgumentException('non-nullable message cannot be null'); + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - if (mb_strlen($message) > 5000) { - throw new InvalidArgumentException('invalid length for $message when calling TemplateUpdateFilesRequest., must be smaller than or equal to 5000.'); + if ((mb_strlen($message) > 5000)) { + throw new \InvalidArgumentException('invalid length for $message when calling TemplateUpdateFilesRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -466,17 +478,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject the new default template email subject + * @param string|null $subject The new default template email subject. * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { - throw new InvalidArgumentException('non-nullable subject cannot be null'); + throw new \InvalidArgumentException('non-nullable subject cannot be null'); } - if (mb_strlen($subject) > 100) { - throw new InvalidArgumentException('invalid length for $subject when calling TemplateUpdateFilesRequest., must be smaller than or equal to 100.'); + if ((mb_strlen($subject) > 100)) { + throw new \InvalidArgumentException('invalid length for $subject when calling TemplateUpdateFilesRequest., must be smaller than or equal to 100.'); } $this->container['subject'] = $subject; @@ -501,22 +513,23 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -525,11 +538,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -540,8 +553,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -554,9 +569,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -564,12 +581,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -598,3 +615,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateUpdateFilesResponse.php b/sdks/php/src/Model/TemplateUpdateFilesResponse.php index d8080fb74..5c0880af9 100644 --- a/sdks/php/src/Model/TemplateUpdateFilesResponse.php +++ b/sdks/php/src/Model/TemplateUpdateFilesResponse.php @@ -1,11 +1,14 @@ */ -class TemplateUpdateFilesResponse implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateUpdateFilesResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateUpdateFilesResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'template' => '\Dropbox\Sign\Model\TemplateUpdateFilesResponseTemplate', + 'template' => '\Dropbox\Sign\Model\TemplateUpdateFilesResponseTemplate' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'template' => null, + 'template' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ - 'template' => false, + 'template' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -109,6 +111,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -118,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -128,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -137,6 +141,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -145,6 +152,9 @@ 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 { @@ -158,7 +168,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'template' => 'template', + 'template' => 'template' ]; /** @@ -167,7 +177,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'template' => 'setTemplate', + 'template' => 'setTemplate' ]; /** @@ -176,7 +186,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'template' => 'getTemplate', + 'template' => 'getTemplate' ]; /** @@ -220,6 +230,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -230,41 +241,42 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('template', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateUpdateFilesResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateUpdateFilesResponse { /** @var TemplateUpdateFilesResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateUpdateFilesResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -300,6 +312,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets template * @@ -317,22 +330,23 @@ public function getTemplate() * * @return self */ - public function setTemplate(TemplateUpdateFilesResponseTemplate $template) + public function setTemplate($template) { if (is_null($template)) { - throw new InvalidArgumentException('non-nullable template cannot be null'); + throw new \InvalidArgumentException('non-nullable template cannot be null'); } $this->container['template'] = $template; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -341,11 +355,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -356,8 +370,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -370,9 +386,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -380,12 +398,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -414,3 +432,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/TemplateUpdateFilesResponseTemplate.php b/sdks/php/src/Model/TemplateUpdateFilesResponseTemplate.php index 70d2e87dc..09674407d 100644 --- a/sdks/php/src/Model/TemplateUpdateFilesResponseTemplate.php +++ b/sdks/php/src/Model/TemplateUpdateFilesResponseTemplate.php @@ -1,11 +1,14 @@ */ -class TemplateUpdateFilesResponseTemplate implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateUpdateFilesResponseTemplate implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateUpdateFilesResponseTemplate'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template_id' => 'string', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template_id' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'template_id' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,6 +115,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -122,7 +126,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +136,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,6 +145,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -149,6 +156,9 @@ 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 { @@ -163,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'template_id' => 'template_id', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -173,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'template_id' => 'setTemplateId', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'template_id' => 'getTemplateId', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -227,6 +237,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -237,42 +248,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('template_id', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): TemplateUpdateFilesResponseTemplate { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): TemplateUpdateFilesResponseTemplate { /** @var TemplateUpdateFilesResponseTemplate */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, TemplateUpdateFilesResponseTemplate::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -289,7 +301,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -303,6 +317,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets template_id * @@ -316,14 +331,14 @@ public function getTemplateId() /** * Sets template_id * - * @param string|null $template_id the id of the Template + * @param string|null $template_id The id of the Template. * * @return self */ - public function setTemplateId(?string $template_id) + public function setTemplateId($template_id) { if (is_null($template_id)) { - throw new InvalidArgumentException('non-nullable template_id cannot be null'); + throw new \InvalidArgumentException('non-nullable template_id cannot be null'); } $this->container['template_id'] = $template_id; @@ -344,27 +359,28 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self * @deprecated */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -373,11 +389,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -388,8 +404,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -402,9 +420,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -412,12 +432,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -446,3 +466,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedRequest.php b/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedRequest.php index 8d4a7e3e2..5176ef199 100644 --- a/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedRequest.php +++ b/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedRequest.php @@ -1,11 +1,14 @@ */ -class UnclaimedDraftCreateEmbeddedRequest implements ModelInterface, ArrayAccess, JsonSerializable +class UnclaimedDraftCreateEmbeddedRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'UnclaimedDraftCreateEmbeddedRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'client_id' => 'string', 'requester_email_address' => 'string', @@ -94,16 +95,16 @@ class UnclaimedDraftCreateEmbeddedRequest implements ModelInterface, ArrayAccess 'use_preexisting_fields' => 'bool', 'use_text_tags' => 'bool', 'populate_auto_fill_fields' => 'bool', - 'expires_at' => 'int', + 'expires_at' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'client_id' => null, 'requester_email_address' => 'email', @@ -140,14 +141,14 @@ class UnclaimedDraftCreateEmbeddedRequest implements ModelInterface, ArrayAccess 'use_preexisting_fields' => null, 'use_text_tags' => null, 'populate_auto_fill_fields' => null, - 'expires_at' => null, + 'expires_at' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'client_id' => false, 'requester_email_address' => false, @@ -184,14 +185,14 @@ class UnclaimedDraftCreateEmbeddedRequest implements ModelInterface, ArrayAccess 'use_preexisting_fields' => false, 'use_text_tags' => false, 'populate_auto_fill_fields' => false, - 'expires_at' => true, + 'expires_at' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -216,6 +217,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -225,7 +228,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -235,7 +238,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -244,6 +247,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -252,6 +258,9 @@ 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 { @@ -300,7 +309,7 @@ public function isNullableSetToNull(string $property): bool 'use_preexisting_fields' => 'use_preexisting_fields', 'use_text_tags' => 'use_text_tags', 'populate_auto_fill_fields' => 'populate_auto_fill_fields', - 'expires_at' => 'expires_at', + 'expires_at' => 'expires_at' ]; /** @@ -344,7 +353,7 @@ public function isNullableSetToNull(string $property): bool 'use_preexisting_fields' => 'setUsePreexistingFields', 'use_text_tags' => 'setUseTextTags', 'populate_auto_fill_fields' => 'setPopulateAutoFillFields', - 'expires_at' => 'setExpiresAt', + 'expires_at' => 'setExpiresAt' ]; /** @@ -388,7 +397,7 @@ public function isNullableSetToNull(string $property): bool 'use_preexisting_fields' => 'getUsePreexistingFields', 'use_text_tags' => 'getUseTextTags', 'populate_auto_fill_fields' => 'getPopulateAutoFillFields', - 'expires_at' => 'getExpiresAt', + 'expires_at' => 'getExpiresAt' ]; /** @@ -458,10 +467,10 @@ public function getTypeAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('client_id', $data ?? [], null); $this->setIfExists('requester_email_address', $data ?? [], null); @@ -501,33 +510,34 @@ public function __construct(array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): UnclaimedDraftCreateEmbeddedRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): UnclaimedDraftCreateEmbeddedRequest { /** @var UnclaimedDraftCreateEmbeddedRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, UnclaimedDraftCreateEmbeddedRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -583,6 +593,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets client_id * @@ -600,10 +611,10 @@ public function getClientId() * * @return self */ - public function setClientId(string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -623,14 +634,14 @@ public function getRequesterEmailAddress() /** * Sets requester_email_address * - * @param string $requester_email_address the email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature` + * @param string $requester_email_address The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. * * @return self */ - public function setRequesterEmailAddress(string $requester_email_address) + public function setRequesterEmailAddress($requester_email_address) { if (is_null($requester_email_address)) { - throw new InvalidArgumentException('non-nullable requester_email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable requester_email_address cannot be null'); } $this->container['requester_email_address'] = $requester_email_address; @@ -640,7 +651,7 @@ public function setRequesterEmailAddress(string $requester_email_address) /** * Gets files * - * @return SplFileObject[]|null + * @return \SplFileObject[]|null */ public function getFiles() { @@ -650,14 +661,14 @@ public function getFiles() /** * Sets files * - * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles(?array $files) + public function setFiles($files) { if (is_null($files)) { - throw new InvalidArgumentException('non-nullable files cannot be null'); + throw new \InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -681,10 +692,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls(?array $file_urls) + public function setFileUrls($file_urls) { if (is_null($file_urls)) { - throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -704,14 +715,14 @@ public function getAllowCcs() /** * Sets allow_ccs * - * @param bool|null $allow_ccs this allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft + * @param bool|null $allow_ccs This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. * * @return self */ - public function setAllowCcs(?bool $allow_ccs) + public function setAllowCcs($allow_ccs) { if (is_null($allow_ccs)) { - throw new InvalidArgumentException('non-nullable allow_ccs cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_ccs cannot be null'); } $this->container['allow_ccs'] = $allow_ccs; @@ -735,10 +746,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline(?bool $allow_decline) + public function setAllowDecline($allow_decline) { if (is_null($allow_decline)) { - throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -762,10 +773,10 @@ public function getAllowReassign() * * @return self */ - public function setAllowReassign(?bool $allow_reassign) + public function setAllowReassign($allow_reassign) { if (is_null($allow_reassign)) { - throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_reassign cannot be null'); } $this->container['allow_reassign'] = $allow_reassign; @@ -789,10 +800,10 @@ public function getAttachments() * * @return self */ - public function setAttachments(?array $attachments) + public function setAttachments($attachments) { if (is_null($attachments)) { - throw new InvalidArgumentException('non-nullable attachments cannot be null'); + throw new \InvalidArgumentException('non-nullable attachments cannot be null'); } $this->container['attachments'] = $attachments; @@ -812,14 +823,14 @@ public function getCcEmailAddresses() /** * Sets cc_email_addresses * - * @param string[]|null $cc_email_addresses the email addresses that should be CCed + * @param string[]|null $cc_email_addresses The email addresses that should be CCed. * * @return self */ - public function setCcEmailAddresses(?array $cc_email_addresses) + public function setCcEmailAddresses($cc_email_addresses) { if (is_null($cc_email_addresses)) { - throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + throw new \InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); } $this->container['cc_email_addresses'] = $cc_email_addresses; @@ -843,10 +854,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields(?array $custom_fields) + public function setCustomFields($custom_fields) { if (is_null($custom_fields)) { - throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -870,10 +881,10 @@ public function getEditorOptions() * * @return self */ - public function setEditorOptions(?SubEditorOptions $editor_options) + public function setEditorOptions($editor_options) { if (is_null($editor_options)) { - throw new InvalidArgumentException('non-nullable editor_options cannot be null'); + throw new \InvalidArgumentException('non-nullable editor_options cannot be null'); } $this->container['editor_options'] = $editor_options; @@ -897,10 +908,10 @@ public function getFieldOptions() * * @return self */ - public function setFieldOptions(?SubFieldOptions $field_options) + public function setFieldOptions($field_options) { if (is_null($field_options)) { - throw new InvalidArgumentException('non-nullable field_options cannot be null'); + throw new \InvalidArgumentException('non-nullable field_options cannot be null'); } $this->container['field_options'] = $field_options; @@ -920,14 +931,14 @@ public function getForceSignerPage() /** * Sets force_signer_page * - * @param bool|null $force_signer_page provide users the ability to review/edit the signers + * @param bool|null $force_signer_page Provide users the ability to review/edit the signers. * * @return self */ - public function setForceSignerPage(?bool $force_signer_page) + public function setForceSignerPage($force_signer_page) { if (is_null($force_signer_page)) { - throw new InvalidArgumentException('non-nullable force_signer_page cannot be null'); + throw new \InvalidArgumentException('non-nullable force_signer_page cannot be null'); } $this->container['force_signer_page'] = $force_signer_page; @@ -947,14 +958,14 @@ public function getForceSubjectMessage() /** * Sets force_subject_message * - * @param bool|null $force_subject_message provide users the ability to review/edit the subject and message + * @param bool|null $force_subject_message Provide users the ability to review/edit the subject and message. * * @return self */ - public function setForceSubjectMessage(?bool $force_subject_message) + public function setForceSubjectMessage($force_subject_message) { if (is_null($force_subject_message)) { - throw new InvalidArgumentException('non-nullable force_subject_message cannot be null'); + throw new \InvalidArgumentException('non-nullable force_subject_message cannot be null'); } $this->container['force_subject_message'] = $force_subject_message; @@ -978,10 +989,10 @@ public function getFormFieldGroups() * * @return self */ - public function setFormFieldGroups(?array $form_field_groups) + public function setFormFieldGroups($form_field_groups) { if (is_null($form_field_groups)) { - throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); + throw new \InvalidArgumentException('non-nullable form_field_groups cannot be null'); } $this->container['form_field_groups'] = $form_field_groups; @@ -1001,14 +1012,14 @@ public function getFormFieldRules() /** * Sets form_field_rules * - * @param SubFormFieldRule[]|null $form_field_rules conditional Logic rules for fields defined in `form_fields_per_document` + * @param SubFormFieldRule[]|null $form_field_rules Conditional Logic rules for fields defined in `form_fields_per_document`. * * @return self */ - public function setFormFieldRules(?array $form_field_rules) + public function setFormFieldRules($form_field_rules) { if (is_null($form_field_rules)) { - throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); + throw new \InvalidArgumentException('non-nullable form_field_rules cannot be null'); } $this->container['form_field_rules'] = $form_field_rules; @@ -1032,10 +1043,10 @@ public function getFormFieldsPerDocument() * * @return self */ - public function setFormFieldsPerDocument(?array $form_fields_per_document) + public function setFormFieldsPerDocument($form_fields_per_document) { if (is_null($form_fields_per_document)) { - throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + throw new \InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); } $this->container['form_fields_per_document'] = $form_fields_per_document; @@ -1059,10 +1070,10 @@ public function getHideTextTags() * * @return self */ - public function setHideTextTags(?bool $hide_text_tags) + public function setHideTextTags($hide_text_tags) { if (is_null($hide_text_tags)) { - throw new InvalidArgumentException('non-nullable hide_text_tags cannot be null'); + throw new \InvalidArgumentException('non-nullable hide_text_tags cannot be null'); } $this->container['hide_text_tags'] = $hide_text_tags; @@ -1086,10 +1097,10 @@ public function getHoldRequest() * * @return self */ - public function setHoldRequest(?bool $hold_request) + public function setHoldRequest($hold_request) { if (is_null($hold_request)) { - throw new InvalidArgumentException('non-nullable hold_request cannot be null'); + throw new \InvalidArgumentException('non-nullable hold_request cannot be null'); } $this->container['hold_request'] = $hold_request; @@ -1113,10 +1124,10 @@ public function getIsForEmbeddedSigning() * * @return self */ - public function setIsForEmbeddedSigning(?bool $is_for_embedded_signing) + public function setIsForEmbeddedSigning($is_for_embedded_signing) { if (is_null($is_for_embedded_signing)) { - throw new InvalidArgumentException('non-nullable is_for_embedded_signing cannot be null'); + throw new \InvalidArgumentException('non-nullable is_for_embedded_signing cannot be null'); } $this->container['is_for_embedded_signing'] = $is_for_embedded_signing; @@ -1136,17 +1147,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message the custom message in the email that will be sent to the signers + * @param string|null $message The custom message in the email that will be sent to the signers. * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { - throw new InvalidArgumentException('non-nullable message cannot be null'); + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - if (mb_strlen($message) > 5000) { - throw new InvalidArgumentException('invalid length for $message when calling UnclaimedDraftCreateEmbeddedRequest., must be smaller than or equal to 5000.'); + if ((mb_strlen($message) > 5000)) { + throw new \InvalidArgumentException('invalid length for $message when calling UnclaimedDraftCreateEmbeddedRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -1171,12 +1182,13 @@ public function getMetadata() * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } + $this->container['metadata'] = $metadata; return $this; @@ -1195,14 +1207,14 @@ public function getRequestingRedirectUrl() /** * Sets requesting_redirect_url * - * @param string|null $requesting_redirect_url the URL you want signers redirected to after they successfully request a signature + * @param string|null $requesting_redirect_url The URL you want signers redirected to after they successfully request a signature. * * @return self */ - public function setRequestingRedirectUrl(?string $requesting_redirect_url) + public function setRequestingRedirectUrl($requesting_redirect_url) { if (is_null($requesting_redirect_url)) { - throw new InvalidArgumentException('non-nullable requesting_redirect_url cannot be null'); + throw new \InvalidArgumentException('non-nullable requesting_redirect_url cannot be null'); } $this->container['requesting_redirect_url'] = $requesting_redirect_url; @@ -1226,10 +1238,10 @@ public function getShowPreview() * * @return self */ - public function setShowPreview(?bool $show_preview) + public function setShowPreview($show_preview) { if (is_null($show_preview)) { - throw new InvalidArgumentException('non-nullable show_preview cannot be null'); + throw new \InvalidArgumentException('non-nullable show_preview cannot be null'); } $this->container['show_preview'] = $show_preview; @@ -1249,14 +1261,14 @@ public function getShowProgressStepper() /** * Sets show_progress_stepper * - * @param bool|null $show_progress_stepper when only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden + * @param bool|null $show_progress_stepper When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * * @return self */ - public function setShowProgressStepper(?bool $show_progress_stepper) + public function setShowProgressStepper($show_progress_stepper) { if (is_null($show_progress_stepper)) { - throw new InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); + throw new \InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); } $this->container['show_progress_stepper'] = $show_progress_stepper; @@ -1276,14 +1288,14 @@ public function getSigners() /** * Sets signers * - * @param SubUnclaimedDraftSigner[]|null $signers add Signers to your Unclaimed Draft Signature Request + * @param SubUnclaimedDraftSigner[]|null $signers Add Signers to your Unclaimed Draft Signature Request. * * @return self */ - public function setSigners(?array $signers) + public function setSigners($signers) { if (is_null($signers)) { - throw new InvalidArgumentException('non-nullable signers cannot be null'); + throw new \InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -1307,10 +1319,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions(?SubSigningOptions $signing_options) + public function setSigningOptions($signing_options) { if (is_null($signing_options)) { - throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -1330,14 +1342,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign + * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. * * @return self */ - public function setSigningRedirectUrl(?string $signing_redirect_url) + public function setSigningRedirectUrl($signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -1361,10 +1373,10 @@ public function getSkipMeNow() * * @return self */ - public function setSkipMeNow(?bool $skip_me_now) + public function setSkipMeNow($skip_me_now) { if (is_null($skip_me_now)) { - throw new InvalidArgumentException('non-nullable skip_me_now cannot be null'); + throw new \InvalidArgumentException('non-nullable skip_me_now cannot be null'); } $this->container['skip_me_now'] = $skip_me_now; @@ -1384,17 +1396,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject the subject in the email that will be sent to the signers + * @param string|null $subject The subject in the email that will be sent to the signers. * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { - throw new InvalidArgumentException('non-nullable subject cannot be null'); + throw new \InvalidArgumentException('non-nullable subject cannot be null'); } - if (mb_strlen($subject) > 200) { - throw new InvalidArgumentException('invalid length for $subject when calling UnclaimedDraftCreateEmbeddedRequest., must be smaller than or equal to 200.'); + if ((mb_strlen($subject) > 200)) { + throw new \InvalidArgumentException('invalid length for $subject when calling UnclaimedDraftCreateEmbeddedRequest., must be smaller than or equal to 200.'); } $this->container['subject'] = $subject; @@ -1419,10 +1431,10 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -1446,14 +1458,14 @@ public function getType() * * @return self */ - public function setType(?string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'type', must be one of '%s'", $type, @@ -1483,10 +1495,10 @@ public function getUsePreexistingFields() * * @return self */ - public function setUsePreexistingFields(?bool $use_preexisting_fields) + public function setUsePreexistingFields($use_preexisting_fields) { if (is_null($use_preexisting_fields)) { - throw new InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); } $this->container['use_preexisting_fields'] = $use_preexisting_fields; @@ -1510,10 +1522,10 @@ public function getUseTextTags() * * @return self */ - public function setUseTextTags(?bool $use_text_tags) + public function setUseTextTags($use_text_tags) { if (is_null($use_text_tags)) { - throw new InvalidArgumentException('non-nullable use_text_tags cannot be null'); + throw new \InvalidArgumentException('non-nullable use_text_tags cannot be null'); } $this->container['use_text_tags'] = $use_text_tags; @@ -1537,10 +1549,10 @@ public function getPopulateAutoFillFields() * * @return self */ - public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) + public function setPopulateAutoFillFields($populate_auto_fill_fields) { if (is_null($populate_auto_fill_fields)) { - throw new InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); } $this->container['populate_auto_fill_fields'] = $populate_auto_fill_fields; @@ -1564,13 +1576,13 @@ public function getExpiresAt() * * @return self */ - public function setExpiresAt(?int $expires_at) + 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); + $index = array_search('expires_at', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1580,13 +1592,14 @@ public function setExpiresAt(?int $expires_at) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1595,11 +1608,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1610,8 +1623,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1624,9 +1639,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1634,12 +1651,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1668,3 +1685,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.php b/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.php index df0b1df69..265cfdde2 100644 --- a/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.php +++ b/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.php @@ -1,11 +1,14 @@ */ -class UnclaimedDraftCreateEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class UnclaimedDraftCreateEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'UnclaimedDraftCreateEmbeddedWithTemplateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'client_id' => 'string', 'requester_email_address' => 'string', @@ -87,16 +88,16 @@ class UnclaimedDraftCreateEmbeddedWithTemplateRequest implements ModelInterface, 'test_mode' => 'bool', 'title' => 'string', 'populate_auto_fill_fields' => 'bool', - 'allow_ccs' => 'bool', + 'allow_ccs' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'client_id' => null, 'requester_email_address' => 'email', @@ -127,14 +128,14 @@ class UnclaimedDraftCreateEmbeddedWithTemplateRequest implements ModelInterface, 'test_mode' => null, 'title' => null, 'populate_auto_fill_fields' => null, - 'allow_ccs' => null, + 'allow_ccs' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'client_id' => false, 'requester_email_address' => false, @@ -165,14 +166,14 @@ class UnclaimedDraftCreateEmbeddedWithTemplateRequest implements ModelInterface, 'test_mode' => false, 'title' => false, 'populate_auto_fill_fields' => false, - 'allow_ccs' => false, + 'allow_ccs' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -197,6 +198,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -206,7 +209,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -216,7 +219,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -225,6 +228,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -233,6 +239,9 @@ 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 { @@ -275,7 +284,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'test_mode', 'title' => 'title', 'populate_auto_fill_fields' => 'populate_auto_fill_fields', - 'allow_ccs' => 'allow_ccs', + 'allow_ccs' => 'allow_ccs' ]; /** @@ -313,7 +322,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'setTestMode', 'title' => 'setTitle', 'populate_auto_fill_fields' => 'setPopulateAutoFillFields', - 'allow_ccs' => 'setAllowCcs', + 'allow_ccs' => 'setAllowCcs' ]; /** @@ -351,7 +360,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'getTestMode', 'title' => 'getTitle', 'populate_auto_fill_fields' => 'getPopulateAutoFillFields', - 'allow_ccs' => 'getAllowCcs', + 'allow_ccs' => 'getAllowCcs' ]; /** @@ -395,6 +404,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -405,10 +415,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('client_id', $data ?? [], null); $this->setIfExists('requester_email_address', $data ?? [], null); @@ -442,33 +452,34 @@ public function __construct(array $data = null) $this->setIfExists('allow_ccs', $data ?? [], false); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): UnclaimedDraftCreateEmbeddedWithTemplateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): UnclaimedDraftCreateEmbeddedWithTemplateRequest { /** @var UnclaimedDraftCreateEmbeddedWithTemplateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, UnclaimedDraftCreateEmbeddedWithTemplateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -522,6 +533,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets client_id * @@ -539,10 +551,10 @@ public function getClientId() * * @return self */ - public function setClientId(string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -562,14 +574,14 @@ public function getRequesterEmailAddress() /** * Sets requester_email_address * - * @param string $requester_email_address the email address of the user that should be designated as the requester of this draft + * @param string $requester_email_address The email address of the user that should be designated as the requester of this draft. * * @return self */ - public function setRequesterEmailAddress(string $requester_email_address) + public function setRequesterEmailAddress($requester_email_address) { if (is_null($requester_email_address)) { - throw new InvalidArgumentException('non-nullable requester_email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable requester_email_address cannot be null'); } $this->container['requester_email_address'] = $requester_email_address; @@ -589,14 +601,14 @@ public function getTemplateIds() /** * Sets template_ids * - * @param string[] $template_ids use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used + * @param string[] $template_ids Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. * * @return self */ - public function setTemplateIds(array $template_ids) + public function setTemplateIds($template_ids) { if (is_null($template_ids)) { - throw new InvalidArgumentException('non-nullable template_ids cannot be null'); + throw new \InvalidArgumentException('non-nullable template_ids cannot be null'); } $this->container['template_ids'] = $template_ids; @@ -620,10 +632,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline(?bool $allow_decline) + public function setAllowDecline($allow_decline) { if (is_null($allow_decline)) { - throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -647,10 +659,10 @@ public function getAllowReassign() * * @return self */ - public function setAllowReassign(?bool $allow_reassign) + public function setAllowReassign($allow_reassign) { if (is_null($allow_reassign)) { - throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_reassign cannot be null'); } $this->container['allow_reassign'] = $allow_reassign; @@ -674,10 +686,10 @@ public function getCcs() * * @return self */ - public function setCcs(?array $ccs) + public function setCcs($ccs) { if (is_null($ccs)) { - throw new InvalidArgumentException('non-nullable ccs cannot be null'); + throw new \InvalidArgumentException('non-nullable ccs cannot be null'); } $this->container['ccs'] = $ccs; @@ -701,10 +713,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields(?array $custom_fields) + public function setCustomFields($custom_fields) { if (is_null($custom_fields)) { - throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -728,10 +740,10 @@ public function getEditorOptions() * * @return self */ - public function setEditorOptions(?SubEditorOptions $editor_options) + public function setEditorOptions($editor_options) { if (is_null($editor_options)) { - throw new InvalidArgumentException('non-nullable editor_options cannot be null'); + throw new \InvalidArgumentException('non-nullable editor_options cannot be null'); } $this->container['editor_options'] = $editor_options; @@ -755,10 +767,10 @@ public function getFieldOptions() * * @return self */ - public function setFieldOptions(?SubFieldOptions $field_options) + public function setFieldOptions($field_options) { if (is_null($field_options)) { - throw new InvalidArgumentException('non-nullable field_options cannot be null'); + throw new \InvalidArgumentException('non-nullable field_options cannot be null'); } $this->container['field_options'] = $field_options; @@ -768,7 +780,7 @@ public function setFieldOptions(?SubFieldOptions $field_options) /** * Gets files * - * @return SplFileObject[]|null + * @return \SplFileObject[]|null */ public function getFiles() { @@ -778,14 +790,14 @@ public function getFiles() /** * Sets files * - * @param SplFileObject[]|null $files Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both. + * @param \SplFileObject[]|null $files Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both. * * @return self */ - public function setFiles(?array $files) + public function setFiles($files) { if (is_null($files)) { - throw new InvalidArgumentException('non-nullable files cannot be null'); + throw new \InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -809,10 +821,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls(?array $file_urls) + public function setFileUrls($file_urls) { if (is_null($file_urls)) { - throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -832,14 +844,14 @@ public function getForceSignerRoles() /** * Sets force_signer_roles * - * @param bool|null $force_signer_roles provide users the ability to review/edit the template signer roles + * @param bool|null $force_signer_roles Provide users the ability to review/edit the template signer roles. * * @return self */ - public function setForceSignerRoles(?bool $force_signer_roles) + public function setForceSignerRoles($force_signer_roles) { if (is_null($force_signer_roles)) { - throw new InvalidArgumentException('non-nullable force_signer_roles cannot be null'); + throw new \InvalidArgumentException('non-nullable force_signer_roles cannot be null'); } $this->container['force_signer_roles'] = $force_signer_roles; @@ -859,14 +871,14 @@ public function getForceSubjectMessage() /** * Sets force_subject_message * - * @param bool|null $force_subject_message provide users the ability to review/edit the template subject and message + * @param bool|null $force_subject_message Provide users the ability to review/edit the template subject and message. * * @return self */ - public function setForceSubjectMessage(?bool $force_subject_message) + public function setForceSubjectMessage($force_subject_message) { if (is_null($force_subject_message)) { - throw new InvalidArgumentException('non-nullable force_subject_message cannot be null'); + throw new \InvalidArgumentException('non-nullable force_subject_message cannot be null'); } $this->container['force_subject_message'] = $force_subject_message; @@ -890,10 +902,10 @@ public function getHoldRequest() * * @return self */ - public function setHoldRequest(?bool $hold_request) + public function setHoldRequest($hold_request) { if (is_null($hold_request)) { - throw new InvalidArgumentException('non-nullable hold_request cannot be null'); + throw new \InvalidArgumentException('non-nullable hold_request cannot be null'); } $this->container['hold_request'] = $hold_request; @@ -917,10 +929,10 @@ public function getIsForEmbeddedSigning() * * @return self */ - public function setIsForEmbeddedSigning(?bool $is_for_embedded_signing) + public function setIsForEmbeddedSigning($is_for_embedded_signing) { if (is_null($is_for_embedded_signing)) { - throw new InvalidArgumentException('non-nullable is_for_embedded_signing cannot be null'); + throw new \InvalidArgumentException('non-nullable is_for_embedded_signing cannot be null'); } $this->container['is_for_embedded_signing'] = $is_for_embedded_signing; @@ -940,17 +952,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message the custom message in the email that will be sent to the signers + * @param string|null $message The custom message in the email that will be sent to the signers. * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { - throw new InvalidArgumentException('non-nullable message cannot be null'); + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - if (mb_strlen($message) > 5000) { - throw new InvalidArgumentException('invalid length for $message when calling UnclaimedDraftCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); + if ((mb_strlen($message) > 5000)) { + throw new \InvalidArgumentException('invalid length for $message when calling UnclaimedDraftCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -975,12 +987,13 @@ public function getMetadata() * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } + $this->container['metadata'] = $metadata; return $this; @@ -1003,10 +1016,10 @@ public function getPreviewOnly() * * @return self */ - public function setPreviewOnly(?bool $preview_only) + public function setPreviewOnly($preview_only) { if (is_null($preview_only)) { - throw new InvalidArgumentException('non-nullable preview_only cannot be null'); + throw new \InvalidArgumentException('non-nullable preview_only cannot be null'); } $this->container['preview_only'] = $preview_only; @@ -1026,14 +1039,14 @@ public function getRequestingRedirectUrl() /** * Sets requesting_redirect_url * - * @param string|null $requesting_redirect_url the URL you want signers redirected to after they successfully request a signature + * @param string|null $requesting_redirect_url The URL you want signers redirected to after they successfully request a signature. * * @return self */ - public function setRequestingRedirectUrl(?string $requesting_redirect_url) + public function setRequestingRedirectUrl($requesting_redirect_url) { if (is_null($requesting_redirect_url)) { - throw new InvalidArgumentException('non-nullable requesting_redirect_url cannot be null'); + throw new \InvalidArgumentException('non-nullable requesting_redirect_url cannot be null'); } $this->container['requesting_redirect_url'] = $requesting_redirect_url; @@ -1057,10 +1070,10 @@ public function getShowPreview() * * @return self */ - public function setShowPreview(?bool $show_preview) + public function setShowPreview($show_preview) { if (is_null($show_preview)) { - throw new InvalidArgumentException('non-nullable show_preview cannot be null'); + throw new \InvalidArgumentException('non-nullable show_preview cannot be null'); } $this->container['show_preview'] = $show_preview; @@ -1080,14 +1093,14 @@ public function getShowProgressStepper() /** * Sets show_progress_stepper * - * @param bool|null $show_progress_stepper when only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden + * @param bool|null $show_progress_stepper When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * * @return self */ - public function setShowProgressStepper(?bool $show_progress_stepper) + public function setShowProgressStepper($show_progress_stepper) { if (is_null($show_progress_stepper)) { - throw new InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); + throw new \InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); } $this->container['show_progress_stepper'] = $show_progress_stepper; @@ -1107,14 +1120,14 @@ public function getSigners() /** * Sets signers * - * @param SubUnclaimedDraftTemplateSigner[]|null $signers add Signers to your Templated-based Signature Request + * @param SubUnclaimedDraftTemplateSigner[]|null $signers Add Signers to your Templated-based Signature Request. * * @return self */ - public function setSigners(?array $signers) + public function setSigners($signers) { if (is_null($signers)) { - throw new InvalidArgumentException('non-nullable signers cannot be null'); + throw new \InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -1138,10 +1151,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions(?SubSigningOptions $signing_options) + public function setSigningOptions($signing_options) { if (is_null($signing_options)) { - throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -1161,14 +1174,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign + * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. * * @return self */ - public function setSigningRedirectUrl(?string $signing_redirect_url) + public function setSigningRedirectUrl($signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -1192,10 +1205,10 @@ public function getSkipMeNow() * * @return self */ - public function setSkipMeNow(?bool $skip_me_now) + public function setSkipMeNow($skip_me_now) { if (is_null($skip_me_now)) { - throw new InvalidArgumentException('non-nullable skip_me_now cannot be null'); + throw new \InvalidArgumentException('non-nullable skip_me_now cannot be null'); } $this->container['skip_me_now'] = $skip_me_now; @@ -1215,17 +1228,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject the subject in the email that will be sent to the signers + * @param string|null $subject The subject in the email that will be sent to the signers. * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { - throw new InvalidArgumentException('non-nullable subject cannot be null'); + throw new \InvalidArgumentException('non-nullable subject cannot be null'); } - if (mb_strlen($subject) > 255) { - throw new InvalidArgumentException('invalid length for $subject when calling UnclaimedDraftCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($subject) > 255)) { + throw new \InvalidArgumentException('invalid length for $subject when calling UnclaimedDraftCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -1250,10 +1263,10 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -1273,17 +1286,17 @@ public function getTitle() /** * Sets title * - * @param string|null $title the title you want to assign to the SignatureRequest + * @param string|null $title The title you want to assign to the SignatureRequest. * * @return self */ - public function setTitle(?string $title) + public function setTitle($title) { if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); + throw new \InvalidArgumentException('non-nullable title cannot be null'); } - if (mb_strlen($title) > 255) { - throw new InvalidArgumentException('invalid length for $title when calling UnclaimedDraftCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); + if ((mb_strlen($title) > 255)) { + throw new \InvalidArgumentException('invalid length for $title when calling UnclaimedDraftCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; @@ -1308,10 +1321,10 @@ public function getPopulateAutoFillFields() * * @return self */ - public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) + public function setPopulateAutoFillFields($populate_auto_fill_fields) { if (is_null($populate_auto_fill_fields)) { - throw new InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); } $this->container['populate_auto_fill_fields'] = $populate_auto_fill_fields; @@ -1331,26 +1344,27 @@ public function getAllowCcs() /** * Sets allow_ccs * - * @param bool|null $allow_ccs this allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft + * @param bool|null $allow_ccs This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. * * @return self */ - public function setAllowCcs(?bool $allow_ccs) + public function setAllowCcs($allow_ccs) { if (is_null($allow_ccs)) { - throw new InvalidArgumentException('non-nullable allow_ccs cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_ccs cannot be null'); } $this->container['allow_ccs'] = $allow_ccs; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1359,11 +1373,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1374,8 +1388,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1388,9 +1404,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1398,12 +1416,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1432,3 +1450,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/UnclaimedDraftCreateRequest.php b/sdks/php/src/Model/UnclaimedDraftCreateRequest.php index 1d55c2c1b..8afe4e54e 100644 --- a/sdks/php/src/Model/UnclaimedDraftCreateRequest.php +++ b/sdks/php/src/Model/UnclaimedDraftCreateRequest.php @@ -1,11 +1,14 @@ */ -class UnclaimedDraftCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable +class UnclaimedDraftCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'UnclaimedDraftCreateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'files' => '\SplFileObject[]', @@ -82,16 +83,16 @@ class UnclaimedDraftCreateRequest implements ModelInterface, ArrayAccess, JsonSe 'test_mode' => 'bool', 'use_preexisting_fields' => 'bool', 'use_text_tags' => 'bool', - 'expires_at' => 'int', + 'expires_at' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'files' => 'binary', @@ -116,14 +117,14 @@ class UnclaimedDraftCreateRequest implements ModelInterface, ArrayAccess, JsonSe 'test_mode' => null, 'use_preexisting_fields' => null, 'use_text_tags' => null, - 'expires_at' => null, + 'expires_at' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'type' => false, 'files' => false, @@ -148,14 +149,14 @@ class UnclaimedDraftCreateRequest implements ModelInterface, ArrayAccess, JsonSe 'test_mode' => false, 'use_preexisting_fields' => false, 'use_text_tags' => false, - 'expires_at' => true, + 'expires_at' => true ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -180,6 +181,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -189,7 +192,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -199,7 +202,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -208,6 +211,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -216,6 +222,9 @@ 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 { @@ -252,7 +261,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'test_mode', 'use_preexisting_fields' => 'use_preexisting_fields', 'use_text_tags' => 'use_text_tags', - 'expires_at' => 'expires_at', + 'expires_at' => 'expires_at' ]; /** @@ -284,7 +293,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'setTestMode', 'use_preexisting_fields' => 'setUsePreexistingFields', 'use_text_tags' => 'setUseTextTags', - 'expires_at' => 'setExpiresAt', + 'expires_at' => 'setExpiresAt' ]; /** @@ -316,7 +325,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'getTestMode', 'use_preexisting_fields' => 'getUsePreexistingFields', 'use_text_tags' => 'getUseTextTags', - 'expires_at' => 'getExpiresAt', + 'expires_at' => 'getExpiresAt' ]; /** @@ -386,10 +395,10 @@ public function getTypeAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('files', $data ?? [], null); @@ -417,33 +426,34 @@ public function __construct(array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): UnclaimedDraftCreateRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): UnclaimedDraftCreateRequest { /** @var UnclaimedDraftCreateRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, UnclaimedDraftCreateRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -496,6 +506,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets type * @@ -513,14 +524,14 @@ public function getType() * * @return self */ - public function setType(string $type) + public function setType($type) { if (is_null($type)) { - throw new InvalidArgumentException('non-nullable type cannot be null'); + throw new \InvalidArgumentException('non-nullable type cannot be null'); } $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'type', must be one of '%s'", $type, @@ -536,7 +547,7 @@ public function setType(string $type) /** * Gets files * - * @return SplFileObject[]|null + * @return \SplFileObject[]|null */ public function getFiles() { @@ -546,14 +557,14 @@ public function getFiles() /** * Sets files * - * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles(?array $files) + public function setFiles($files) { if (is_null($files)) { - throw new InvalidArgumentException('non-nullable files cannot be null'); + throw new \InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -577,10 +588,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls(?array $file_urls) + public function setFileUrls($file_urls) { if (is_null($file_urls)) { - throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -604,10 +615,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline(?bool $allow_decline) + public function setAllowDecline($allow_decline) { if (is_null($allow_decline)) { - throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -631,10 +642,10 @@ public function getAttachments() * * @return self */ - public function setAttachments(?array $attachments) + public function setAttachments($attachments) { if (is_null($attachments)) { - throw new InvalidArgumentException('non-nullable attachments cannot be null'); + throw new \InvalidArgumentException('non-nullable attachments cannot be null'); } $this->container['attachments'] = $attachments; @@ -654,14 +665,14 @@ public function getCcEmailAddresses() /** * Sets cc_email_addresses * - * @param string[]|null $cc_email_addresses the email addresses that should be CCed + * @param string[]|null $cc_email_addresses The email addresses that should be CCed. * * @return self */ - public function setCcEmailAddresses(?array $cc_email_addresses) + public function setCcEmailAddresses($cc_email_addresses) { if (is_null($cc_email_addresses)) { - throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + throw new \InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); } $this->container['cc_email_addresses'] = $cc_email_addresses; @@ -685,10 +696,10 @@ public function getClientId() * * @return self */ - public function setClientId(?string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -712,10 +723,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields(?array $custom_fields) + public function setCustomFields($custom_fields) { if (is_null($custom_fields)) { - throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -739,10 +750,10 @@ public function getFieldOptions() * * @return self */ - public function setFieldOptions(?SubFieldOptions $field_options) + public function setFieldOptions($field_options) { if (is_null($field_options)) { - throw new InvalidArgumentException('non-nullable field_options cannot be null'); + throw new \InvalidArgumentException('non-nullable field_options cannot be null'); } $this->container['field_options'] = $field_options; @@ -766,10 +777,10 @@ public function getFormFieldGroups() * * @return self */ - public function setFormFieldGroups(?array $form_field_groups) + public function setFormFieldGroups($form_field_groups) { if (is_null($form_field_groups)) { - throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); + throw new \InvalidArgumentException('non-nullable form_field_groups cannot be null'); } $this->container['form_field_groups'] = $form_field_groups; @@ -789,14 +800,14 @@ public function getFormFieldRules() /** * Sets form_field_rules * - * @param SubFormFieldRule[]|null $form_field_rules conditional Logic rules for fields defined in `form_fields_per_document` + * @param SubFormFieldRule[]|null $form_field_rules Conditional Logic rules for fields defined in `form_fields_per_document`. * * @return self */ - public function setFormFieldRules(?array $form_field_rules) + public function setFormFieldRules($form_field_rules) { if (is_null($form_field_rules)) { - throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); + throw new \InvalidArgumentException('non-nullable form_field_rules cannot be null'); } $this->container['form_field_rules'] = $form_field_rules; @@ -820,10 +831,10 @@ public function getFormFieldsPerDocument() * * @return self */ - public function setFormFieldsPerDocument(?array $form_fields_per_document) + public function setFormFieldsPerDocument($form_fields_per_document) { if (is_null($form_fields_per_document)) { - throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + throw new \InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); } $this->container['form_fields_per_document'] = $form_fields_per_document; @@ -847,10 +858,10 @@ public function getHideTextTags() * * @return self */ - public function setHideTextTags(?bool $hide_text_tags) + public function setHideTextTags($hide_text_tags) { if (is_null($hide_text_tags)) { - throw new InvalidArgumentException('non-nullable hide_text_tags cannot be null'); + throw new \InvalidArgumentException('non-nullable hide_text_tags cannot be null'); } $this->container['hide_text_tags'] = $hide_text_tags; @@ -870,17 +881,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message the custom message in the email that will be sent to the signers + * @param string|null $message The custom message in the email that will be sent to the signers. * * @return self */ - public function setMessage(?string $message) + public function setMessage($message) { if (is_null($message)) { - throw new InvalidArgumentException('non-nullable message cannot be null'); + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - if (mb_strlen($message) > 5000) { - throw new InvalidArgumentException('invalid length for $message when calling UnclaimedDraftCreateRequest., must be smaller than or equal to 5000.'); + if ((mb_strlen($message) > 5000)) { + throw new \InvalidArgumentException('invalid length for $message when calling UnclaimedDraftCreateRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -905,12 +916,13 @@ public function getMetadata() * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata($metadata) { if (is_null($metadata)) { - throw new InvalidArgumentException('non-nullable metadata cannot be null'); + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } + $this->container['metadata'] = $metadata; return $this; @@ -929,14 +941,14 @@ public function getShowProgressStepper() /** * Sets show_progress_stepper * - * @param bool|null $show_progress_stepper when only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden + * @param bool|null $show_progress_stepper When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * * @return self */ - public function setShowProgressStepper(?bool $show_progress_stepper) + public function setShowProgressStepper($show_progress_stepper) { if (is_null($show_progress_stepper)) { - throw new InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); + throw new \InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); } $this->container['show_progress_stepper'] = $show_progress_stepper; @@ -956,14 +968,14 @@ public function getSigners() /** * Sets signers * - * @param SubUnclaimedDraftSigner[]|null $signers add Signers to your Unclaimed Draft Signature Request + * @param SubUnclaimedDraftSigner[]|null $signers Add Signers to your Unclaimed Draft Signature Request. * * @return self */ - public function setSigners(?array $signers) + public function setSigners($signers) { if (is_null($signers)) { - throw new InvalidArgumentException('non-nullable signers cannot be null'); + throw new \InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -987,10 +999,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions(?SubSigningOptions $signing_options) + public function setSigningOptions($signing_options) { if (is_null($signing_options)) { - throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -1010,14 +1022,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign + * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. * * @return self */ - public function setSigningRedirectUrl(?string $signing_redirect_url) + public function setSigningRedirectUrl($signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -1037,17 +1049,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject the subject in the email that will be sent to the signers + * @param string|null $subject The subject in the email that will be sent to the signers. * * @return self */ - public function setSubject(?string $subject) + public function setSubject($subject) { if (is_null($subject)) { - throw new InvalidArgumentException('non-nullable subject cannot be null'); + throw new \InvalidArgumentException('non-nullable subject cannot be null'); } - if (mb_strlen($subject) > 200) { - throw new InvalidArgumentException('invalid length for $subject when calling UnclaimedDraftCreateRequest., must be smaller than or equal to 200.'); + if ((mb_strlen($subject) > 200)) { + throw new \InvalidArgumentException('invalid length for $subject when calling UnclaimedDraftCreateRequest., must be smaller than or equal to 200.'); } $this->container['subject'] = $subject; @@ -1072,10 +1084,10 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -1099,10 +1111,10 @@ public function getUsePreexistingFields() * * @return self */ - public function setUsePreexistingFields(?bool $use_preexisting_fields) + public function setUsePreexistingFields($use_preexisting_fields) { if (is_null($use_preexisting_fields)) { - throw new InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); + throw new \InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); } $this->container['use_preexisting_fields'] = $use_preexisting_fields; @@ -1126,10 +1138,10 @@ public function getUseTextTags() * * @return self */ - public function setUseTextTags(?bool $use_text_tags) + public function setUseTextTags($use_text_tags) { if (is_null($use_text_tags)) { - throw new InvalidArgumentException('non-nullable use_text_tags cannot be null'); + throw new \InvalidArgumentException('non-nullable use_text_tags cannot be null'); } $this->container['use_text_tags'] = $use_text_tags; @@ -1153,13 +1165,13 @@ public function getExpiresAt() * * @return self */ - public function setExpiresAt(?int $expires_at) + 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); + $index = array_search('expires_at', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1169,13 +1181,14 @@ public function setExpiresAt(?int $expires_at) return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1184,11 +1197,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1199,8 +1212,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1213,9 +1228,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1223,12 +1240,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1257,3 +1274,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/UnclaimedDraftCreateResponse.php b/sdks/php/src/Model/UnclaimedDraftCreateResponse.php index fb93528ef..14f3f0a03 100644 --- a/sdks/php/src/Model/UnclaimedDraftCreateResponse.php +++ b/sdks/php/src/Model/UnclaimedDraftCreateResponse.php @@ -1,11 +1,14 @@ */ -class UnclaimedDraftCreateResponse implements ModelInterface, ArrayAccess, JsonSerializable +class UnclaimedDraftCreateResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'UnclaimedDraftCreateResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'unclaimed_draft' => '\Dropbox\Sign\Model\UnclaimedDraftResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'unclaimed_draft' => null, - 'warnings' => null, + 'warnings' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'unclaimed_draft' => false, - 'warnings' => false, + 'warnings' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,6 +114,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -121,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,6 +144,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -148,6 +155,9 @@ 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 { @@ -162,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'unclaimed_draft' => 'unclaimed_draft', - 'warnings' => 'warnings', + 'warnings' => 'warnings' ]; /** @@ -172,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'unclaimed_draft' => 'setUnclaimedDraft', - 'warnings' => 'setWarnings', + 'warnings' => 'setWarnings' ]; /** @@ -182,7 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'unclaimed_draft' => 'getUnclaimedDraft', - 'warnings' => 'getWarnings', + 'warnings' => 'getWarnings' ]; /** @@ -226,6 +236,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -236,42 +247,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('unclaimed_draft', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): UnclaimedDraftCreateResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): UnclaimedDraftCreateResponse { /** @var UnclaimedDraftCreateResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, UnclaimedDraftCreateResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,6 +319,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets unclaimed_draft * @@ -324,10 +337,10 @@ public function getUnclaimedDraft() * * @return self */ - public function setUnclaimedDraft(UnclaimedDraftResponse $unclaimed_draft) + public function setUnclaimedDraft($unclaimed_draft) { if (is_null($unclaimed_draft)) { - throw new InvalidArgumentException('non-nullable unclaimed_draft cannot be null'); + throw new \InvalidArgumentException('non-nullable unclaimed_draft cannot be null'); } $this->container['unclaimed_draft'] = $unclaimed_draft; @@ -347,26 +360,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings a list of warnings + * @param WarningResponse[]|null $warnings A list of warnings. * * @return self */ - public function setWarnings(?array $warnings) + public function setWarnings($warnings) { if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + throw new \InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -375,11 +389,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,8 +404,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -404,9 +420,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -414,12 +432,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -448,3 +466,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/UnclaimedDraftEditAndResendRequest.php b/sdks/php/src/Model/UnclaimedDraftEditAndResendRequest.php index 5669e4848..42cda1dd1 100644 --- a/sdks/php/src/Model/UnclaimedDraftEditAndResendRequest.php +++ b/sdks/php/src/Model/UnclaimedDraftEditAndResendRequest.php @@ -1,11 +1,14 @@ */ -class UnclaimedDraftEditAndResendRequest implements ModelInterface, ArrayAccess, JsonSerializable +class UnclaimedDraftEditAndResendRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'UnclaimedDraftEditAndResendRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'client_id' => 'string', 'editor_options' => '\Dropbox\Sign\Model\SubEditorOptions', @@ -64,16 +66,16 @@ class UnclaimedDraftEditAndResendRequest implements ModelInterface, ArrayAccess, 'requesting_redirect_url' => 'string', 'show_progress_stepper' => 'bool', 'signing_redirect_url' => 'string', - 'test_mode' => 'bool', + 'test_mode' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'client_id' => null, 'editor_options' => null, @@ -82,14 +84,14 @@ class UnclaimedDraftEditAndResendRequest implements ModelInterface, ArrayAccess, 'requesting_redirect_url' => null, 'show_progress_stepper' => null, 'signing_redirect_url' => null, - 'test_mode' => null, + 'test_mode' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'client_id' => false, 'editor_options' => false, @@ -98,14 +100,14 @@ class UnclaimedDraftEditAndResendRequest implements ModelInterface, ArrayAccess, 'requesting_redirect_url' => false, 'show_progress_stepper' => false, 'signing_redirect_url' => false, - 'test_mode' => false, + 'test_mode' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -130,6 +132,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -139,7 +143,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -149,7 +153,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -158,6 +162,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -166,6 +173,9 @@ 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 { @@ -186,7 +196,7 @@ public function isNullableSetToNull(string $property): bool 'requesting_redirect_url' => 'requesting_redirect_url', 'show_progress_stepper' => 'show_progress_stepper', 'signing_redirect_url' => 'signing_redirect_url', - 'test_mode' => 'test_mode', + 'test_mode' => 'test_mode' ]; /** @@ -202,7 +212,7 @@ public function isNullableSetToNull(string $property): bool 'requesting_redirect_url' => 'setRequestingRedirectUrl', 'show_progress_stepper' => 'setShowProgressStepper', 'signing_redirect_url' => 'setSigningRedirectUrl', - 'test_mode' => 'setTestMode', + 'test_mode' => 'setTestMode' ]; /** @@ -218,7 +228,7 @@ public function isNullableSetToNull(string $property): bool 'requesting_redirect_url' => 'getRequestingRedirectUrl', 'show_progress_stepper' => 'getShowProgressStepper', 'signing_redirect_url' => 'getSigningRedirectUrl', - 'test_mode' => 'getTestMode', + 'test_mode' => 'getTestMode' ]; /** @@ -262,6 +272,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -272,10 +283,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('client_id', $data ?? [], null); $this->setIfExists('editor_options', $data ?? [], null); @@ -287,33 +298,34 @@ public function __construct(array $data = null) $this->setIfExists('test_mode', $data ?? [], false); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): UnclaimedDraftEditAndResendRequest { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): UnclaimedDraftEditAndResendRequest { /** @var UnclaimedDraftEditAndResendRequest */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, UnclaimedDraftEditAndResendRequest::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -349,6 +361,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets client_id * @@ -366,10 +379,10 @@ public function getClientId() * * @return self */ - public function setClientId(string $client_id) + public function setClientId($client_id) { if (is_null($client_id)) { - throw new InvalidArgumentException('non-nullable client_id cannot be null'); + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -393,10 +406,10 @@ public function getEditorOptions() * * @return self */ - public function setEditorOptions(?SubEditorOptions $editor_options) + public function setEditorOptions($editor_options) { if (is_null($editor_options)) { - throw new InvalidArgumentException('non-nullable editor_options cannot be null'); + throw new \InvalidArgumentException('non-nullable editor_options cannot be null'); } $this->container['editor_options'] = $editor_options; @@ -416,14 +429,14 @@ public function getIsForEmbeddedSigning() /** * Sets is_for_embedded_signing * - * @param bool|null $is_for_embedded_signing the request created from this draft will also be signable in embedded mode if set to `true` + * @param bool|null $is_for_embedded_signing The request created from this draft will also be signable in embedded mode if set to `true`. * * @return self */ - public function setIsForEmbeddedSigning(?bool $is_for_embedded_signing) + public function setIsForEmbeddedSigning($is_for_embedded_signing) { if (is_null($is_for_embedded_signing)) { - throw new InvalidArgumentException('non-nullable is_for_embedded_signing cannot be null'); + throw new \InvalidArgumentException('non-nullable is_for_embedded_signing cannot be null'); } $this->container['is_for_embedded_signing'] = $is_for_embedded_signing; @@ -447,10 +460,10 @@ public function getRequesterEmailAddress() * * @return self */ - public function setRequesterEmailAddress(?string $requester_email_address) + public function setRequesterEmailAddress($requester_email_address) { if (is_null($requester_email_address)) { - throw new InvalidArgumentException('non-nullable requester_email_address cannot be null'); + throw new \InvalidArgumentException('non-nullable requester_email_address cannot be null'); } $this->container['requester_email_address'] = $requester_email_address; @@ -470,14 +483,14 @@ public function getRequestingRedirectUrl() /** * Sets requesting_redirect_url * - * @param string|null $requesting_redirect_url the URL you want signers redirected to after they successfully request a signature + * @param string|null $requesting_redirect_url The URL you want signers redirected to after they successfully request a signature. * * @return self */ - public function setRequestingRedirectUrl(?string $requesting_redirect_url) + public function setRequestingRedirectUrl($requesting_redirect_url) { if (is_null($requesting_redirect_url)) { - throw new InvalidArgumentException('non-nullable requesting_redirect_url cannot be null'); + throw new \InvalidArgumentException('non-nullable requesting_redirect_url cannot be null'); } $this->container['requesting_redirect_url'] = $requesting_redirect_url; @@ -497,14 +510,14 @@ public function getShowProgressStepper() /** * Sets show_progress_stepper * - * @param bool|null $show_progress_stepper when only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden + * @param bool|null $show_progress_stepper When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * * @return self */ - public function setShowProgressStepper(?bool $show_progress_stepper) + public function setShowProgressStepper($show_progress_stepper) { if (is_null($show_progress_stepper)) { - throw new InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); + throw new \InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); } $this->container['show_progress_stepper'] = $show_progress_stepper; @@ -524,14 +537,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign + * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. * * @return self */ - public function setSigningRedirectUrl(?string $signing_redirect_url) + public function setSigningRedirectUrl($signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -555,22 +568,23 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -579,11 +593,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -594,8 +608,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -608,9 +624,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -618,12 +636,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -652,3 +670,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/UnclaimedDraftResponse.php b/sdks/php/src/Model/UnclaimedDraftResponse.php index da1c26359..7b0a5fcc3 100644 --- a/sdks/php/src/Model/UnclaimedDraftResponse.php +++ b/sdks/php/src/Model/UnclaimedDraftResponse.php @@ -1,11 +1,14 @@ */ -class UnclaimedDraftResponse implements ModelInterface, ArrayAccess, JsonSerializable +class UnclaimedDraftResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'UnclaimedDraftResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'signature_request_id' => 'string', 'claim_url' => 'string', 'signing_redirect_url' => 'string', 'requesting_redirect_url' => 'string', 'expires_at' => 'int', - 'test_mode' => 'bool', + 'test_mode' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'signature_request_id' => null, 'claim_url' => null, 'signing_redirect_url' => null, 'requesting_redirect_url' => null, 'expires_at' => null, - 'test_mode' => null, + 'test_mode' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'signature_request_id' => true, 'claim_url' => false, 'signing_redirect_url' => true, 'requesting_redirect_url' => true, 'expires_at' => true, - 'test_mode' => false, + 'test_mode' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -125,6 +127,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -134,7 +138,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -144,7 +148,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -153,6 +157,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -161,6 +168,9 @@ 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 { @@ -179,7 +189,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'signing_redirect_url', 'requesting_redirect_url' => 'requesting_redirect_url', 'expires_at' => 'expires_at', - 'test_mode' => 'test_mode', + 'test_mode' => 'test_mode' ]; /** @@ -193,7 +203,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'setSigningRedirectUrl', 'requesting_redirect_url' => 'setRequestingRedirectUrl', 'expires_at' => 'setExpiresAt', - 'test_mode' => 'setTestMode', + 'test_mode' => 'setTestMode' ]; /** @@ -207,7 +217,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'getSigningRedirectUrl', 'requesting_redirect_url' => 'getRequestingRedirectUrl', 'expires_at' => 'getExpiresAt', - 'test_mode' => 'getTestMode', + 'test_mode' => 'getTestMode' ]; /** @@ -251,6 +261,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -261,10 +272,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('signature_request_id', $data ?? [], null); $this->setIfExists('claim_url', $data ?? [], null); @@ -274,33 +285,34 @@ public function __construct(array $data = null) $this->setIfExists('test_mode', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): UnclaimedDraftResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): UnclaimedDraftResponse { /** @var UnclaimedDraftResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, UnclaimedDraftResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -317,7 +329,9 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + return $invalidProperties; } /** @@ -331,6 +345,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets signature_request_id * @@ -344,17 +359,17 @@ public function getSignatureRequestId() /** * Sets signature_request_id * - * @param string|null $signature_request_id the ID of the signature request that is represented by this UnclaimedDraft + * @param string|null $signature_request_id The ID of the signature request that is represented by this UnclaimedDraft. * * @return self */ - public function setSignatureRequestId(?string $signature_request_id) + public function setSignatureRequestId($signature_request_id) { if (is_null($signature_request_id)) { array_push($this->openAPINullablesSetToNull, 'signature_request_id'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signature_request_id', $nullablesSetToNull); + $index = array_search('signature_request_id', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -378,14 +393,14 @@ public function getClaimUrl() /** * Sets claim_url * - * @param string|null $claim_url the URL to be used to claim this UnclaimedDraft + * @param string|null $claim_url The URL to be used to claim this UnclaimedDraft. * * @return self */ - public function setClaimUrl(?string $claim_url) + public function setClaimUrl($claim_url) { if (is_null($claim_url)) { - throw new InvalidArgumentException('non-nullable claim_url cannot be null'); + throw new \InvalidArgumentException('non-nullable claim_url cannot be null'); } $this->container['claim_url'] = $claim_url; @@ -405,17 +420,17 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign + * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. * * @return self */ - public function setSigningRedirectUrl(?string $signing_redirect_url) + public function setSigningRedirectUrl($signing_redirect_url) { if (is_null($signing_redirect_url)) { array_push($this->openAPINullablesSetToNull, 'signing_redirect_url'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signing_redirect_url', $nullablesSetToNull); + $index = array_search('signing_redirect_url', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -443,13 +458,13 @@ public function getRequestingRedirectUrl() * * @return self */ - public function setRequestingRedirectUrl(?string $requesting_redirect_url) + public function setRequestingRedirectUrl($requesting_redirect_url) { if (is_null($requesting_redirect_url)) { array_push($this->openAPINullablesSetToNull, 'requesting_redirect_url'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('requesting_redirect_url', $nullablesSetToNull); + $index = array_search('requesting_redirect_url', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -473,17 +488,17 @@ public function getExpiresAt() /** * Sets expires_at * - * @param int|null $expires_at when the link expires + * @param int|null $expires_at When the link expires. * * @return self */ - public function setExpiresAt(?int $expires_at) + 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); + $index = array_search('expires_at', $nullablesSetToNull, true); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -511,22 +526,23 @@ public function getTestMode() * * @return self */ - public function setTestMode(?bool $test_mode) + public function setTestMode($test_mode) { if (is_null($test_mode)) { - throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -535,11 +551,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -550,8 +566,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -564,9 +582,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -574,12 +594,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -608,3 +628,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/Model/WarningResponse.php b/sdks/php/src/Model/WarningResponse.php index 4c37010a0..dc2c0feec 100644 --- a/sdks/php/src/Model/WarningResponse.php +++ b/sdks/php/src/Model/WarningResponse.php @@ -1,11 +1,14 @@ */ -class WarningResponse implements ModelInterface, ArrayAccess, JsonSerializable +class WarningResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'WarningResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'warning_msg' => 'string', - 'warning_name' => 'string', + 'warning_name' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'warning_msg' => null, - 'warning_name' => null, + 'warning_name' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static array $openAPINullables = [ 'warning_msg' => false, - 'warning_name' => false, + 'warning_name' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,6 +115,8 @@ public static function openAPIFormats() /** * Array of nullable properties + * + * @return array */ protected static function openAPINullables(): array { @@ -122,7 +126,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return bool[] + * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +136,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param bool[] $openAPINullablesSetToNull + * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,6 +145,9 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable + * + * @param string $property + * @return bool */ public static function isNullable(string $property): bool { @@ -149,6 +156,9 @@ 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 { @@ -163,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'warning_msg' => 'warning_msg', - 'warning_name' => 'warning_name', + 'warning_name' => 'warning_name' ]; /** @@ -173,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'warning_msg' => 'setWarningMsg', - 'warning_name' => 'setWarningName', + 'warning_name' => 'setWarningName' ]; /** @@ -183,7 +193,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'warning_msg' => 'getWarningMsg', - 'warning_name' => 'getWarningName', + 'warning_name' => 'getWarningName' ]; /** @@ -227,6 +237,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -237,42 +248,43 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('warning_msg', $data ?? [], null); $this->setIfExists('warning_name', $data ?? [], null); } - /** - * @deprecated use ::init() - */ + /** @deprecated use ::init() */ public static function fromArray(array $data): WarningResponse { return self::init($data); } - /** - * Attempt to instantiate and hydrate a new instance of this class - */ + /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): WarningResponse { /** @var WarningResponse */ - return ObjectSerializer::deserialize( + $obj = ObjectSerializer::deserialize( $data, WarningResponse::class, ); + + return $obj; } + /** - * 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|int|object|array|mixed $defaultValue - */ + * 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 string|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -311,6 +323,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets warning_msg * @@ -328,10 +341,10 @@ public function getWarningMsg() * * @return self */ - public function setWarningMsg(string $warning_msg) + public function setWarningMsg($warning_msg) { if (is_null($warning_msg)) { - throw new InvalidArgumentException('non-nullable warning_msg cannot be null'); + throw new \InvalidArgumentException('non-nullable warning_msg cannot be null'); } $this->container['warning_msg'] = $warning_msg; @@ -355,22 +368,23 @@ public function getWarningName() * * @return self */ - public function setWarningName(string $warning_name) + public function setWarningName($warning_name) { if (is_null($warning_name)) { - throw new InvalidArgumentException('non-nullable warning_name cannot be null'); + throw new \InvalidArgumentException('non-nullable warning_name cannot be null'); } $this->container['warning_name'] = $warning_name; return $this; } - /** * Returns true if offset exists. False otherwise. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return boolean */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -379,11 +393,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param int $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -394,8 +408,10 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -408,9 +424,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param int $offset Offset + * @param integer $offset Offset + * + * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -418,12 +436,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @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 + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -452,3 +470,5 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } + + diff --git a/sdks/php/src/ObjectSerializer.php b/sdks/php/src/ObjectSerializer.php index 958cd8e04..d0bcbffe0 100644 --- a/sdks/php/src/ObjectSerializer.php +++ b/sdks/php/src/ObjectSerializer.php @@ -1,11 +1,14 @@ format('Y-m-d') : $data->format(self::$dateTimeFormat); } @@ -88,7 +89,7 @@ public static function sanitizeForSerialization($data, string $type = null, stri $formats = $data::openAPIFormats(); foreach ($data::openAPITypes() as $property => $openAPIType) { $getter = $data::getters()[$property]; - $value = $data->{$getter}(); + $value = $data->$getter(); 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)) { @@ -96,7 +97,7 @@ public static function sanitizeForSerialization($data, string $type = null, stri $allowedEnumTypes = $callable(); if (!in_array($value, $allowedEnumTypes, true)) { $imploded = implode("', '", $allowedEnumTypes); - throw new InvalidArgumentException("Invalid value for enum '{$openAPIType}', must be one of: '{$imploded}'"); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); } } } @@ -104,16 +105,17 @@ public static function sanitizeForSerialization($data, string $type = null, stri $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); } } - } elseif ($data instanceof SplFileObject) { - return (string)$data; + } elseif ($data instanceof \SplFileObject) { + return (string) $data; } else { foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } return (object)$values; + } else { + return (string)$data; } - return (string)$data; } /** @@ -124,12 +126,13 @@ public static function sanitizeForSerialization($data, string $type = null, stri * * @return string the sanitized filename */ - public static function sanitizeFilename(string $filename) + public static function sanitizeFilename($filename) { - if (preg_match('/.*[\\/\\\\](.*)$/', $filename, $match)) { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { return $match[1]; + } else { + return $filename; } - return $filename; } /** @@ -139,7 +142,7 @@ public static function sanitizeFilename(string $filename) * * @return string the shorten timestamp */ - public static function sanitizeTimestamp(string $timestamp) + public static function sanitizeTimestamp($timestamp) { if (!is_string($timestamp)) { return $timestamp; @@ -156,7 +159,7 @@ public static function sanitizeTimestamp(string $timestamp) * * @return string the serialized object */ - public static function toPathValue(string $value) + public static function toPathValue($value) { return rawurlencode(self::toString($value)); } @@ -164,26 +167,27 @@ public static function toPathValue(string $value) /** * Checks if a value is empty, based on its OpenAPI type. * - * @param string|int|object|array|mixed $value + * @param string|int|object|array|mixed $value + * @param string $openApiType * * @return bool true if $value is empty */ private static function isEmptyValue($value, string $openApiType): bool { - // If empty() returns false, it is not empty regardless of its type. + # 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. + # 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. + # 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; @@ -192,12 +196,16 @@ private static function isEmptyValue($value, string $openApiType): bool case 'float': return $value !== 0 && $value !== 0.0; - // For boolean values, '' is considered empty + # 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. + # For string values, '' is considered empty. + case 'string': + return $value === ''; + + # For all the other types, any value at this point can be considered empty. default: return true; } @@ -207,12 +215,14 @@ private static function isEmptyValue($value, string $openApiType): bool * Take query parameter properties and turn it into an array suitable for * native http_build_query or GuzzleHttp\Psr7\Query::build. * - * @param string|int|object|array|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 + * @param string|int|object|array|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, @@ -222,19 +232,21 @@ public static function toQueryValue( 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. + + # 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 []; } - return []; } - // Handle DateTime objects in query - if ($openApiType === '\\DateTime' && $value instanceof DateTime) { + # Handle DateTime objects in query + if ($openApiType === "\\DateTime" && $value instanceof \DateTime) { return ["{$paramName}" => $value->format(self::$dateTimeFormat)]; } @@ -294,11 +306,11 @@ public static function toQueryValue( */ public static function convertBoolToQueryStringFormat(bool $value) { - if (Configuration::BOOLEAN_FORMAT_STRING == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) { + if (Configuration::BOOLEAN_FORMAT_STRING === Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) { return $value ? 'true' : 'false'; } - return (int)$value; + return (int) $value; } /** @@ -310,7 +322,7 @@ public static function convertBoolToQueryStringFormat(bool $value) * * @return string the header string */ - public static function toHeaderValue(string $value) + public static function toHeaderValue($value) { $callable = [$value, 'toHeaderValue']; if (is_callable($callable)) { @@ -325,16 +337,17 @@ public static function toHeaderValue(string $value) * the http body (form parameter). If it's a string, pass through unchanged * If it's a datetime object, format it in ISO8601 * - * @param string|SplFileObject $value the value of the form parameter + * @param string|\SplFileObject $value the value of the form parameter * * @return string the form string */ public static function toFormValue($value) { - if ($value instanceof SplFileObject) { + if ($value instanceof \SplFileObject) { return $value->getRealPath(); + } else { + return self::toString($value); } - return self::toString($value); } /** @@ -349,13 +362,13 @@ public static function toFormValue($value) */ public static function toString($value) { - if ($value instanceof DateTime) { // datetime in ISO8601 format + if ($value instanceof \DateTime) { // datetime in ISO8601 format return $value->format(self::$dateTimeFormat); - } - if (is_bool($value)) { + } elseif (is_bool($value)) { return $value ? 'true' : 'false'; + } else { + return (string) $value; } - return (string)$value; } /** @@ -363,12 +376,12 @@ public static function toString($value) * * @param array $collection collection to serialize to a string * @param string $style the format use for serialization (csv, - * ssv, tsv, pipes, multi) + * ssv, tsv, pipes, multi) * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array * * @return string */ - public static function serializeCollection(array $collection, string $style, bool $allowCollectionFormatMulti = false) + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) { if ($allowCollectionFormatMulti && ('multi' === $style)) { // http_build_query() almost does the job for us. We just @@ -398,13 +411,13 @@ public static function serializeCollection(array $collection, string $style, boo /** * Deserialize a JSON string into an object * - * @param string|int|object|array|mixed $data object or primitive to be deserialized - * @param string $class class name is passed as a string - * @param string[] $httpHeaders HTTP headers + * @param string|int|object|array|mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[]|null $httpHeaders HTTP headers * * @return object|array|null a single or an array of $class instances */ - public static function deserialize($data, string $class, array $httpHeaders = null) + public static function deserialize($data, $class, $httpHeaders = null) { if (null === $data) { return null; @@ -414,7 +427,7 @@ public static function deserialize($data, string $class, array $httpHeaders = nu $data = is_string($data) ? json_decode($data) : $data; if (!is_array($data)) { - throw new InvalidArgumentException("Invalid array '{$class}'"); + throw new \InvalidArgumentException("Invalid array '$class'"); } $subClass = substr($class, 0, -2); @@ -430,7 +443,7 @@ public static function deserialize($data, string $class, array $httpHeaders = nu settype($data, 'array'); $inner = substr($class, 4, -1); $deserialized = []; - if (strrpos($inner, ',') !== false) { + if (strrpos($inner, ",") !== false) { $subClass_array = explode(',', $inner, 2); $subClass = $subClass_array[1]; foreach ($data as $key => $value) { @@ -443,8 +456,7 @@ public static function deserialize($data, string $class, array $httpHeaders = nu if ($class === 'object') { settype($data, 'array'); return $data; - } - if ($class === 'mixed') { + } elseif ($class === 'mixed') { settype($data, gettype($data)); return $data; } @@ -458,12 +470,12 @@ public static function deserialize($data, string $class, array $httpHeaders = nu // this graceful. if (!empty($data)) { try { - return new DateTime($data); - } catch (Exception $exception) { + 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)); + return new \DateTime(self::sanitizeTimestamp($data)); } } else { return null; @@ -471,7 +483,7 @@ public static function deserialize($data, string $class, array $httpHeaders = nu } if ($class === '\SplFileObject') { - if (is_a($data, SplFileObject::class)) { + if (is_a($data, \SplFileObject::class)) { return $data; } @@ -496,7 +508,7 @@ public static function deserialize($data, string $class, array $httpHeaders = nu } fclose($file); - return new SplFileObject($filename, 'r'); + return new \SplFileObject($filename, 'r'); } /** @psalm-suppress ParadoxicalCondition */ @@ -505,95 +517,97 @@ public static function deserialize($data, string $class, array $httpHeaders = nu 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}'"); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); } return $data; - } - $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; - $discriminatorValue = null; - if (is_object($data)) { - $discriminatorValue = $data->{$discriminator} ?? null; - } elseif (is_array($data)) { - $discriminatorValue = $data[$discriminator] ?? null; - } + } else { + $data = is_string($data) ? json_decode($data) : $data; - $discrimnatorSubclassFound = false; - if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { - $subclass = '\Dropbox\Sign\Model\\' . $data->{$discriminator}; - if (is_subclass_of($subclass, $class)) { - $class = $subclass; - $discrimnatorSubclassFound = true; + if (is_array($data)) { + $data = (object)$data; } - } - if ( - !$discrimnatorSubclassFound - && !empty($discriminator) - && method_exists($class, 'discriminatorClassName') - ) { - $subclass = call_user_func( - "{$class}::discriminatorClassName", - (array)$data, - ); + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + $discriminatorValue = null; + if (is_object($data)) { + $discriminatorValue = $data->{$discriminator} ?? null; + } elseif (is_array($data)) { + $discriminatorValue = $data[$discriminator] ?? null; + } - if (empty($subclass)) { - return null; + $discrimnatorSubclassFound = false; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Dropbox\Sign\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + $discrimnatorSubclassFound = true; + } } - $class = $subclass; - $discrimnatorSubclassFound = true; - } + if ( + !$discrimnatorSubclassFound + && !empty($discriminator) + && method_exists($class, 'discriminatorClassName') + ) { + $subclass = call_user_func( + "{$class}::discriminatorClassName", + (array) $data, + ); - /** @var ModelInterface $instance */ - $instance = new $class(); - foreach ($instance::openAPITypes() as $property => $type) { - $propertySetter = $instance::setters()[$property]; + if (empty($subclass)) { + return null; + } - if (!isset($propertySetter)) { - continue; + $class = $subclass; + $discrimnatorSubclassFound = true; } - if (!isset($data->{$instance::attributeMap()[$property]})) { - if ($instance::isNullable($property)) { - $instance->{$propertySetter}(null); + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; } - continue; - } + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } - if (isset($data->{$instance::attributeMap()[$property]})) { - $propertyValue = $data->{$instance::attributeMap()[$property]}; - $instance->{$propertySetter}(self::deserialize($propertyValue, $type, null)); + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } } + return $instance; } - return $instance; } /** - * Build a query string from an array of key value pairs. - * - * This function can use the return value of `parse()` to build a query - * string. This function does not modify the provided keys when an array is - * encountered (like `http_build_query()` would). - * - * The function is copied from https://github.com/guzzle/psr7/blob/a243f80a1ca7fe8ceed4deee17f12c1930efe662/src/Query.php#L59-L112 - * with a modification which is described in https://github.com/guzzle/psr7/pull/603 - * - * @param array $params query string parameters - * @param int|false $encoding set to false to not encode, PHP_QUERY_RFC3986 - * to encode using RFC3986, or PHP_QUERY_RFC1738 - * to encode using RFC1738 - */ + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * The function is copied from https://github.com/guzzle/psr7/blob/a243f80a1ca7fe8ceed4deee17f12c1930efe662/src/Query.php#L59-L112 + * with a modification which is described in https://github.com/guzzle/psr7/pull/603 + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + */ public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string { if (!$params) { @@ -609,21 +623,21 @@ public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): } elseif ($encoding === PHP_QUERY_RFC1738) { $encoder = 'urlencode'; } else { - throw new InvalidArgumentException('Invalid type'); + throw new \InvalidArgumentException('Invalid type'); } - $castBool = Configuration::BOOLEAN_FORMAT_INT == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString() - ? function ($v) { return (int)$v; } + $castBool = Configuration::BOOLEAN_FORMAT_INT === Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString() + ? function ($v) { return (int) $v; } : function ($v) { return $v ? 'true' : 'false'; }; $qs = ''; foreach ($params as $k => $v) { - $k = $encoder((string)$k); + $k = $encoder((string) $k); if (!is_array($v)) { $qs .= $k; $v = is_bool($v) ? $castBool($v) : $v; if ($v !== null) { - $qs .= '=' . $encoder((string)$v); + $qs .= '='.$encoder((string) $v); } $qs .= '&'; } else { @@ -631,14 +645,14 @@ public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): $qs .= $k; $vv = is_bool($vv) ? $castBool($vv) : $vv; if ($vv !== null) { - $qs .= '=' . $encoder((string)$vv); + $qs .= '='.$encoder((string) $vv); } $qs .= '&'; } } } - return $qs ? (string)substr($qs, 0, -1) : ''; + return $qs ? (string) substr($qs, 0, -1) : ''; } /** diff --git a/sdks/php/templates/.php-cs-fixer.dist.php b/sdks/php/templates/.php-cs-fixer.dist.php index a8ff32efd..7a9234f44 100644 --- a/sdks/php/templates/.php-cs-fixer.dist.php +++ b/sdks/php/templates/.php-cs-fixer.dist.php @@ -17,89 +17,19 @@ ; $config = new PhpCsFixer\Config(); -$config->setParallelConfig( - PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect() -); return $config->setRules([ - '@PhpCsFixer' => true, - '@Symfony' => true, - '@DoctrineAnnotation' => true, - 'binary_operator_spaces' => [ - 'operators' => [ - '=>' => null, - ], - ], - 'blank_line_before_statement' => [ - 'statements' => [], - ], - 'blank_line_after_opening_tag' => false, - 'cast_spaces' => [ - 'space' => 'none', - ], - 'class_definition' => [ - 'inline_constructor_arguments' => false, - 'space_before_parenthesis' => true, - ], - 'concat_space' => [ - 'spacing' => 'one', - ], - 'nullable_type_declaration_for_default_null_value' => false, - 'declare_parentheses' => true, - 'echo_tag_syntax' => [ - 'format' => 'short', - 'shorten_simple_statements_only' => true, - ], - 'fully_qualified_strict_types' => true, - 'global_namespace_import' => true, - 'general_phpdoc_annotation_remove' => [ - 'annotations' => [ - 'author', 'package', 'subpackage', 'version', - ], - ], - 'increment_style' => false, - 'multiline_whitespace_before_semicolons' => [ - 'strategy' => 'no_multi_line', - ], - 'ordered_imports' => [ - 'imports_order' => [ - 'class', 'function', 'const', - ], - 'sort_algorithm' => 'alpha', - ], - 'no_superfluous_phpdoc_tags' => [ - 'allow_mixed' => true, - 'allow_unused_params' => true, - 'remove_inheritdoc' => true, - ], - 'phpdoc_align' => [ - 'tags' => [ - 'method', 'param', 'property', 'return', 'type', 'var', - ], - ], - 'phpdoc_line_span' => [ - 'property' => 'single', - ], - 'phpdoc_separation' => false, - 'phpdoc_summary' => false, - 'phpdoc_to_comment' => false, - 'phpdoc_to_param_type' => [ - 'scalar_types' => true, - 'union_types' => false, - ], - 'php_unit_internal_class' => false, - 'php_unit_test_class_requires_covers' => false, - 'single_line_throw' => false, - 'statement_indentation' => [ - 'stick_comment_to_next_continuous_control_statement' => false, - ], - 'visibility_required' => [ - 'elements' => ['method', 'property'], - ], - 'yoda_style' => false, - 'trailing_comma_in_multiline' => [ - 'after_heredoc' => true, - ], -]) + '@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) ->setRiskyAllowed(true) ; diff --git a/sdks/php/templates/Configuration.mustache b/sdks/php/templates/Configuration.mustache index 1dadde97c..384dcfbcf 100644 --- a/sdks/php/templates/Configuration.mustache +++ b/sdks/php/templates/Configuration.mustache @@ -555,7 +555,7 @@ class Configuration * @param array|null $variables hash of variable and the corresponding value (optional) * @return string URL based on host settings */ - public static function getHostString(array $hostSettings, $hostIndex, array $variables = null) + public static function getHostString(array $hostSettings, $hostIndex, ?array $variables = null) { if (null === $variables) { $variables = []; diff --git a/sdks/php/templates/HeaderSelector.mustache b/sdks/php/templates/HeaderSelector.mustache index 1921b0610..d5c284cfe 100644 --- a/sdks/php/templates/HeaderSelector.mustache +++ b/sdks/php/templates/HeaderSelector.mustache @@ -76,7 +76,7 @@ class HeaderSelector } # 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); + $headersWithJson = $this->selectJsonMimeList($accept); if (count($headersWithJson) === 0) { return implode(',', $accept); } @@ -86,6 +86,34 @@ class HeaderSelector return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson); } + /** + * Detects whether a string contains a valid JSON mime type + * + * @param string $searchString + * @return bool + */ + public function isJsonMime(string $searchString): bool + { + return preg_match('~^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)~', $searchString) === 1; + } + + /** + * Select all items from a list containing a JSON mime type + * + * @param array $mimeList + * @return array + */ + private function selectJsonMimeList(array $mimeList): array { + $jsonMimeList = []; + foreach ($mimeList as $mime) { + if($this->isJsonMime($mime)) { + $jsonMimeList[] = $mime; + } + } + return $jsonMimeList; + } + + /** * Create an Accept header string from the given "Accept" headers array, recalculating all weights * diff --git a/sdks/php/templates/ObjectSerializer.mustache b/sdks/php/templates/ObjectSerializer.mustache index 281ed61db..4437c693c 100644 --- a/sdks/php/templates/ObjectSerializer.mustache +++ b/sdks/php/templates/ObjectSerializer.mustache @@ -57,8 +57,8 @@ class ObjectSerializer {{#useCustomTemplateCode}} * @param string|int|object|array|mixed $data the data to serialize {{/useCustomTemplateCode}} - * @param string $type the OpenAPIToolsType of the data - * @param string $format the format of the OpenAPITools type of the data + * @param string|null $type the OpenAPIToolsType of the data + * @param string|null $format the format of the OpenAPITools type of the data * * @return scalar|object|array|null serialized form of $data */ @@ -207,6 +207,10 @@ class ObjectSerializer case 'boolean': return !in_array($value, [false, 0], true); + # For string values, '' is considered empty. + case 'string': + return $value === ''; + # For all the other types, any value at this point can be considered empty. default: return true; @@ -428,7 +432,7 @@ class ObjectSerializer * @param string|int|object|array|mixed $data object or primitive to be deserialized {{/useCustomTemplateCode}} * @param string $class class name is passed as a string - * @param string[] $httpHeaders HTTP headers + * @param string[]|null $httpHeaders HTTP headers * * @return object|array|null a single or an array of $class instances */ diff --git a/sdks/php/templates/api.mustache b/sdks/php/templates/api.mustache index 927ce19e3..cbcd7efb7 100644 --- a/sdks/php/templates/api.mustache +++ b/sdks/php/templates/api.mustache @@ -86,10 +86,10 @@ use Psr\Http\Message\ResponseInterface; * @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, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { {{/useCustomTemplateCode}} {{#useCustomTemplateCode}} @@ -100,13 +100,16 @@ use Psr\Http\Message\ResponseInterface; * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - Configuration $config = null, - ClientInterface $client = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?Configuration $config = null, + ?ClientInterface $client = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { {{/useCustomTemplateCode}} $this->client = $client ?: new Client(); + {{^useCustomTemplateCode}} + $this->config = $config ?: Configuration::getDefaultConfiguration(); + {{/useCustomTemplateCode}} $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); $this->hostIndex = $hostIndex; @@ -193,7 +196,7 @@ use Psr\Http\Message\ResponseInterface; {{/-last}} {{/servers}} {{#allParams}} - * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + * @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}}{{#description}} {{.}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} {{^useCustomTemplateCode}} {{#servers}} @@ -262,7 +265,7 @@ use Psr\Http\Message\ResponseInterface; {{/-last}} {{/servers}} {{#allParams}} - * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + * @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} {{#servers}} {{#-first}} @@ -311,18 +314,6 @@ use Psr\Http\Message\ResponseInterface; $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() - ); - } {{#returnType}} {{#useCustomTemplateCode}} {{#responses}}{{#dataType}}{{#isRange}} @@ -375,6 +366,19 @@ use Psr\Http\Message\ResponseInterface; {{/-last}} {{/responses}} + 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() + ); + } + $returnType = '{{{returnType}}}'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -469,7 +473,7 @@ use Psr\Http\Message\ResponseInterface; {{/-last}} {{/servers}} {{#allParams}} - * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + * @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} {{#servers}} {{#-first}} @@ -534,7 +538,7 @@ use Psr\Http\Message\ResponseInterface; {{/-last}} {{/servers}} {{#allParams}} - * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + * @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} {{#servers}} {{#-first}} @@ -627,7 +631,7 @@ use Psr\Http\Message\ResponseInterface; {{/-last}} {{/servers}} {{#allParams}} - * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + * @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} {{#servers}} {{#-first}} @@ -780,6 +784,11 @@ use Psr\Http\Message\ResponseInterface; } {{/formParams}} + {{^useCustomTemplateCode}} + {{#isMultipart}} + $multipart = true; + {{/isMultipart}} + {{/useCustomTemplateCode}} $headers = $this->headerSelector->selectHeaders( {{^useCustomTemplateCode}} [{{#produces}}'{{{mediaType}}}', {{/produces}}], diff --git a/sdks/php/templates/libraries/psr-18/ApiException.mustache b/sdks/php/templates/libraries/psr-18/ApiException.mustache index 336d8f7c5..1b7d1a65a 100644 --- a/sdks/php/templates/libraries/psr-18/ApiException.mustache +++ b/sdks/php/templates/libraries/psr-18/ApiException.mustache @@ -58,8 +58,8 @@ class ApiException extends RequestException public function __construct( $message, RequestInterface $request, - ResponseInterface $response = null, - Exception $previous = null + ?ResponseInterface $response = null, + ?Exception $previous = null ) { parent::__construct($message, $request, $previous); if ($response) { @@ -90,7 +90,7 @@ class ApiException extends RequestException } /** - * Sets the deseralized response object (during deserialization) + * Sets the deserialized response object (during deserialization) * {{^useCustomTemplateCode}} * @param mixed $obj Deserialized response object @@ -108,7 +108,7 @@ class ApiException extends RequestException } /** - * Gets the deseralized response object (during deserialization) + * Gets the deserialized response object (during deserialization) * * @return mixed the deserialized response object */ diff --git a/sdks/php/templates/libraries/psr-18/api.mustache b/sdks/php/templates/libraries/psr-18/api.mustache index 6138ab176..7b286d94d 100644 --- a/sdks/php/templates/libraries/psr-18/api.mustache +++ b/sdks/php/templates/libraries/psr-18/api.mustache @@ -95,13 +95,13 @@ use function sprintf; protected $streamFactory; public function __construct( - ClientInterface $httpClient = null, - Configuration $config = null, - HttpAsyncClient $httpAsyncClient = null, - UriFactoryInterface $uriFactory = null, - RequestFactoryInterface $requestFactory = null, - StreamFactoryInterface $streamFactory = null, - HeaderSelector $selector = null, + ?ClientInterface $httpClient = null, + ?Configuration $config = null, + ?HttpAsyncClient $httpAsyncClient = null, + ?UriFactoryInterface $uriFactory = null, + ?RequestFactoryInterface $requestFactory = null, + ?StreamFactoryInterface $streamFactory = null, + ?HeaderSelector $selector = null, ?array $plugins = null, $hostIndex = 0 ) { @@ -181,7 +181,7 @@ use function sprintf; {{/vendorExtensions.x-group-parameters}} {{#servers}} {{#-first}} - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. {{/-first}} * URL: {{{url}}} {{#-last}} @@ -219,7 +219,7 @@ use function sprintf; {{/vendorExtensions.x-group-parameters}} {{#servers}} {{#-first}} - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. {{/-first}} * URL: {{{url}}} {{#-last}} @@ -342,7 +342,7 @@ use function sprintf; {{/vendorExtensions.x-group-parameters}} {{#servers}} {{#-first}} - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. {{/-first}} * URL: {{{url}}} {{#-last}} @@ -383,7 +383,7 @@ use function sprintf; {{/vendorExtensions.x-group-parameters}} {{#servers}} {{#-first}} - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. {{/-first}} * URL: {{{url}}} {{#-last}} @@ -448,7 +448,7 @@ use function sprintf; {{/vendorExtensions.x-group-parameters}} {{#servers}} {{#-first}} - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. {{/-first}} * URL: {{{url}}} {{#-last}} @@ -613,7 +613,7 @@ use function sprintf; // for model (json/xml) {{#bodyParams}} if (isset(${{paramName}})) { - if ($headers['Content-Type'] === 'application/json') { + if ($this->headerSelector->isJsonMime($headers['Content-Type'])) { $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization(${{paramName}})); } else { $httpBody = ${{paramName}}; @@ -637,7 +637,7 @@ use function sprintf; // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($this->headerSelector->isJsonMime($headers['Content-Type'])) { $httpBody = json_encode($formParams); } else { diff --git a/sdks/php/templates/model_enum.mustache b/sdks/php/templates/model_enum.mustache index 77001f2e6..86d022506 100644 --- a/sdks/php/templates/model_enum.mustache +++ b/sdks/php/templates/model_enum.mustache @@ -5,7 +5,12 @@ class {{classname}} */ {{#allowableValues}} {{#enumVars}} - public const {{^isString}}NUMBER_{{/isString}}{{{name}}} = {{{value}}}; + {{#enumDescription}} + /** + * {{enumDescription}} + */ + {{/enumDescription}} + public const {{{name}}} = {{{value}}}; {{/enumVars}} {{/allowableValues}} @@ -18,7 +23,7 @@ class {{classname}} return [ {{#allowableValues}} {{#enumVars}} - self::{{^isString}}NUMBER_{{/isString}}{{{name}}}{{^-last}}, + self::{{{name}}}{{^-last}}, {{/-last}} {{/enumVars}} {{/allowableValues}} diff --git a/sdks/php/templates/model_generic.mustache b/sdks/php/templates/model_generic.mustache index 3b213dd3b..8838e1837 100644 --- a/sdks/php/templates/model_generic.mustache +++ b/sdks/php/templates/model_generic.mustache @@ -231,10 +231,10 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { {{#parentSchema}} parent::__construct($data); @@ -452,6 +452,10 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par $allowedValues = $this->{{getter}}AllowableValues(); {{^isContainer}} if ({{#isNullable}}!is_null(${{name}}) && {{/isNullable}}!in_array(${{{name}}}, $allowedValues, true)) { + {{#enumUnknownDefaultCase}} + ${{name}} = {{#allowableValues}}{{#enumVars}}{{#-last}}self::{{enumName}}_{{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}} + {{/enumUnknownDefaultCase}} + {{^enumUnknownDefaultCase}} throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for '{{name}}', must be one of '%s'", @@ -459,6 +463,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par implode("', '", $allowedValues) ) ); + {{/enumUnknownDefaultCase}} } {{/isContainer}} {{#isContainer}} From 98a4d62f5bb9a8cb0cdc3d3b27b97629e37e6d5b Mon Sep 17 00:00:00 2001 From: Monica Auriemma Date: Thu, 6 Mar 2025 11:09:32 -0500 Subject: [PATCH 2/8] revert changes --- sdks/php/.php-cs-fixer.dist.php | 94 ++++++++++++++++++++++++++++----- 1 file changed, 82 insertions(+), 12 deletions(-) diff --git a/sdks/php/.php-cs-fixer.dist.php b/sdks/php/.php-cs-fixer.dist.php index 7a9234f44..a8ff32efd 100644 --- a/sdks/php/.php-cs-fixer.dist.php +++ b/sdks/php/.php-cs-fixer.dist.php @@ -17,19 +17,89 @@ ; $config = new PhpCsFixer\Config(); +$config->setParallelConfig( + PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect() +); 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, - ]) + '@PhpCsFixer' => true, + '@Symfony' => true, + '@DoctrineAnnotation' => true, + 'binary_operator_spaces' => [ + 'operators' => [ + '=>' => null, + ], + ], + 'blank_line_before_statement' => [ + 'statements' => [], + ], + 'blank_line_after_opening_tag' => false, + 'cast_spaces' => [ + 'space' => 'none', + ], + 'class_definition' => [ + 'inline_constructor_arguments' => false, + 'space_before_parenthesis' => true, + ], + 'concat_space' => [ + 'spacing' => 'one', + ], + 'nullable_type_declaration_for_default_null_value' => false, + 'declare_parentheses' => true, + 'echo_tag_syntax' => [ + 'format' => 'short', + 'shorten_simple_statements_only' => true, + ], + 'fully_qualified_strict_types' => true, + 'global_namespace_import' => true, + 'general_phpdoc_annotation_remove' => [ + 'annotations' => [ + 'author', 'package', 'subpackage', 'version', + ], + ], + 'increment_style' => false, + 'multiline_whitespace_before_semicolons' => [ + 'strategy' => 'no_multi_line', + ], + 'ordered_imports' => [ + 'imports_order' => [ + 'class', 'function', 'const', + ], + 'sort_algorithm' => 'alpha', + ], + 'no_superfluous_phpdoc_tags' => [ + 'allow_mixed' => true, + 'allow_unused_params' => true, + 'remove_inheritdoc' => true, + ], + 'phpdoc_align' => [ + 'tags' => [ + 'method', 'param', 'property', 'return', 'type', 'var', + ], + ], + 'phpdoc_line_span' => [ + 'property' => 'single', + ], + 'phpdoc_separation' => false, + 'phpdoc_summary' => false, + 'phpdoc_to_comment' => false, + 'phpdoc_to_param_type' => [ + 'scalar_types' => true, + 'union_types' => false, + ], + 'php_unit_internal_class' => false, + 'php_unit_test_class_requires_covers' => false, + 'single_line_throw' => false, + 'statement_indentation' => [ + 'stick_comment_to_next_continuous_control_statement' => false, + ], + 'visibility_required' => [ + 'elements' => ['method', 'property'], + ], + 'yoda_style' => false, + 'trailing_comma_in_multiline' => [ + 'after_heredoc' => true, + ], +]) ->setFinder($finder) ->setRiskyAllowed(true) ; From e20e791534bb4b09a324ee32690476afc9391bbf Mon Sep 17 00:00:00 2001 From: Monica Auriemma Date: Thu, 6 Mar 2025 11:46:35 -0500 Subject: [PATCH 3/8] reverting changes --- sdks/php/.php-cs-fixer.dist.php | 1 + 1 file changed, 1 insertion(+) diff --git a/sdks/php/.php-cs-fixer.dist.php b/sdks/php/.php-cs-fixer.dist.php index a8ff32efd..718ccafc5 100644 --- a/sdks/php/.php-cs-fixer.dist.php +++ b/sdks/php/.php-cs-fixer.dist.php @@ -16,6 +16,7 @@ ->exclude('test_fixtures') ; + $config = new PhpCsFixer\Config(); $config->setParallelConfig( PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect() From 7d883381cbdbfd23601a446f5755ac89d6210ec3 Mon Sep 17 00:00:00 2001 From: Monica Auriemma Date: Thu, 6 Mar 2025 12:06:19 -0500 Subject: [PATCH 4/8] revert correct file --- sdks/php/templates/.php-cs-fixer.dist.php | 94 ++++++++++++++++++++--- 1 file changed, 82 insertions(+), 12 deletions(-) diff --git a/sdks/php/templates/.php-cs-fixer.dist.php b/sdks/php/templates/.php-cs-fixer.dist.php index 7a9234f44..a8ff32efd 100644 --- a/sdks/php/templates/.php-cs-fixer.dist.php +++ b/sdks/php/templates/.php-cs-fixer.dist.php @@ -17,19 +17,89 @@ ; $config = new PhpCsFixer\Config(); +$config->setParallelConfig( + PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect() +); 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, - ]) + '@PhpCsFixer' => true, + '@Symfony' => true, + '@DoctrineAnnotation' => true, + 'binary_operator_spaces' => [ + 'operators' => [ + '=>' => null, + ], + ], + 'blank_line_before_statement' => [ + 'statements' => [], + ], + 'blank_line_after_opening_tag' => false, + 'cast_spaces' => [ + 'space' => 'none', + ], + 'class_definition' => [ + 'inline_constructor_arguments' => false, + 'space_before_parenthesis' => true, + ], + 'concat_space' => [ + 'spacing' => 'one', + ], + 'nullable_type_declaration_for_default_null_value' => false, + 'declare_parentheses' => true, + 'echo_tag_syntax' => [ + 'format' => 'short', + 'shorten_simple_statements_only' => true, + ], + 'fully_qualified_strict_types' => true, + 'global_namespace_import' => true, + 'general_phpdoc_annotation_remove' => [ + 'annotations' => [ + 'author', 'package', 'subpackage', 'version', + ], + ], + 'increment_style' => false, + 'multiline_whitespace_before_semicolons' => [ + 'strategy' => 'no_multi_line', + ], + 'ordered_imports' => [ + 'imports_order' => [ + 'class', 'function', 'const', + ], + 'sort_algorithm' => 'alpha', + ], + 'no_superfluous_phpdoc_tags' => [ + 'allow_mixed' => true, + 'allow_unused_params' => true, + 'remove_inheritdoc' => true, + ], + 'phpdoc_align' => [ + 'tags' => [ + 'method', 'param', 'property', 'return', 'type', 'var', + ], + ], + 'phpdoc_line_span' => [ + 'property' => 'single', + ], + 'phpdoc_separation' => false, + 'phpdoc_summary' => false, + 'phpdoc_to_comment' => false, + 'phpdoc_to_param_type' => [ + 'scalar_types' => true, + 'union_types' => false, + ], + 'php_unit_internal_class' => false, + 'php_unit_test_class_requires_covers' => false, + 'single_line_throw' => false, + 'statement_indentation' => [ + 'stick_comment_to_next_continuous_control_statement' => false, + ], + 'visibility_required' => [ + 'elements' => ['method', 'property'], + ], + 'yoda_style' => false, + 'trailing_comma_in_multiline' => [ + 'after_heredoc' => true, + ], +]) ->setFinder($finder) ->setRiskyAllowed(true) ; From df9e410c1fe5122c43a624932d35daf8991bb81e Mon Sep 17 00:00:00 2001 From: Monica Auriemma Date: Thu, 6 Mar 2025 12:07:48 -0500 Subject: [PATCH 5/8] regenerated sdk --- sdks/php/.php-cs-fixer.dist.php | 1 - sdks/php/src/Api/AccountApi.php | 473 ++-- sdks/php/src/Api/ApiAppApi.php | 559 ++--- sdks/php/src/Api/BulkSendJobApi.php | 294 +-- sdks/php/src/Api/EmbeddedApi.php | 278 +-- sdks/php/src/Api/FaxApi.php | 551 ++--- sdks/php/src/Api/FaxLineApi.php | 797 +++--- sdks/php/src/Api/OAuthApi.php | 327 ++- sdks/php/src/Api/ReportApi.php | 165 +- sdks/php/src/Api/SignatureRequestApi.php | 2140 ++++++++--------- sdks/php/src/Api/TeamApi.php | 1047 ++++---- sdks/php/src/Api/TemplateApi.php | 1231 +++++----- sdks/php/src/Api/UnclaimedDraftApi.php | 478 ++-- sdks/php/src/ApiException.php | 28 +- sdks/php/src/Configuration.php | 105 +- sdks/php/src/EventCallbackHelper.php | 9 +- sdks/php/src/HeaderSelector.php | 70 +- sdks/php/src/Model/AccountCreateRequest.php | 166 +- sdks/php/src/Model/AccountCreateResponse.php | 162 +- sdks/php/src/Model/AccountGetResponse.php | 158 +- sdks/php/src/Model/AccountResponse.php | 210 +- sdks/php/src/Model/AccountResponseQuotas.php | 185 +- sdks/php/src/Model/AccountResponseUsage.php | 155 +- sdks/php/src/Model/AccountUpdateRequest.php | 166 +- sdks/php/src/Model/AccountVerifyRequest.php | 154 +- sdks/php/src/Model/AccountVerifyResponse.php | 162 +- .../Model/AccountVerifyResponseAccount.php | 158 +- sdks/php/src/Model/ApiAppCreateRequest.php | 199 +- sdks/php/src/Model/ApiAppGetResponse.php | 158 +- sdks/php/src/Model/ApiAppListResponse.php | 164 +- sdks/php/src/Model/ApiAppResponse.php | 192 +- sdks/php/src/Model/ApiAppResponseOAuth.php | 176 +- sdks/php/src/Model/ApiAppResponseOptions.php | 156 +- .../src/Model/ApiAppResponseOwnerAccount.php | 160 +- .../ApiAppResponseWhiteLabelingOptions.php | 208 +- sdks/php/src/Model/ApiAppUpdateRequest.php | 191 +- sdks/php/src/Model/BulkSendJobGetResponse.php | 168 +- ...ulkSendJobGetResponseSignatureRequests.php | 290 ++- .../php/src/Model/BulkSendJobListResponse.php | 164 +- sdks/php/src/Model/BulkSendJobResponse.php | 176 +- .../php/src/Model/BulkSendJobSendResponse.php | 158 +- sdks/php/src/Model/EmbeddedEditUrlRequest.php | 202 +- .../php/src/Model/EmbeddedEditUrlResponse.php | 158 +- .../Model/EmbeddedEditUrlResponseEmbedded.php | 164 +- .../php/src/Model/EmbeddedSignUrlResponse.php | 158 +- .../Model/EmbeddedSignUrlResponseEmbedded.php | 164 +- sdks/php/src/Model/ErrorResponse.php | 152 +- sdks/php/src/Model/ErrorResponseError.php | 166 +- sdks/php/src/Model/EventCallbackRequest.php | 164 +- .../src/Model/EventCallbackRequestEvent.php | 171 +- .../EventCallbackRequestEventMetadata.php | 173 +- sdks/php/src/Model/FaxGetResponse.php | 158 +- sdks/php/src/Model/FaxLineAddUserRequest.php | 160 +- .../Model/FaxLineAreaCodeGetCountryEnum.php | 14 +- .../Model/FaxLineAreaCodeGetProvinceEnum.php | 14 +- .../src/Model/FaxLineAreaCodeGetResponse.php | 152 +- .../src/Model/FaxLineAreaCodeGetStateEnum.php | 14 +- sdks/php/src/Model/FaxLineCreateRequest.php | 165 +- sdks/php/src/Model/FaxLineDeleteRequest.php | 152 +- sdks/php/src/Model/FaxLineListResponse.php | 160 +- .../src/Model/FaxLineRemoveUserRequest.php | 160 +- sdks/php/src/Model/FaxLineResponse.php | 156 +- sdks/php/src/Model/FaxLineResponseFaxLine.php | 168 +- sdks/php/src/Model/FaxListResponse.php | 156 +- sdks/php/src/Model/FaxResponse.php | 192 +- .../php/src/Model/FaxResponseTransmission.php | 161 +- sdks/php/src/Model/FaxSendRequest.php | 191 +- sdks/php/src/Model/FileResponse.php | 160 +- sdks/php/src/Model/FileResponseDataUri.php | 154 +- sdks/php/src/Model/ListInfoResponse.php | 176 +- sdks/php/src/Model/ModelInterface.php | 14 +- .../src/Model/OAuthTokenGenerateRequest.php | 178 +- .../src/Model/OAuthTokenRefreshRequest.php | 168 +- sdks/php/src/Model/OAuthTokenResponse.php | 172 +- sdks/php/src/Model/ReportCreateRequest.php | 177 +- sdks/php/src/Model/ReportCreateResponse.php | 158 +- sdks/php/src/Model/ReportResponse.php | 173 +- ...tBulkCreateEmbeddedWithTemplateRequest.php | 228 +- ...tureRequestBulkSendWithTemplateRequest.php | 228 +- .../SignatureRequestCreateEmbeddedRequest.php | 272 +-- ...questCreateEmbeddedWithTemplateRequest.php | 236 +- .../SignatureRequestEditEmbeddedRequest.php | 272 +-- ...RequestEditEmbeddedWithTemplateRequest.php | 236 +- .../src/Model/SignatureRequestEditRequest.php | 278 +-- ...ignatureRequestEditWithTemplateRequest.php | 244 +- .../src/Model/SignatureRequestGetResponse.php | 158 +- .../Model/SignatureRequestListResponse.php | 164 +- .../Model/SignatureRequestRemindRequest.php | 158 +- .../src/Model/SignatureRequestResponse.php | 290 ++- .../SignatureRequestResponseAttachment.php | 184 +- ...ignatureRequestResponseCustomFieldBase.php | 164 +- ...tureRequestResponseCustomFieldCheckbox.php | 153 +- ...ignatureRequestResponseCustomFieldText.php | 153 +- ...tureRequestResponseCustomFieldTypeEnum.php | 14 +- .../SignatureRequestResponseDataBase.php | 168 +- .../SignatureRequestResponseDataTypeEnum.php | 14 +- ...natureRequestResponseDataValueCheckbox.php | 159 +- ...eRequestResponseDataValueCheckboxMerge.php | 159 +- ...tureRequestResponseDataValueDateSigned.php | 159 +- ...natureRequestResponseDataValueDropdown.php | 159 +- ...natureRequestResponseDataValueInitials.php | 165 +- ...SignatureRequestResponseDataValueRadio.php | 159 +- ...atureRequestResponseDataValueSignature.php | 165 +- .../SignatureRequestResponseDataValueText.php | 159 +- ...atureRequestResponseDataValueTextMerge.php | 159 +- .../SignatureRequestResponseSignatures.php | 262 +- .../src/Model/SignatureRequestSendRequest.php | 282 +-- ...ignatureRequestSendWithTemplateRequest.php | 248 +- .../Model/SignatureRequestUpdateRequest.php | 166 +- sdks/php/src/Model/SubAttachment.php | 170 +- sdks/php/src/Model/SubBulkSignerList.php | 162 +- .../Model/SubBulkSignerListCustomField.php | 158 +- sdks/php/src/Model/SubCC.php | 158 +- sdks/php/src/Model/SubCustomField.php | 166 +- sdks/php/src/Model/SubEditorOptions.php | 160 +- sdks/php/src/Model/SubFieldOptions.php | 155 +- sdks/php/src/Model/SubFormFieldGroup.php | 160 +- sdks/php/src/Model/SubFormFieldRule.php | 185 +- sdks/php/src/Model/SubFormFieldRuleAction.php | 167 +- .../php/src/Model/SubFormFieldRuleTrigger.php | 165 +- .../Model/SubFormFieldsPerDocumentBase.php | 196 +- .../SubFormFieldsPerDocumentCheckbox.php | 161 +- .../SubFormFieldsPerDocumentCheckboxMerge.php | 149 +- .../SubFormFieldsPerDocumentDateSigned.php | 160 +- .../SubFormFieldsPerDocumentDropdown.php | 177 +- .../SubFormFieldsPerDocumentFontEnum.php | 14 +- .../SubFormFieldsPerDocumentHyperlink.php | 172 +- .../SubFormFieldsPerDocumentInitials.php | 149 +- .../Model/SubFormFieldsPerDocumentRadio.php | 159 +- .../SubFormFieldsPerDocumentSignature.php | 149 +- .../Model/SubFormFieldsPerDocumentText.php | 196 +- .../SubFormFieldsPerDocumentTextMerge.php | 160 +- .../SubFormFieldsPerDocumentTypeEnum.php | 14 +- sdks/php/src/Model/SubMergeField.php | 159 +- sdks/php/src/Model/SubOAuth.php | 161 +- sdks/php/src/Model/SubOptions.php | 158 +- .../SubSignatureRequestGroupedSigners.php | 162 +- .../src/Model/SubSignatureRequestSigner.php | 189 +- .../SubSignatureRequestTemplateSigner.php | 187 +- sdks/php/src/Model/SubSigningOptions.php | 169 +- sdks/php/src/Model/SubTeamResponse.php | 160 +- sdks/php/src/Model/SubTemplateRole.php | 164 +- .../php/src/Model/SubUnclaimedDraftSigner.php | 166 +- .../Model/SubUnclaimedDraftTemplateSigner.php | 166 +- .../php/src/Model/SubWhiteLabelingOptions.php | 209 +- sdks/php/src/Model/TeamAddMemberRequest.php | 161 +- sdks/php/src/Model/TeamCreateRequest.php | 158 +- sdks/php/src/Model/TeamGetInfoResponse.php | 158 +- sdks/php/src/Model/TeamGetResponse.php | 158 +- sdks/php/src/Model/TeamInfoResponse.php | 172 +- sdks/php/src/Model/TeamInviteResponse.php | 188 +- sdks/php/src/Model/TeamInvitesResponse.php | 158 +- sdks/php/src/Model/TeamMemberResponse.php | 170 +- sdks/php/src/Model/TeamMembersResponse.php | 162 +- sdks/php/src/Model/TeamParentResponse.php | 160 +- .../php/src/Model/TeamRemoveMemberRequest.php | 171 +- sdks/php/src/Model/TeamResponse.php | 170 +- sdks/php/src/Model/TeamSubTeamsResponse.php | 162 +- sdks/php/src/Model/TeamUpdateRequest.php | 158 +- sdks/php/src/Model/TemplateAddUserRequest.php | 164 +- .../TemplateCreateEmbeddedDraftRequest.php | 282 +-- .../TemplateCreateEmbeddedDraftResponse.php | 158 +- ...ateCreateEmbeddedDraftResponseTemplate.php | 176 +- sdks/php/src/Model/TemplateCreateRequest.php | 246 +- sdks/php/src/Model/TemplateCreateResponse.php | 158 +- .../Model/TemplateCreateResponseTemplate.php | 158 +- sdks/php/src/Model/TemplateEditResponse.php | 154 +- sdks/php/src/Model/TemplateGetResponse.php | 158 +- sdks/php/src/Model/TemplateListResponse.php | 164 +- .../src/Model/TemplateRemoveUserRequest.php | 160 +- sdks/php/src/Model/TemplateResponse.php | 234 +- .../php/src/Model/TemplateResponseAccount.php | 186 +- .../Model/TemplateResponseAccountQuota.php | 176 +- sdks/php/src/Model/TemplateResponseCCRole.php | 158 +- .../src/Model/TemplateResponseDocument.php | 186 +- ...emplateResponseDocumentCustomFieldBase.php | 190 +- ...ateResponseDocumentCustomFieldCheckbox.php | 149 +- ...emplateResponseDocumentCustomFieldText.php | 171 +- .../TemplateResponseDocumentFieldGroup.php | 162 +- ...TemplateResponseDocumentFieldGroupRule.php | 160 +- .../TemplateResponseDocumentFormFieldBase.php | 188 +- ...plateResponseDocumentFormFieldCheckbox.php | 153 +- ...ateResponseDocumentFormFieldDateSigned.php | 153 +- ...plateResponseDocumentFormFieldDropdown.php | 153 +- ...lateResponseDocumentFormFieldHyperlink.php | 175 +- ...plateResponseDocumentFormFieldInitials.php | 153 +- ...TemplateResponseDocumentFormFieldRadio.php | 153 +- ...lateResponseDocumentFormFieldSignature.php | 153 +- .../TemplateResponseDocumentFormFieldText.php | 180 +- ...emplateResponseDocumentStaticFieldBase.php | 192 +- ...ateResponseDocumentStaticFieldCheckbox.php | 149 +- ...eResponseDocumentStaticFieldDateSigned.php | 149 +- ...ateResponseDocumentStaticFieldDropdown.php | 149 +- ...teResponseDocumentStaticFieldHyperlink.php | 149 +- ...ateResponseDocumentStaticFieldInitials.php | 149 +- ...mplateResponseDocumentStaticFieldRadio.php | 149 +- ...teResponseDocumentStaticFieldSignature.php | 149 +- ...emplateResponseDocumentStaticFieldText.php | 149 +- .../TemplateResponseFieldAvgTextLength.php | 164 +- .../src/Model/TemplateResponseSignerRole.php | 164 +- .../src/Model/TemplateUpdateFilesRequest.php | 191 +- .../src/Model/TemplateUpdateFilesResponse.php | 152 +- .../TemplateUpdateFilesResponseTemplate.php | 164 +- .../UnclaimedDraftCreateEmbeddedRequest.php | 333 ++- ...DraftCreateEmbeddedWithTemplateRequest.php | 310 ++- .../src/Model/UnclaimedDraftCreateRequest.php | 275 +-- .../Model/UnclaimedDraftCreateResponse.php | 158 +- .../UnclaimedDraftEditAndResendRequest.php | 188 +- sdks/php/src/Model/UnclaimedDraftResponse.php | 184 +- sdks/php/src/Model/WarningResponse.php | 156 +- sdks/php/src/ObjectSerializer.php | 300 ++- 211 files changed, 18271 insertions(+), 23260 deletions(-) diff --git a/sdks/php/.php-cs-fixer.dist.php b/sdks/php/.php-cs-fixer.dist.php index 718ccafc5..a8ff32efd 100644 --- a/sdks/php/.php-cs-fixer.dist.php +++ b/sdks/php/.php-cs-fixer.dist.php @@ -16,7 +16,6 @@ ->exclude('test_fixtures') ; - $config = new PhpCsFixer\Config(); $config->setParallelConfig( PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect() diff --git a/sdks/php/src/Api/AccountApi.php b/sdks/php/src/Api/AccountApi.php index e6a1a1c0e..700b22166 100644 --- a/sdks/php/src/Api/AccountApi.php +++ b/sdks/php/src/Api/AccountApi.php @@ -1,13 +1,10 @@ [ 'application/json', @@ -93,10 +85,7 @@ class AccountApi protected $response; /** - * @param Configuration $config - * @param ClientInterface $client - * @param HeaderSelector $selector - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( ?Configuration $config = null, @@ -116,7 +105,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex($hostIndex): void + public function setHostIndex(int $hostIndex): void { $this->hostIndex = $hostIndex; } @@ -153,13 +142,13 @@ public function getResponse() * * Create Account * - * @param Model\AccountCreateRequest $account_create_request account_create_request (required) + * @param Model\AccountCreateRequest $account_create_request account_create_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\AccountCreateResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function accountCreate($account_create_request) + public function accountCreate(Model\AccountCreateRequest $account_create_request) { list($response) = $this->accountCreateWithHttpInfo($account_create_request); return $response; @@ -170,15 +159,15 @@ public function accountCreate($account_create_request) * * Create Account * - * @param Model\AccountCreateRequest $account_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation + * @param Model\AccountCreateRequest $account_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\AccountCreateResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::accountCreate. This method will eventually become unavailable */ - public function accountCreateWithHttpInfo($account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) + public function accountCreateWithHttpInfo(Model\AccountCreateRequest $account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) { $request = $this->accountCreateRequest($account_create_request, $contentType); @@ -190,14 +179,14 @@ public function accountCreateWithHttpInfo($account_create_request, string $conte } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -205,7 +194,6 @@ public function accountCreateWithHttpInfo($account_create_request, string $conte $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -215,17 +203,16 @@ public function accountCreateWithHttpInfo($account_create_request, string $conte return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\AccountCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\AccountCreateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -242,9 +229,8 @@ public function accountCreateWithHttpInfo($account_create_request, string $conte return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\AccountCreateResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -252,23 +238,23 @@ public function accountCreateWithHttpInfo($account_create_request, string $conte sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\AccountCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -285,11 +271,9 @@ public function accountCreateWithHttpInfo($account_create_request, string $conte return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -302,7 +286,6 @@ public function accountCreateWithHttpInfo($account_create_request, string $conte ); $e->setResponseObject($data); break; - } throw $e; } @@ -313,14 +296,14 @@ public function accountCreateWithHttpInfo($account_create_request, string $conte * * Create Account * - * @param Model\AccountCreateRequest $account_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation + * @param Model\AccountCreateRequest $account_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::accountCreate. This method will eventually become unavailable */ - public function accountCreateAsync($account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) + public function accountCreateAsync(Model\AccountCreateRequest $account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) { return $this->accountCreateAsyncWithHttpInfo($account_create_request, $contentType) ->then( @@ -335,14 +318,14 @@ function ($response) { * * Create Account * - * @param Model\AccountCreateRequest $account_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation + * @param Model\AccountCreateRequest $account_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::accountCreate. This method will eventually become unavailable */ - public function accountCreateAsyncWithHttpInfo($account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) + public function accountCreateAsyncWithHttpInfo(Model\AccountCreateRequest $account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) { $returnType = '\Dropbox\Sign\Model\AccountCreateResponse'; $request = $this->accountCreateRequest($account_create_request, $contentType); @@ -352,9 +335,9 @@ public function accountCreateAsyncWithHttpInfo($account_create_request, string $ ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -363,7 +346,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -377,7 +360,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -386,24 +369,22 @@ function ($exception) { /** * Create request for operation 'accountCreate' * - * @param Model\AccountCreateRequest $account_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation + * @param Model\AccountCreateRequest $account_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::accountCreate. This method will eventually become unavailable */ - public function accountCreateRequest($account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) + public function accountCreateRequest(Model\AccountCreateRequest $account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) { - // verify the required parameter 'account_create_request' is set if ($account_create_request === null || (is_array($account_create_request) && count($account_create_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $account_create_request when calling accountCreate' ); } - $resourcePath = '/account/create'; $formParams = []; $queryParams = []; @@ -417,11 +398,8 @@ public function accountCreateRequest($account_create_request, string $contentTyp $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -429,7 +407,7 @@ public function accountCreateRequest($account_create_request, string $contentTyp // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($account_create_request)); } else { $httpBody = $account_create_request; @@ -442,7 +420,7 @@ public function accountCreateRequest($account_create_request, string $contentTyp foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -459,9 +437,8 @@ public function accountCreateRequest($account_create_request, string $contentTyp $payloadHook('multipart', $multipartContents, $account_create_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -504,14 +481,14 @@ public function accountCreateRequest($account_create_request, string $contentTyp * * Get Account * - * @param string|null $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) - * @param string|null $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) + * @param string|null $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) + * @param string|null $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\AccountGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function accountGet($account_id = null, $email_address = null) + public function accountGet(?string $account_id = null, ?string $email_address = null) { list($response) = $this->accountGetWithHttpInfo($account_id, $email_address); return $response; @@ -522,16 +499,16 @@ public function accountGet($account_id = null, $email_address = null) * * Get Account * - * @param string|null $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) - * @param string|null $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation + * @param string|null $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) + * @param string|null $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\AccountGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::accountGet. This method will eventually become unavailable */ - public function accountGetWithHttpInfo($account_id = null, $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) + public function accountGetWithHttpInfo(?string $account_id = null, ?string $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) { $request = $this->accountGetRequest($account_id, $email_address, $contentType); @@ -543,14 +520,14 @@ public function accountGetWithHttpInfo($account_id = null, $email_address = null } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -558,7 +535,6 @@ public function accountGetWithHttpInfo($account_id = null, $email_address = null $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -568,17 +544,16 @@ public function accountGetWithHttpInfo($account_id = null, $email_address = null return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\AccountGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\AccountGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -595,9 +570,8 @@ public function accountGetWithHttpInfo($account_id = null, $email_address = null return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\AccountGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -605,23 +579,23 @@ public function accountGetWithHttpInfo($account_id = null, $email_address = null sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\AccountGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -638,11 +612,9 @@ public function accountGetWithHttpInfo($account_id = null, $email_address = null return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -655,7 +627,6 @@ public function accountGetWithHttpInfo($account_id = null, $email_address = null ); $e->setResponseObject($data); break; - } throw $e; } @@ -666,15 +637,15 @@ public function accountGetWithHttpInfo($account_id = null, $email_address = null * * Get Account * - * @param string|null $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) - * @param string|null $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation + * @param string|null $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) + * @param string|null $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::accountGet. This method will eventually become unavailable */ - public function accountGetAsync($account_id = null, $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) + public function accountGetAsync(?string $account_id = null, ?string $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) { return $this->accountGetAsyncWithHttpInfo($account_id, $email_address, $contentType) ->then( @@ -689,15 +660,15 @@ function ($response) { * * Get Account * - * @param string|null $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) - * @param string|null $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation + * @param string|null $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) + * @param string|null $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::accountGet. This method will eventually become unavailable */ - public function accountGetAsyncWithHttpInfo($account_id = null, $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) + public function accountGetAsyncWithHttpInfo(?string $account_id = null, ?string $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) { $returnType = '\Dropbox\Sign\Model\AccountGetResponse'; $request = $this->accountGetRequest($account_id, $email_address, $contentType); @@ -707,9 +678,9 @@ public function accountGetAsyncWithHttpInfo($account_id = null, $email_address = ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -718,7 +689,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -732,7 +703,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -741,20 +712,16 @@ function ($exception) { /** * Create request for operation 'accountGet' * - * @param string|null $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) - * @param string|null $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation + * @param string|null $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) + * @param string|null $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::accountGet. This method will eventually become unavailable */ - public function accountGetRequest($account_id = null, $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) + public function accountGetRequest(?string $account_id = null, ?string $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) { - - - - $resourcePath = '/account'; $formParams = []; $queryParams = []; @@ -781,11 +748,8 @@ public function accountGetRequest($account_id = null, $email_address = null, str false // required ) ?? []); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -799,7 +763,7 @@ public function accountGetRequest($account_id = null, $email_address = null, str foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -813,9 +777,8 @@ public function accountGetRequest($account_id = null, $email_address = null, str } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -858,13 +821,13 @@ public function accountGetRequest($account_id = null, $email_address = null, str * * Update Account * - * @param Model\AccountUpdateRequest $account_update_request account_update_request (required) + * @param Model\AccountUpdateRequest $account_update_request account_update_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\AccountGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function accountUpdate($account_update_request) + public function accountUpdate(Model\AccountUpdateRequest $account_update_request) { list($response) = $this->accountUpdateWithHttpInfo($account_update_request); return $response; @@ -875,15 +838,15 @@ public function accountUpdate($account_update_request) * * Update Account * - * @param Model\AccountUpdateRequest $account_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation + * @param Model\AccountUpdateRequest $account_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\AccountGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::accountUpdate. This method will eventually become unavailable */ - public function accountUpdateWithHttpInfo($account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) + public function accountUpdateWithHttpInfo(Model\AccountUpdateRequest $account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) { $request = $this->accountUpdateRequest($account_update_request, $contentType); @@ -895,14 +858,14 @@ public function accountUpdateWithHttpInfo($account_update_request, string $conte } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -910,7 +873,6 @@ public function accountUpdateWithHttpInfo($account_update_request, string $conte $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -920,17 +882,16 @@ public function accountUpdateWithHttpInfo($account_update_request, string $conte return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\AccountGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\AccountGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -947,9 +908,8 @@ public function accountUpdateWithHttpInfo($account_update_request, string $conte return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\AccountGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -957,23 +917,23 @@ public function accountUpdateWithHttpInfo($account_update_request, string $conte sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\AccountGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -990,11 +950,9 @@ public function accountUpdateWithHttpInfo($account_update_request, string $conte return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1007,7 +965,6 @@ public function accountUpdateWithHttpInfo($account_update_request, string $conte ); $e->setResponseObject($data); break; - } throw $e; } @@ -1018,14 +975,14 @@ public function accountUpdateWithHttpInfo($account_update_request, string $conte * * Update Account * - * @param Model\AccountUpdateRequest $account_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation + * @param Model\AccountUpdateRequest $account_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::accountUpdate. This method will eventually become unavailable */ - public function accountUpdateAsync($account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) + public function accountUpdateAsync(Model\AccountUpdateRequest $account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) { return $this->accountUpdateAsyncWithHttpInfo($account_update_request, $contentType) ->then( @@ -1040,14 +997,14 @@ function ($response) { * * Update Account * - * @param Model\AccountUpdateRequest $account_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation + * @param Model\AccountUpdateRequest $account_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::accountUpdate. This method will eventually become unavailable */ - public function accountUpdateAsyncWithHttpInfo($account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) + public function accountUpdateAsyncWithHttpInfo(Model\AccountUpdateRequest $account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) { $returnType = '\Dropbox\Sign\Model\AccountGetResponse'; $request = $this->accountUpdateRequest($account_update_request, $contentType); @@ -1057,9 +1014,9 @@ public function accountUpdateAsyncWithHttpInfo($account_update_request, string $ ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1068,7 +1025,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -1082,7 +1039,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1091,24 +1048,22 @@ function ($exception) { /** * Create request for operation 'accountUpdate' * - * @param Model\AccountUpdateRequest $account_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation + * @param Model\AccountUpdateRequest $account_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::accountUpdate. This method will eventually become unavailable */ - public function accountUpdateRequest($account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) + public function accountUpdateRequest(Model\AccountUpdateRequest $account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) { - // verify the required parameter 'account_update_request' is set if ($account_update_request === null || (is_array($account_update_request) && count($account_update_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $account_update_request when calling accountUpdate' ); } - $resourcePath = '/account'; $formParams = []; $queryParams = []; @@ -1122,11 +1077,8 @@ public function accountUpdateRequest($account_update_request, string $contentTyp $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1134,7 +1086,7 @@ public function accountUpdateRequest($account_update_request, string $contentTyp // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($account_update_request)); } else { $httpBody = $account_update_request; @@ -1147,7 +1099,7 @@ public function accountUpdateRequest($account_update_request, string $contentTyp foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1164,9 +1116,8 @@ public function accountUpdateRequest($account_update_request, string $contentTyp $payloadHook('multipart', $multipartContents, $account_update_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1209,13 +1160,13 @@ public function accountUpdateRequest($account_update_request, string $contentTyp * * Verify Account * - * @param Model\AccountVerifyRequest $account_verify_request account_verify_request (required) + * @param Model\AccountVerifyRequest $account_verify_request account_verify_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\AccountVerifyResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function accountVerify($account_verify_request) + public function accountVerify(Model\AccountVerifyRequest $account_verify_request) { list($response) = $this->accountVerifyWithHttpInfo($account_verify_request); return $response; @@ -1226,15 +1177,15 @@ public function accountVerify($account_verify_request) * * Verify Account * - * @param Model\AccountVerifyRequest $account_verify_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation + * @param Model\AccountVerifyRequest $account_verify_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\AccountVerifyResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::accountVerify. This method will eventually become unavailable */ - public function accountVerifyWithHttpInfo($account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) + public function accountVerifyWithHttpInfo(Model\AccountVerifyRequest $account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) { $request = $this->accountVerifyRequest($account_verify_request, $contentType); @@ -1246,14 +1197,14 @@ public function accountVerifyWithHttpInfo($account_verify_request, string $conte } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1261,7 +1212,6 @@ public function accountVerifyWithHttpInfo($account_verify_request, string $conte $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -1271,17 +1221,16 @@ public function accountVerifyWithHttpInfo($account_verify_request, string $conte return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\AccountVerifyResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\AccountVerifyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1298,9 +1247,8 @@ public function accountVerifyWithHttpInfo($account_verify_request, string $conte return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\AccountVerifyResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -1308,23 +1256,23 @@ public function accountVerifyWithHttpInfo($account_verify_request, string $conte sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\AccountVerifyResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1341,11 +1289,9 @@ public function accountVerifyWithHttpInfo($account_verify_request, string $conte return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1358,7 +1304,6 @@ public function accountVerifyWithHttpInfo($account_verify_request, string $conte ); $e->setResponseObject($data); break; - } throw $e; } @@ -1369,14 +1314,14 @@ public function accountVerifyWithHttpInfo($account_verify_request, string $conte * * Verify Account * - * @param Model\AccountVerifyRequest $account_verify_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation + * @param Model\AccountVerifyRequest $account_verify_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::accountVerify. This method will eventually become unavailable */ - public function accountVerifyAsync($account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) + public function accountVerifyAsync(Model\AccountVerifyRequest $account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) { return $this->accountVerifyAsyncWithHttpInfo($account_verify_request, $contentType) ->then( @@ -1391,14 +1336,14 @@ function ($response) { * * Verify Account * - * @param Model\AccountVerifyRequest $account_verify_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation + * @param Model\AccountVerifyRequest $account_verify_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::accountVerify. This method will eventually become unavailable */ - public function accountVerifyAsyncWithHttpInfo($account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) + public function accountVerifyAsyncWithHttpInfo(Model\AccountVerifyRequest $account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) { $returnType = '\Dropbox\Sign\Model\AccountVerifyResponse'; $request = $this->accountVerifyRequest($account_verify_request, $contentType); @@ -1408,9 +1353,9 @@ public function accountVerifyAsyncWithHttpInfo($account_verify_request, string $ ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1419,7 +1364,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -1433,7 +1378,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1442,24 +1387,22 @@ function ($exception) { /** * Create request for operation 'accountVerify' * - * @param Model\AccountVerifyRequest $account_verify_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation + * @param Model\AccountVerifyRequest $account_verify_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::accountVerify. This method will eventually become unavailable */ - public function accountVerifyRequest($account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) + public function accountVerifyRequest(Model\AccountVerifyRequest $account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) { - // verify the required parameter 'account_verify_request' is set if ($account_verify_request === null || (is_array($account_verify_request) && count($account_verify_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $account_verify_request when calling accountVerify' ); } - $resourcePath = '/account/verify'; $formParams = []; $queryParams = []; @@ -1473,11 +1416,8 @@ public function accountVerifyRequest($account_verify_request, string $contentTyp $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1485,7 +1425,7 @@ public function accountVerifyRequest($account_verify_request, string $contentTyp // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($account_verify_request)); } else { $httpBody = $account_verify_request; @@ -1498,7 +1438,7 @@ public function accountVerifyRequest($account_verify_request, string $contentTyp foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1515,9 +1455,8 @@ public function accountVerifyRequest($account_verify_request, string $contentTyp $payloadHook('multipart', $multipartContents, $account_verify_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1558,8 +1497,8 @@ public function accountVerifyRequest($account_verify_request, string $contentTyp /** * Create http client option * - * @throws \RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -1567,7 +1506,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -1583,8 +1522,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -1594,9 +1533,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); } return [ @@ -1615,8 +1554,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/ApiAppApi.php b/sdks/php/src/Api/ApiAppApi.php index d7817f60a..95b80a91a 100644 --- a/sdks/php/src/Api/ApiAppApi.php +++ b/sdks/php/src/Api/ApiAppApi.php @@ -1,13 +1,10 @@ [ 'application/json', @@ -98,10 +90,7 @@ class ApiAppApi protected $response; /** - * @param Configuration $config - * @param ClientInterface $client - * @param HeaderSelector $selector - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( ?Configuration $config = null, @@ -121,7 +110,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex($hostIndex): void + public function setHostIndex(int $hostIndex): void { $this->hostIndex = $hostIndex; } @@ -158,13 +147,13 @@ public function getResponse() * * Create API App * - * @param Model\ApiAppCreateRequest $api_app_create_request api_app_create_request (required) + * @param Model\ApiAppCreateRequest $api_app_create_request api_app_create_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\ApiAppGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function apiAppCreate($api_app_create_request) + public function apiAppCreate(Model\ApiAppCreateRequest $api_app_create_request) { list($response) = $this->apiAppCreateWithHttpInfo($api_app_create_request); return $response; @@ -175,15 +164,15 @@ public function apiAppCreate($api_app_create_request) * * Create API App * - * @param Model\ApiAppCreateRequest $api_app_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation + * @param Model\ApiAppCreateRequest $api_app_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\ApiAppGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppCreate. This method will eventually become unavailable */ - public function apiAppCreateWithHttpInfo($api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) + public function apiAppCreateWithHttpInfo(Model\ApiAppCreateRequest $api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) { $request = $this->apiAppCreateRequest($api_app_create_request, $contentType); @@ -195,14 +184,14 @@ public function apiAppCreateWithHttpInfo($api_app_create_request, string $conten } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -210,7 +199,6 @@ public function apiAppCreateWithHttpInfo($api_app_create_request, string $conten $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -220,17 +208,16 @@ public function apiAppCreateWithHttpInfo($api_app_create_request, string $conten return $result; } - switch ($statusCode) { case 201: if ('\Dropbox\Sign\Model\ApiAppGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\ApiAppGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -247,9 +234,8 @@ public function apiAppCreateWithHttpInfo($api_app_create_request, string $conten return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ApiAppGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -257,23 +243,23 @@ public function apiAppCreateWithHttpInfo($api_app_create_request, string $conten sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\ApiAppGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -290,11 +276,9 @@ public function apiAppCreateWithHttpInfo($api_app_create_request, string $conten return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -307,7 +291,6 @@ public function apiAppCreateWithHttpInfo($api_app_create_request, string $conten ); $e->setResponseObject($data); break; - } throw $e; } @@ -318,14 +301,14 @@ public function apiAppCreateWithHttpInfo($api_app_create_request, string $conten * * Create API App * - * @param Model\ApiAppCreateRequest $api_app_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation + * @param Model\ApiAppCreateRequest $api_app_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppCreate. This method will eventually become unavailable */ - public function apiAppCreateAsync($api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) + public function apiAppCreateAsync(Model\ApiAppCreateRequest $api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) { return $this->apiAppCreateAsyncWithHttpInfo($api_app_create_request, $contentType) ->then( @@ -340,14 +323,14 @@ function ($response) { * * Create API App * - * @param Model\ApiAppCreateRequest $api_app_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation + * @param Model\ApiAppCreateRequest $api_app_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppCreate. This method will eventually become unavailable */ - public function apiAppCreateAsyncWithHttpInfo($api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) + public function apiAppCreateAsyncWithHttpInfo(Model\ApiAppCreateRequest $api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) { $returnType = '\Dropbox\Sign\Model\ApiAppGetResponse'; $request = $this->apiAppCreateRequest($api_app_create_request, $contentType); @@ -357,9 +340,9 @@ public function apiAppCreateAsyncWithHttpInfo($api_app_create_request, string $c ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -368,7 +351,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -382,7 +365,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -391,24 +374,22 @@ function ($exception) { /** * Create request for operation 'apiAppCreate' * - * @param Model\ApiAppCreateRequest $api_app_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation + * @param Model\ApiAppCreateRequest $api_app_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppCreate. This method will eventually become unavailable */ - public function apiAppCreateRequest($api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) + public function apiAppCreateRequest(Model\ApiAppCreateRequest $api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) { - // verify the required parameter 'api_app_create_request' is set if ($api_app_create_request === null || (is_array($api_app_create_request) && count($api_app_create_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $api_app_create_request when calling apiAppCreate' ); } - $resourcePath = '/api_app'; $formParams = []; $queryParams = []; @@ -422,11 +403,8 @@ public function apiAppCreateRequest($api_app_create_request, string $contentType $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -434,7 +412,7 @@ public function apiAppCreateRequest($api_app_create_request, string $contentType // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($api_app_create_request)); } else { $httpBody = $api_app_create_request; @@ -447,7 +425,7 @@ public function apiAppCreateRequest($api_app_create_request, string $contentType foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -464,9 +442,8 @@ public function apiAppCreateRequest($api_app_create_request, string $contentType $payloadHook('multipart', $multipartContents, $api_app_create_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -509,13 +486,12 @@ public function apiAppCreateRequest($api_app_create_request, string $contentType * * Delete API App * - * @param string $client_id The client id of the API App to delete. (required) + * @param string $client_id The client id of the API App to delete. (required) * * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return void + * @throws InvalidArgumentException */ - public function apiAppDelete($client_id) + public function apiAppDelete(string $client_id) { $this->apiAppDeleteWithHttpInfo($client_id); } @@ -525,15 +501,15 @@ public function apiAppDelete($client_id) * * Delete API App * - * @param string $client_id The client id of the API App to delete. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation + * @param string $client_id The client id of the API App to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation * - * @throws 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) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppDelete. This method will eventually become unavailable */ - public function apiAppDeleteWithHttpInfo($client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) + public function apiAppDeleteWithHttpInfo(string $client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) { $request = $this->apiAppDeleteRequest($client_id, $contentType); @@ -545,14 +521,14 @@ public function apiAppDeleteWithHttpInfo($client_id, string $contentType = self: } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -560,16 +536,12 @@ public function apiAppDeleteWithHttpInfo($client_id, string $contentType = self: $statusCode = $response->getStatusCode(); - return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } switch ($e->getCode()) { - } throw $e; } @@ -580,14 +552,14 @@ public function apiAppDeleteWithHttpInfo($client_id, string $contentType = self: * * Delete API App * - * @param string $client_id The client id of the API App to delete. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation + * @param string $client_id The client id of the API App to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppDelete. This method will eventually become unavailable */ - public function apiAppDeleteAsync($client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) + public function apiAppDeleteAsync(string $client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) { return $this->apiAppDeleteAsyncWithHttpInfo($client_id, $contentType) ->then( @@ -602,14 +574,14 @@ function ($response) { * * Delete API App * - * @param string $client_id The client id of the API App to delete. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation + * @param string $client_id The client id of the API App to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppDelete. This method will eventually become unavailable */ - public function apiAppDeleteAsyncWithHttpInfo($client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) + public function apiAppDeleteAsyncWithHttpInfo(string $client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) { $returnType = ''; $request = $this->apiAppDeleteRequest($client_id, $contentType); @@ -617,7 +589,7 @@ public function apiAppDeleteAsyncWithHttpInfo($client_id, string $contentType = return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( - function ($response) use ($returnType) { + function ($response) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { @@ -631,7 +603,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -640,24 +612,22 @@ function ($exception) { /** * Create request for operation 'apiAppDelete' * - * @param string $client_id The client id of the API App to delete. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation + * @param string $client_id The client id of the API App to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppDelete. This method will eventually become unavailable */ - public function apiAppDeleteRequest($client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) + public function apiAppDeleteRequest(string $client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) { - // verify the required parameter 'client_id' is set if ($client_id === null || (is_array($client_id) && count($client_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $client_id when calling apiAppDelete' ); } - $resourcePath = '/api_app/{client_id}'; $formParams = []; $queryParams = []; @@ -665,20 +635,17 @@ public function apiAppDeleteRequest($client_id, string $contentType = self::cont $httpBody = ''; $multipart = false; - - // path params if ($client_id !== null) { $resourcePath = str_replace( - '{' . 'client_id' . '}', + '{client_id}', ObjectSerializer::toPathValue($client_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -692,7 +659,7 @@ public function apiAppDeleteRequest($client_id, string $contentType = self::cont foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -706,9 +673,8 @@ public function apiAppDeleteRequest($client_id, string $contentType = self::cont } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -751,13 +717,13 @@ public function apiAppDeleteRequest($client_id, string $contentType = self::cont * * Get API App * - * @param string $client_id The client id of the API App to retrieve. (required) + * @param string $client_id The client id of the API App to retrieve. (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\ApiAppGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function apiAppGet($client_id) + public function apiAppGet(string $client_id) { list($response) = $this->apiAppGetWithHttpInfo($client_id); return $response; @@ -768,15 +734,15 @@ public function apiAppGet($client_id) * * Get API App * - * @param string $client_id The client id of the API App to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation + * @param string $client_id The client id of the API App to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\ApiAppGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppGet. This method will eventually become unavailable */ - public function apiAppGetWithHttpInfo($client_id, string $contentType = self::contentTypes['apiAppGet'][0]) + public function apiAppGetWithHttpInfo(string $client_id, string $contentType = self::contentTypes['apiAppGet'][0]) { $request = $this->apiAppGetRequest($client_id, $contentType); @@ -788,14 +754,14 @@ public function apiAppGetWithHttpInfo($client_id, string $contentType = self::co } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -803,7 +769,6 @@ public function apiAppGetWithHttpInfo($client_id, string $contentType = self::co $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -813,17 +778,16 @@ public function apiAppGetWithHttpInfo($client_id, string $contentType = self::co return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\ApiAppGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\ApiAppGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -840,9 +804,8 @@ public function apiAppGetWithHttpInfo($client_id, string $contentType = self::co return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ApiAppGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -850,23 +813,23 @@ public function apiAppGetWithHttpInfo($client_id, string $contentType = self::co sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\ApiAppGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -883,11 +846,9 @@ public function apiAppGetWithHttpInfo($client_id, string $contentType = self::co return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -900,7 +861,6 @@ public function apiAppGetWithHttpInfo($client_id, string $contentType = self::co ); $e->setResponseObject($data); break; - } throw $e; } @@ -911,14 +871,14 @@ public function apiAppGetWithHttpInfo($client_id, string $contentType = self::co * * Get API App * - * @param string $client_id The client id of the API App to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation + * @param string $client_id The client id of the API App to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppGet. This method will eventually become unavailable */ - public function apiAppGetAsync($client_id, string $contentType = self::contentTypes['apiAppGet'][0]) + public function apiAppGetAsync(string $client_id, string $contentType = self::contentTypes['apiAppGet'][0]) { return $this->apiAppGetAsyncWithHttpInfo($client_id, $contentType) ->then( @@ -933,14 +893,14 @@ function ($response) { * * Get API App * - * @param string $client_id The client id of the API App to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation + * @param string $client_id The client id of the API App to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppGet. This method will eventually become unavailable */ - public function apiAppGetAsyncWithHttpInfo($client_id, string $contentType = self::contentTypes['apiAppGet'][0]) + public function apiAppGetAsyncWithHttpInfo(string $client_id, string $contentType = self::contentTypes['apiAppGet'][0]) { $returnType = '\Dropbox\Sign\Model\ApiAppGetResponse'; $request = $this->apiAppGetRequest($client_id, $contentType); @@ -950,9 +910,9 @@ public function apiAppGetAsyncWithHttpInfo($client_id, string $contentType = sel ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -961,7 +921,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -975,7 +935,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -984,24 +944,22 @@ function ($exception) { /** * Create request for operation 'apiAppGet' * - * @param string $client_id The client id of the API App to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation + * @param string $client_id The client id of the API App to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppGet. This method will eventually become unavailable */ - public function apiAppGetRequest($client_id, string $contentType = self::contentTypes['apiAppGet'][0]) + public function apiAppGetRequest(string $client_id, string $contentType = self::contentTypes['apiAppGet'][0]) { - // verify the required parameter 'client_id' is set if ($client_id === null || (is_array($client_id) && count($client_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $client_id when calling apiAppGet' ); } - $resourcePath = '/api_app/{client_id}'; $formParams = []; $queryParams = []; @@ -1009,20 +967,17 @@ public function apiAppGetRequest($client_id, string $contentType = self::content $httpBody = ''; $multipart = false; - - // path params if ($client_id !== null) { $resourcePath = str_replace( - '{' . 'client_id' . '}', + '{client_id}', ObjectSerializer::toPathValue($client_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1036,7 +991,7 @@ public function apiAppGetRequest($client_id, string $contentType = self::content foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1050,9 +1005,8 @@ public function apiAppGetRequest($client_id, string $contentType = self::content } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1095,14 +1049,14 @@ public function apiAppGetRequest($client_id, string $contentType = self::content * * List API Apps * - * @param int|null $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param int|null $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\ApiAppListResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function apiAppList($page = 1, $page_size = 20) + public function apiAppList(?int $page = 1, ?int $page_size = 20) { list($response) = $this->apiAppListWithHttpInfo($page, $page_size); return $response; @@ -1113,16 +1067,16 @@ public function apiAppList($page = 1, $page_size = 20) * * List API Apps * - * @param int|null $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation + * @param int|null $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\ApiAppListResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppList. This method will eventually become unavailable */ - public function apiAppListWithHttpInfo($page = 1, $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) + public function apiAppListWithHttpInfo(?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) { $request = $this->apiAppListRequest($page, $page_size, $contentType); @@ -1134,14 +1088,14 @@ public function apiAppListWithHttpInfo($page = 1, $page_size = 20, string $conte } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1149,7 +1103,6 @@ public function apiAppListWithHttpInfo($page = 1, $page_size = 20, string $conte $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -1159,17 +1112,16 @@ public function apiAppListWithHttpInfo($page = 1, $page_size = 20, string $conte return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\ApiAppListResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\ApiAppListResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1186,9 +1138,8 @@ public function apiAppListWithHttpInfo($page = 1, $page_size = 20, string $conte return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ApiAppListResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -1196,23 +1147,23 @@ public function apiAppListWithHttpInfo($page = 1, $page_size = 20, string $conte sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\ApiAppListResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1229,11 +1180,9 @@ public function apiAppListWithHttpInfo($page = 1, $page_size = 20, string $conte return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1246,7 +1195,6 @@ public function apiAppListWithHttpInfo($page = 1, $page_size = 20, string $conte ); $e->setResponseObject($data); break; - } throw $e; } @@ -1257,15 +1205,15 @@ public function apiAppListWithHttpInfo($page = 1, $page_size = 20, string $conte * * List API Apps * - * @param int|null $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation + * @param int|null $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppList. This method will eventually become unavailable */ - public function apiAppListAsync($page = 1, $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) + public function apiAppListAsync(?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) { return $this->apiAppListAsyncWithHttpInfo($page, $page_size, $contentType) ->then( @@ -1280,15 +1228,15 @@ function ($response) { * * List API Apps * - * @param int|null $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation + * @param int|null $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppList. This method will eventually become unavailable */ - public function apiAppListAsyncWithHttpInfo($page = 1, $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) + public function apiAppListAsyncWithHttpInfo(?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) { $returnType = '\Dropbox\Sign\Model\ApiAppListResponse'; $request = $this->apiAppListRequest($page, $page_size, $contentType); @@ -1298,9 +1246,9 @@ public function apiAppListAsyncWithHttpInfo($page = 1, $page_size = 20, string $ ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1309,7 +1257,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -1323,7 +1271,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1332,20 +1280,16 @@ function ($exception) { /** * Create request for operation 'apiAppList' * - * @param int|null $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation + * @param int|null $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppList. This method will eventually become unavailable */ - public function apiAppListRequest($page = 1, $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) + public function apiAppListRequest(?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) { - - - - $resourcePath = '/api_app/list'; $formParams = []; $queryParams = []; @@ -1372,11 +1316,8 @@ public function apiAppListRequest($page = 1, $page_size = 20, string $contentTyp false // required ) ?? []); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1390,7 +1331,7 @@ public function apiAppListRequest($page = 1, $page_size = 20, string $contentTyp foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1404,9 +1345,8 @@ public function apiAppListRequest($page = 1, $page_size = 20, string $contentTyp } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1449,14 +1389,14 @@ public function apiAppListRequest($page = 1, $page_size = 20, string $contentTyp * * Update API App * - * @param string $client_id The client id of the API App to update. (required) - * @param Model\ApiAppUpdateRequest $api_app_update_request api_app_update_request (required) + * @param string $client_id The client id of the API App to update. (required) + * @param Model\ApiAppUpdateRequest $api_app_update_request api_app_update_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\ApiAppGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function apiAppUpdate($client_id, $api_app_update_request) + public function apiAppUpdate(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request) { list($response) = $this->apiAppUpdateWithHttpInfo($client_id, $api_app_update_request); return $response; @@ -1467,16 +1407,16 @@ public function apiAppUpdate($client_id, $api_app_update_request) * * Update API App * - * @param string $client_id The client id of the API App to update. (required) - * @param Model\ApiAppUpdateRequest $api_app_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation + * @param string $client_id The client id of the API App to update. (required) + * @param Model\ApiAppUpdateRequest $api_app_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\ApiAppGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppUpdate. This method will eventually become unavailable */ - public function apiAppUpdateWithHttpInfo($client_id, $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) + public function apiAppUpdateWithHttpInfo(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) { $request = $this->apiAppUpdateRequest($client_id, $api_app_update_request, $contentType); @@ -1488,14 +1428,14 @@ public function apiAppUpdateWithHttpInfo($client_id, $api_app_update_request, st } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1503,7 +1443,6 @@ public function apiAppUpdateWithHttpInfo($client_id, $api_app_update_request, st $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -1513,17 +1452,16 @@ public function apiAppUpdateWithHttpInfo($client_id, $api_app_update_request, st return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\ApiAppGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\ApiAppGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1540,9 +1478,8 @@ public function apiAppUpdateWithHttpInfo($client_id, $api_app_update_request, st return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ApiAppGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -1550,23 +1487,23 @@ public function apiAppUpdateWithHttpInfo($client_id, $api_app_update_request, st sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\ApiAppGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1583,11 +1520,9 @@ public function apiAppUpdateWithHttpInfo($client_id, $api_app_update_request, st return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1600,7 +1535,6 @@ public function apiAppUpdateWithHttpInfo($client_id, $api_app_update_request, st ); $e->setResponseObject($data); break; - } throw $e; } @@ -1611,15 +1545,15 @@ public function apiAppUpdateWithHttpInfo($client_id, $api_app_update_request, st * * Update API App * - * @param string $client_id The client id of the API App to update. (required) - * @param Model\ApiAppUpdateRequest $api_app_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation + * @param string $client_id The client id of the API App to update. (required) + * @param Model\ApiAppUpdateRequest $api_app_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppUpdate. This method will eventually become unavailable */ - public function apiAppUpdateAsync($client_id, $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) + public function apiAppUpdateAsync(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) { return $this->apiAppUpdateAsyncWithHttpInfo($client_id, $api_app_update_request, $contentType) ->then( @@ -1634,15 +1568,15 @@ function ($response) { * * Update API App * - * @param string $client_id The client id of the API App to update. (required) - * @param Model\ApiAppUpdateRequest $api_app_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation + * @param string $client_id The client id of the API App to update. (required) + * @param Model\ApiAppUpdateRequest $api_app_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppUpdate. This method will eventually become unavailable */ - public function apiAppUpdateAsyncWithHttpInfo($client_id, $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) + public function apiAppUpdateAsyncWithHttpInfo(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) { $returnType = '\Dropbox\Sign\Model\ApiAppGetResponse'; $request = $this->apiAppUpdateRequest($client_id, $api_app_update_request, $contentType); @@ -1652,9 +1586,9 @@ public function apiAppUpdateAsyncWithHttpInfo($client_id, $api_app_update_reques ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1663,7 +1597,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -1677,7 +1611,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1686,32 +1620,30 @@ function ($exception) { /** * Create request for operation 'apiAppUpdate' * - * @param string $client_id The client id of the API App to update. (required) - * @param Model\ApiAppUpdateRequest $api_app_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation + * @param string $client_id The client id of the API App to update. (required) + * @param Model\ApiAppUpdateRequest $api_app_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::apiAppUpdate. This method will eventually become unavailable */ - public function apiAppUpdateRequest($client_id, $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) + public function apiAppUpdateRequest(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) { - // verify the required parameter 'client_id' is set if ($client_id === null || (is_array($client_id) && count($client_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $client_id when calling apiAppUpdate' ); } // verify the required parameter 'api_app_update_request' is set if ($api_app_update_request === null || (is_array($api_app_update_request) && count($api_app_update_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $api_app_update_request when calling apiAppUpdate' ); } - $resourcePath = '/api_app/{client_id}'; $formParams = []; $queryParams = []; @@ -1725,19 +1657,17 @@ public function apiAppUpdateRequest($client_id, $api_app_update_request, string $multipart = !empty($formParams); - // path params if ($client_id !== null) { $resourcePath = str_replace( - '{' . 'client_id' . '}', + '{client_id}', ObjectSerializer::toPathValue($client_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1745,7 +1675,7 @@ public function apiAppUpdateRequest($client_id, $api_app_update_request, string // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($api_app_update_request)); } else { $httpBody = $api_app_update_request; @@ -1758,7 +1688,7 @@ public function apiAppUpdateRequest($client_id, $api_app_update_request, string foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1775,9 +1705,8 @@ public function apiAppUpdateRequest($client_id, $api_app_update_request, string $payloadHook('multipart', $multipartContents, $api_app_update_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1818,8 +1747,8 @@ public function apiAppUpdateRequest($client_id, $api_app_update_request, string /** * Create http client option * - * @throws \RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -1827,7 +1756,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -1843,8 +1772,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -1854,9 +1783,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); } return [ @@ -1875,8 +1804,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/BulkSendJobApi.php b/sdks/php/src/Api/BulkSendJobApi.php index 24cd0689c..3c6bb7e79 100644 --- a/sdks/php/src/Api/BulkSendJobApi.php +++ b/sdks/php/src/Api/BulkSendJobApi.php @@ -1,13 +1,10 @@ [ 'application/json', @@ -87,10 +79,7 @@ class BulkSendJobApi protected $response; /** - * @param Configuration $config - * @param ClientInterface $client - * @param HeaderSelector $selector - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( ?Configuration $config = null, @@ -110,7 +99,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex($hostIndex): void + public function setHostIndex(int $hostIndex): void { $this->hostIndex = $hostIndex; } @@ -147,15 +136,15 @@ public function getResponse() * * Get Bulk Send Job * - * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) - * @param int|null $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) + * @param int|null $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\BulkSendJobGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function bulkSendJobGet($bulk_send_job_id, $page = 1, $page_size = 20) + public function bulkSendJobGet(string $bulk_send_job_id, ?int $page = 1, ?int $page_size = 20) { list($response) = $this->bulkSendJobGetWithHttpInfo($bulk_send_job_id, $page, $page_size); return $response; @@ -166,17 +155,17 @@ public function bulkSendJobGet($bulk_send_job_id, $page = 1, $page_size = 20) * * Get Bulk Send Job * - * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) - * @param int|null $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation + * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) + * @param int|null $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\BulkSendJobGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::bulkSendJobGet. This method will eventually become unavailable */ - public function bulkSendJobGetWithHttpInfo($bulk_send_job_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) + public function bulkSendJobGetWithHttpInfo(string $bulk_send_job_id, ?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) { $request = $this->bulkSendJobGetRequest($bulk_send_job_id, $page, $page_size, $contentType); @@ -188,14 +177,14 @@ public function bulkSendJobGetWithHttpInfo($bulk_send_job_id, $page = 1, $page_s } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -203,7 +192,6 @@ public function bulkSendJobGetWithHttpInfo($bulk_send_job_id, $page = 1, $page_s $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -213,17 +201,16 @@ public function bulkSendJobGetWithHttpInfo($bulk_send_job_id, $page = 1, $page_s return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\BulkSendJobGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\BulkSendJobGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -240,9 +227,8 @@ public function bulkSendJobGetWithHttpInfo($bulk_send_job_id, $page = 1, $page_s return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\BulkSendJobGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -250,23 +236,23 @@ public function bulkSendJobGetWithHttpInfo($bulk_send_job_id, $page = 1, $page_s sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\BulkSendJobGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -283,11 +269,9 @@ public function bulkSendJobGetWithHttpInfo($bulk_send_job_id, $page = 1, $page_s return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -300,7 +284,6 @@ public function bulkSendJobGetWithHttpInfo($bulk_send_job_id, $page = 1, $page_s ); $e->setResponseObject($data); break; - } throw $e; } @@ -311,16 +294,16 @@ public function bulkSendJobGetWithHttpInfo($bulk_send_job_id, $page = 1, $page_s * * Get Bulk Send Job * - * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) - * @param int|null $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation + * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) + * @param int|null $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::bulkSendJobGet. This method will eventually become unavailable */ - public function bulkSendJobGetAsync($bulk_send_job_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) + public function bulkSendJobGetAsync(string $bulk_send_job_id, ?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) { return $this->bulkSendJobGetAsyncWithHttpInfo($bulk_send_job_id, $page, $page_size, $contentType) ->then( @@ -335,16 +318,16 @@ function ($response) { * * Get Bulk Send Job * - * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) - * @param int|null $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation + * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) + * @param int|null $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::bulkSendJobGet. This method will eventually become unavailable */ - public function bulkSendJobGetAsyncWithHttpInfo($bulk_send_job_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) + public function bulkSendJobGetAsyncWithHttpInfo(string $bulk_send_job_id, ?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) { $returnType = '\Dropbox\Sign\Model\BulkSendJobGetResponse'; $request = $this->bulkSendJobGetRequest($bulk_send_job_id, $page, $page_size, $contentType); @@ -354,9 +337,9 @@ public function bulkSendJobGetAsyncWithHttpInfo($bulk_send_job_id, $page = 1, $p ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -365,7 +348,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -379,7 +362,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -388,28 +371,24 @@ function ($exception) { /** * Create request for operation 'bulkSendJobGet' * - * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) - * @param int|null $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation + * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) + * @param int|null $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::bulkSendJobGet. This method will eventually become unavailable */ - public function bulkSendJobGetRequest($bulk_send_job_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) + public function bulkSendJobGetRequest(string $bulk_send_job_id, ?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) { - // verify the required parameter 'bulk_send_job_id' is set if ($bulk_send_job_id === null || (is_array($bulk_send_job_id) && count($bulk_send_job_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $bulk_send_job_id when calling bulkSendJobGet' ); } - - - $resourcePath = '/bulk_send_job/{bulk_send_job_id}'; $formParams = []; $queryParams = []; @@ -436,19 +415,17 @@ public function bulkSendJobGetRequest($bulk_send_job_id, $page = 1, $page_size = false // required ) ?? []); - // path params if ($bulk_send_job_id !== null) { $resourcePath = str_replace( - '{' . 'bulk_send_job_id' . '}', + '{bulk_send_job_id}', ObjectSerializer::toPathValue($bulk_send_job_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -462,7 +439,7 @@ public function bulkSendJobGetRequest($bulk_send_job_id, $page = 1, $page_size = foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -476,9 +453,8 @@ public function bulkSendJobGetRequest($bulk_send_job_id, $page = 1, $page_size = } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -521,14 +497,14 @@ public function bulkSendJobGetRequest($bulk_send_job_id, $page = 1, $page_size = * * List Bulk Send Jobs * - * @param int|null $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param int|null $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\BulkSendJobListResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function bulkSendJobList($page = 1, $page_size = 20) + public function bulkSendJobList(?int $page = 1, ?int $page_size = 20) { list($response) = $this->bulkSendJobListWithHttpInfo($page, $page_size); return $response; @@ -539,16 +515,16 @@ public function bulkSendJobList($page = 1, $page_size = 20) * * List Bulk Send Jobs * - * @param int|null $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation + * @param int|null $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\BulkSendJobListResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::bulkSendJobList. This method will eventually become unavailable */ - public function bulkSendJobListWithHttpInfo($page = 1, $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) + public function bulkSendJobListWithHttpInfo(?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) { $request = $this->bulkSendJobListRequest($page, $page_size, $contentType); @@ -560,14 +536,14 @@ public function bulkSendJobListWithHttpInfo($page = 1, $page_size = 20, string $ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -575,7 +551,6 @@ public function bulkSendJobListWithHttpInfo($page = 1, $page_size = 20, string $ $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -585,17 +560,16 @@ public function bulkSendJobListWithHttpInfo($page = 1, $page_size = 20, string $ return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\BulkSendJobListResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\BulkSendJobListResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -612,9 +586,8 @@ public function bulkSendJobListWithHttpInfo($page = 1, $page_size = 20, string $ return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\BulkSendJobListResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -622,23 +595,23 @@ public function bulkSendJobListWithHttpInfo($page = 1, $page_size = 20, string $ sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\BulkSendJobListResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -655,11 +628,9 @@ public function bulkSendJobListWithHttpInfo($page = 1, $page_size = 20, string $ return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -672,7 +643,6 @@ public function bulkSendJobListWithHttpInfo($page = 1, $page_size = 20, string $ ); $e->setResponseObject($data); break; - } throw $e; } @@ -683,15 +653,15 @@ public function bulkSendJobListWithHttpInfo($page = 1, $page_size = 20, string $ * * List Bulk Send Jobs * - * @param int|null $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation + * @param int|null $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::bulkSendJobList. This method will eventually become unavailable */ - public function bulkSendJobListAsync($page = 1, $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) + public function bulkSendJobListAsync(?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) { return $this->bulkSendJobListAsyncWithHttpInfo($page, $page_size, $contentType) ->then( @@ -706,15 +676,15 @@ function ($response) { * * List Bulk Send Jobs * - * @param int|null $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation + * @param int|null $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::bulkSendJobList. This method will eventually become unavailable */ - public function bulkSendJobListAsyncWithHttpInfo($page = 1, $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) + public function bulkSendJobListAsyncWithHttpInfo(?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) { $returnType = '\Dropbox\Sign\Model\BulkSendJobListResponse'; $request = $this->bulkSendJobListRequest($page, $page_size, $contentType); @@ -724,9 +694,9 @@ public function bulkSendJobListAsyncWithHttpInfo($page = 1, $page_size = 20, str ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -735,7 +705,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -749,7 +719,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -758,20 +728,16 @@ function ($exception) { /** * Create request for operation 'bulkSendJobList' * - * @param int|null $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation + * @param int|null $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::bulkSendJobList. This method will eventually become unavailable */ - public function bulkSendJobListRequest($page = 1, $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) + public function bulkSendJobListRequest(?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) { - - - - $resourcePath = '/bulk_send_job/list'; $formParams = []; $queryParams = []; @@ -798,11 +764,8 @@ public function bulkSendJobListRequest($page = 1, $page_size = 20, string $conte false // required ) ?? []); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -816,7 +779,7 @@ public function bulkSendJobListRequest($page = 1, $page_size = 20, string $conte foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -830,9 +793,8 @@ public function bulkSendJobListRequest($page = 1, $page_size = 20, string $conte } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -873,8 +835,8 @@ public function bulkSendJobListRequest($page = 1, $page_size = 20, string $conte /** * Create http client option * - * @throws \RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -882,7 +844,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -898,8 +860,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -909,9 +871,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); } return [ @@ -930,8 +892,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/EmbeddedApi.php b/sdks/php/src/Api/EmbeddedApi.php index 94cf2ee3f..382228786 100644 --- a/sdks/php/src/Api/EmbeddedApi.php +++ b/sdks/php/src/Api/EmbeddedApi.php @@ -1,13 +1,10 @@ [ 'application/json', @@ -87,10 +79,7 @@ class EmbeddedApi protected $response; /** - * @param Configuration $config - * @param ClientInterface $client - * @param HeaderSelector $selector - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( ?Configuration $config = null, @@ -110,7 +99,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex($hostIndex): void + public function setHostIndex(int $hostIndex): void { $this->hostIndex = $hostIndex; } @@ -147,14 +136,14 @@ public function getResponse() * * Get Embedded Template Edit URL * - * @param string $template_id The id of the template to edit. (required) - * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request embedded_edit_url_request (required) + * @param string $template_id The id of the template to edit. (required) + * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request embedded_edit_url_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\EmbeddedEditUrlResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function embeddedEditUrl($template_id, $embedded_edit_url_request) + public function embeddedEditUrl(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request) { list($response) = $this->embeddedEditUrlWithHttpInfo($template_id, $embedded_edit_url_request); return $response; @@ -165,16 +154,16 @@ public function embeddedEditUrl($template_id, $embedded_edit_url_request) * * Get Embedded Template Edit URL * - * @param string $template_id The id of the template to edit. (required) - * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation + * @param string $template_id The id of the template to edit. (required) + * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\EmbeddedEditUrlResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::embeddedEditUrl. This method will eventually become unavailable */ - public function embeddedEditUrlWithHttpInfo($template_id, $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) + public function embeddedEditUrlWithHttpInfo(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) { $request = $this->embeddedEditUrlRequest($template_id, $embedded_edit_url_request, $contentType); @@ -186,14 +175,14 @@ public function embeddedEditUrlWithHttpInfo($template_id, $embedded_edit_url_req } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -201,7 +190,6 @@ public function embeddedEditUrlWithHttpInfo($template_id, $embedded_edit_url_req $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -211,17 +199,16 @@ public function embeddedEditUrlWithHttpInfo($template_id, $embedded_edit_url_req return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\EmbeddedEditUrlResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\EmbeddedEditUrlResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -238,9 +225,8 @@ public function embeddedEditUrlWithHttpInfo($template_id, $embedded_edit_url_req return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\EmbeddedEditUrlResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -248,23 +234,23 @@ public function embeddedEditUrlWithHttpInfo($template_id, $embedded_edit_url_req sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\EmbeddedEditUrlResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -281,11 +267,9 @@ public function embeddedEditUrlWithHttpInfo($template_id, $embedded_edit_url_req return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -298,7 +282,6 @@ public function embeddedEditUrlWithHttpInfo($template_id, $embedded_edit_url_req ); $e->setResponseObject($data); break; - } throw $e; } @@ -309,15 +292,15 @@ public function embeddedEditUrlWithHttpInfo($template_id, $embedded_edit_url_req * * Get Embedded Template Edit URL * - * @param string $template_id The id of the template to edit. (required) - * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation + * @param string $template_id The id of the template to edit. (required) + * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::embeddedEditUrl. This method will eventually become unavailable */ - public function embeddedEditUrlAsync($template_id, $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) + public function embeddedEditUrlAsync(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) { return $this->embeddedEditUrlAsyncWithHttpInfo($template_id, $embedded_edit_url_request, $contentType) ->then( @@ -332,15 +315,15 @@ function ($response) { * * Get Embedded Template Edit URL * - * @param string $template_id The id of the template to edit. (required) - * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation + * @param string $template_id The id of the template to edit. (required) + * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::embeddedEditUrl. This method will eventually become unavailable */ - public function embeddedEditUrlAsyncWithHttpInfo($template_id, $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) + public function embeddedEditUrlAsyncWithHttpInfo(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) { $returnType = '\Dropbox\Sign\Model\EmbeddedEditUrlResponse'; $request = $this->embeddedEditUrlRequest($template_id, $embedded_edit_url_request, $contentType); @@ -350,9 +333,9 @@ public function embeddedEditUrlAsyncWithHttpInfo($template_id, $embedded_edit_ur ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -361,7 +344,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -375,7 +358,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -384,32 +367,30 @@ function ($exception) { /** * Create request for operation 'embeddedEditUrl' * - * @param string $template_id The id of the template to edit. (required) - * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation + * @param string $template_id The id of the template to edit. (required) + * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::embeddedEditUrl. This method will eventually become unavailable */ - public function embeddedEditUrlRequest($template_id, $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) + public function embeddedEditUrlRequest(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) { - // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $template_id when calling embeddedEditUrl' ); } // verify the required parameter 'embedded_edit_url_request' is set if ($embedded_edit_url_request === null || (is_array($embedded_edit_url_request) && count($embedded_edit_url_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $embedded_edit_url_request when calling embeddedEditUrl' ); } - $resourcePath = '/embedded/edit_url/{template_id}'; $formParams = []; $queryParams = []; @@ -423,19 +404,17 @@ public function embeddedEditUrlRequest($template_id, $embedded_edit_url_request, $multipart = !empty($formParams); - // path params if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', + '{template_id}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -443,7 +422,7 @@ public function embeddedEditUrlRequest($template_id, $embedded_edit_url_request, // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($embedded_edit_url_request)); } else { $httpBody = $embedded_edit_url_request; @@ -456,7 +435,7 @@ public function embeddedEditUrlRequest($template_id, $embedded_edit_url_request, foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -473,9 +452,8 @@ public function embeddedEditUrlRequest($template_id, $embedded_edit_url_request, $payloadHook('multipart', $multipartContents, $embedded_edit_url_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -518,13 +496,13 @@ public function embeddedEditUrlRequest($template_id, $embedded_edit_url_request, * * Get Embedded Sign URL * - * @param string $signature_id The id of the signature to get a signature url for. (required) + * @param string $signature_id The id of the signature to get a signature url for. (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\EmbeddedSignUrlResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function embeddedSignUrl($signature_id) + public function embeddedSignUrl(string $signature_id) { list($response) = $this->embeddedSignUrlWithHttpInfo($signature_id); return $response; @@ -535,15 +513,15 @@ public function embeddedSignUrl($signature_id) * * Get Embedded Sign URL * - * @param string $signature_id The id of the signature to get a signature url for. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation + * @param string $signature_id The id of the signature to get a signature url for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\EmbeddedSignUrlResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::embeddedSignUrl. This method will eventually become unavailable */ - public function embeddedSignUrlWithHttpInfo($signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) + public function embeddedSignUrlWithHttpInfo(string $signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) { $request = $this->embeddedSignUrlRequest($signature_id, $contentType); @@ -555,14 +533,14 @@ public function embeddedSignUrlWithHttpInfo($signature_id, string $contentType = } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -570,7 +548,6 @@ public function embeddedSignUrlWithHttpInfo($signature_id, string $contentType = $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -580,17 +557,16 @@ public function embeddedSignUrlWithHttpInfo($signature_id, string $contentType = return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\EmbeddedSignUrlResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\EmbeddedSignUrlResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -607,9 +583,8 @@ public function embeddedSignUrlWithHttpInfo($signature_id, string $contentType = return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\EmbeddedSignUrlResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -617,23 +592,23 @@ public function embeddedSignUrlWithHttpInfo($signature_id, string $contentType = sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\EmbeddedSignUrlResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -650,11 +625,9 @@ public function embeddedSignUrlWithHttpInfo($signature_id, string $contentType = return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -667,7 +640,6 @@ public function embeddedSignUrlWithHttpInfo($signature_id, string $contentType = ); $e->setResponseObject($data); break; - } throw $e; } @@ -678,14 +650,14 @@ public function embeddedSignUrlWithHttpInfo($signature_id, string $contentType = * * Get Embedded Sign URL * - * @param string $signature_id The id of the signature to get a signature url for. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation + * @param string $signature_id The id of the signature to get a signature url for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::embeddedSignUrl. This method will eventually become unavailable */ - public function embeddedSignUrlAsync($signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) + public function embeddedSignUrlAsync(string $signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) { return $this->embeddedSignUrlAsyncWithHttpInfo($signature_id, $contentType) ->then( @@ -700,14 +672,14 @@ function ($response) { * * Get Embedded Sign URL * - * @param string $signature_id The id of the signature to get a signature url for. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation + * @param string $signature_id The id of the signature to get a signature url for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::embeddedSignUrl. This method will eventually become unavailable */ - public function embeddedSignUrlAsyncWithHttpInfo($signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) + public function embeddedSignUrlAsyncWithHttpInfo(string $signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) { $returnType = '\Dropbox\Sign\Model\EmbeddedSignUrlResponse'; $request = $this->embeddedSignUrlRequest($signature_id, $contentType); @@ -717,9 +689,9 @@ public function embeddedSignUrlAsyncWithHttpInfo($signature_id, string $contentT ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -728,7 +700,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -742,7 +714,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -751,24 +723,22 @@ function ($exception) { /** * Create request for operation 'embeddedSignUrl' * - * @param string $signature_id The id of the signature to get a signature url for. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation + * @param string $signature_id The id of the signature to get a signature url for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::embeddedSignUrl. This method will eventually become unavailable */ - public function embeddedSignUrlRequest($signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) + public function embeddedSignUrlRequest(string $signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) { - // verify the required parameter 'signature_id' is set if ($signature_id === null || (is_array($signature_id) && count($signature_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_id when calling embeddedSignUrl' ); } - $resourcePath = '/embedded/sign_url/{signature_id}'; $formParams = []; $queryParams = []; @@ -776,20 +746,17 @@ public function embeddedSignUrlRequest($signature_id, string $contentType = self $httpBody = ''; $multipart = false; - - // path params if ($signature_id !== null) { $resourcePath = str_replace( - '{' . 'signature_id' . '}', + '{signature_id}', ObjectSerializer::toPathValue($signature_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -803,7 +770,7 @@ public function embeddedSignUrlRequest($signature_id, string $contentType = self foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -817,9 +784,8 @@ public function embeddedSignUrlRequest($signature_id, string $contentType = self } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -860,8 +826,8 @@ public function embeddedSignUrlRequest($signature_id, string $contentType = self /** * Create http client option * - * @throws \RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -869,7 +835,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -885,8 +851,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -896,9 +862,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); } return [ @@ -917,8 +883,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/FaxApi.php b/sdks/php/src/Api/FaxApi.php index 1b3c6f718..ec43e8a7f 100644 --- a/sdks/php/src/Api/FaxApi.php +++ b/sdks/php/src/Api/FaxApi.php @@ -1,13 +1,10 @@ [ 'application/json', @@ -97,10 +90,7 @@ class FaxApi protected $response; /** - * @param Configuration $config - * @param ClientInterface $client - * @param HeaderSelector $selector - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( ?Configuration $config = null, @@ -120,7 +110,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex($hostIndex): void + public function setHostIndex(int $hostIndex): void { $this->hostIndex = $hostIndex; } @@ -157,13 +147,12 @@ public function getResponse() * * Delete Fax * - * @param string $fax_id Fax ID (required) + * @param string $fax_id Fax ID (required) * * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return void + * @throws InvalidArgumentException */ - public function faxDelete($fax_id) + public function faxDelete(string $fax_id) { $this->faxDeleteWithHttpInfo($fax_id); } @@ -173,15 +162,15 @@ public function faxDelete($fax_id) * * Delete Fax * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] to see the possible values for this operation * - * @throws 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) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxDelete. This method will eventually become unavailable */ - public function faxDeleteWithHttpInfo($fax_id, string $contentType = self::contentTypes['faxDelete'][0]) + public function faxDeleteWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxDelete'][0]) { $request = $this->faxDeleteRequest($fax_id, $contentType); @@ -193,14 +182,14 @@ public function faxDeleteWithHttpInfo($fax_id, string $contentType = self::conte } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -208,16 +197,12 @@ public function faxDeleteWithHttpInfo($fax_id, string $contentType = self::conte $statusCode = $response->getStatusCode(); - return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } switch ($e->getCode()) { - } throw $e; } @@ -228,14 +213,14 @@ public function faxDeleteWithHttpInfo($fax_id, string $contentType = self::conte * * Delete Fax * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxDelete. This method will eventually become unavailable */ - public function faxDeleteAsync($fax_id, string $contentType = self::contentTypes['faxDelete'][0]) + public function faxDeleteAsync(string $fax_id, string $contentType = self::contentTypes['faxDelete'][0]) { return $this->faxDeleteAsyncWithHttpInfo($fax_id, $contentType) ->then( @@ -250,14 +235,14 @@ function ($response) { * * Delete Fax * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxDelete. This method will eventually become unavailable */ - public function faxDeleteAsyncWithHttpInfo($fax_id, string $contentType = self::contentTypes['faxDelete'][0]) + public function faxDeleteAsyncWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxDelete'][0]) { $returnType = ''; $request = $this->faxDeleteRequest($fax_id, $contentType); @@ -265,7 +250,7 @@ public function faxDeleteAsyncWithHttpInfo($fax_id, string $contentType = self:: return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( - function ($response) use ($returnType) { + function ($response) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { @@ -279,7 +264,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -288,24 +273,22 @@ function ($exception) { /** * Create request for operation 'faxDelete' * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxDelete. This method will eventually become unavailable */ - public function faxDeleteRequest($fax_id, string $contentType = self::contentTypes['faxDelete'][0]) + public function faxDeleteRequest(string $fax_id, string $contentType = self::contentTypes['faxDelete'][0]) { - // verify the required parameter 'fax_id' is set if ($fax_id === null || (is_array($fax_id) && count($fax_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $fax_id when calling faxDelete' ); } - $resourcePath = '/fax/{fax_id}'; $formParams = []; $queryParams = []; @@ -313,20 +296,17 @@ public function faxDeleteRequest($fax_id, string $contentType = self::contentTyp $httpBody = ''; $multipart = false; - - // path params if ($fax_id !== null) { $resourcePath = str_replace( - '{' . 'fax_id' . '}', + '{fax_id}', ObjectSerializer::toPathValue($fax_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -340,7 +320,7 @@ public function faxDeleteRequest($fax_id, string $contentType = self::contentTyp foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -354,9 +334,8 @@ public function faxDeleteRequest($fax_id, string $contentType = self::contentTyp } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -395,13 +374,13 @@ public function faxDeleteRequest($fax_id, string $contentType = self::contentTyp * * Download Fax Files * - * @param string $fax_id Fax ID (required) + * @param string $fax_id Fax ID (required) * + * @return SplFileObject * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return \SplFileObject|\Dropbox\Sign\Model\ErrorResponse + * @throws InvalidArgumentException */ - public function faxFiles($fax_id) + public function faxFiles(string $fax_id) { list($response) = $this->faxFilesWithHttpInfo($fax_id); return $response; @@ -412,15 +391,15 @@ public function faxFiles($fax_id) * * Download Fax Files * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of \SplFileObject|\Dropbox\Sign\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxFiles. This method will eventually become unavailable */ - public function faxFilesWithHttpInfo($fax_id, string $contentType = self::contentTypes['faxFiles'][0]) + public function faxFilesWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxFiles'][0]) { $request = $this->faxFilesRequest($fax_id, $contentType); @@ -432,14 +411,14 @@ public function faxFilesWithHttpInfo($fax_id, string $contentType = self::conten } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -447,7 +426,6 @@ public function faxFilesWithHttpInfo($fax_id, string $contentType = self::conten $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -457,17 +435,16 @@ public function faxFilesWithHttpInfo($fax_id, string $contentType = self::conten return $result; } - switch ($statusCode) { case 200: if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\SplFileObject' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -484,9 +461,8 @@ public function faxFilesWithHttpInfo($fax_id, string $contentType = self::conten return [ ObjectSerializer::deserialize($content, '\SplFileObject', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -494,23 +470,23 @@ public function faxFilesWithHttpInfo($fax_id, string $contentType = self::conten sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\SplFileObject'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -527,11 +503,9 @@ public function faxFilesWithHttpInfo($fax_id, string $contentType = self::conten return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -544,7 +518,6 @@ public function faxFilesWithHttpInfo($fax_id, string $contentType = self::conten ); $e->setResponseObject($data); break; - } throw $e; } @@ -555,14 +528,14 @@ public function faxFilesWithHttpInfo($fax_id, string $contentType = self::conten * * Download Fax Files * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxFiles. This method will eventually become unavailable */ - public function faxFilesAsync($fax_id, string $contentType = self::contentTypes['faxFiles'][0]) + public function faxFilesAsync(string $fax_id, string $contentType = self::contentTypes['faxFiles'][0]) { return $this->faxFilesAsyncWithHttpInfo($fax_id, $contentType) ->then( @@ -577,14 +550,14 @@ function ($response) { * * Download Fax Files * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxFiles. This method will eventually become unavailable */ - public function faxFilesAsyncWithHttpInfo($fax_id, string $contentType = self::contentTypes['faxFiles'][0]) + public function faxFilesAsyncWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxFiles'][0]) { $returnType = '\SplFileObject'; $request = $this->faxFilesRequest($fax_id, $contentType); @@ -594,9 +567,9 @@ public function faxFilesAsyncWithHttpInfo($fax_id, string $contentType = self::c ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -605,7 +578,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -619,7 +592,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -628,24 +601,22 @@ function ($exception) { /** * Create request for operation 'faxFiles' * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxFiles. This method will eventually become unavailable */ - public function faxFilesRequest($fax_id, string $contentType = self::contentTypes['faxFiles'][0]) + public function faxFilesRequest(string $fax_id, string $contentType = self::contentTypes['faxFiles'][0]) { - // verify the required parameter 'fax_id' is set if ($fax_id === null || (is_array($fax_id) && count($fax_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $fax_id when calling faxFiles' ); } - $resourcePath = '/fax/files/{fax_id}'; $formParams = []; $queryParams = []; @@ -653,20 +624,17 @@ public function faxFilesRequest($fax_id, string $contentType = self::contentType $httpBody = ''; $multipart = false; - - // path params if ($fax_id !== null) { $resourcePath = str_replace( - '{' . 'fax_id' . '}', + '{fax_id}', ObjectSerializer::toPathValue($fax_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/pdf', 'application/json', ], + $multipart ? ['multipart/form-data'] : ['application/pdf', 'application/json'], $contentType, $multipart ); @@ -680,7 +648,7 @@ public function faxFilesRequest($fax_id, string $contentType = self::contentType foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -694,9 +662,8 @@ public function faxFilesRequest($fax_id, string $contentType = self::contentType } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -735,13 +702,13 @@ public function faxFilesRequest($fax_id, string $contentType = self::contentType * * Get Fax * - * @param string $fax_id Fax ID (required) + * @param string $fax_id Fax ID (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\FaxGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function faxGet($fax_id) + public function faxGet(string $fax_id) { list($response) = $this->faxGetWithHttpInfo($fax_id); return $response; @@ -752,15 +719,15 @@ public function faxGet($fax_id) * * Get Fax * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\FaxGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxGet. This method will eventually become unavailable */ - public function faxGetWithHttpInfo($fax_id, string $contentType = self::contentTypes['faxGet'][0]) + public function faxGetWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxGet'][0]) { $request = $this->faxGetRequest($fax_id, $contentType); @@ -772,14 +739,14 @@ public function faxGetWithHttpInfo($fax_id, string $contentType = self::contentT } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -787,7 +754,6 @@ public function faxGetWithHttpInfo($fax_id, string $contentType = self::contentT $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -797,17 +763,16 @@ public function faxGetWithHttpInfo($fax_id, string $contentType = self::contentT return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FaxGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\FaxGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -824,9 +789,8 @@ public function faxGetWithHttpInfo($fax_id, string $contentType = self::contentT return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -834,23 +798,23 @@ public function faxGetWithHttpInfo($fax_id, string $contentType = self::contentT sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\FaxGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -867,11 +831,9 @@ public function faxGetWithHttpInfo($fax_id, string $contentType = self::contentT return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -884,7 +846,6 @@ public function faxGetWithHttpInfo($fax_id, string $contentType = self::contentT ); $e->setResponseObject($data); break; - } throw $e; } @@ -895,14 +856,14 @@ public function faxGetWithHttpInfo($fax_id, string $contentType = self::contentT * * Get Fax * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxGet. This method will eventually become unavailable */ - public function faxGetAsync($fax_id, string $contentType = self::contentTypes['faxGet'][0]) + public function faxGetAsync(string $fax_id, string $contentType = self::contentTypes['faxGet'][0]) { return $this->faxGetAsyncWithHttpInfo($fax_id, $contentType) ->then( @@ -917,14 +878,14 @@ function ($response) { * * Get Fax * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxGet. This method will eventually become unavailable */ - public function faxGetAsyncWithHttpInfo($fax_id, string $contentType = self::contentTypes['faxGet'][0]) + public function faxGetAsyncWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxGet'][0]) { $returnType = '\Dropbox\Sign\Model\FaxGetResponse'; $request = $this->faxGetRequest($fax_id, $contentType); @@ -934,9 +895,9 @@ public function faxGetAsyncWithHttpInfo($fax_id, string $contentType = self::con ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -945,7 +906,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -959,7 +920,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -968,24 +929,22 @@ function ($exception) { /** * Create request for operation 'faxGet' * - * @param string $fax_id Fax ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] to see the possible values for this operation + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxGet. This method will eventually become unavailable */ - public function faxGetRequest($fax_id, string $contentType = self::contentTypes['faxGet'][0]) + public function faxGetRequest(string $fax_id, string $contentType = self::contentTypes['faxGet'][0]) { - // verify the required parameter 'fax_id' is set if ($fax_id === null || (is_array($fax_id) && count($fax_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $fax_id when calling faxGet' ); } - $resourcePath = '/fax/{fax_id}'; $formParams = []; $queryParams = []; @@ -993,20 +952,17 @@ public function faxGetRequest($fax_id, string $contentType = self::contentTypes[ $httpBody = ''; $multipart = false; - - // path params if ($fax_id !== null) { $resourcePath = str_replace( - '{' . 'fax_id' . '}', + '{fax_id}', ObjectSerializer::toPathValue($fax_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1020,7 +976,7 @@ public function faxGetRequest($fax_id, string $contentType = self::contentTypes[ foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1034,9 +990,8 @@ public function faxGetRequest($fax_id, string $contentType = self::contentTypes[ } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1075,14 +1030,14 @@ public function faxGetRequest($fax_id, string $contentType = self::contentTypes[ * * Lists Faxes * - * @param int|null $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param int|null $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\FaxListResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function faxList($page = 1, $page_size = 20) + public function faxList(?int $page = 1, ?int $page_size = 20) { list($response) = $this->faxListWithHttpInfo($page, $page_size); return $response; @@ -1093,16 +1048,16 @@ public function faxList($page = 1, $page_size = 20) * * Lists Faxes * - * @param int|null $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] to see the possible values for this operation + * @param int|null $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\FaxListResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxList. This method will eventually become unavailable */ - public function faxListWithHttpInfo($page = 1, $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) + public function faxListWithHttpInfo(?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) { $request = $this->faxListRequest($page, $page_size, $contentType); @@ -1114,14 +1069,14 @@ public function faxListWithHttpInfo($page = 1, $page_size = 20, string $contentT } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1129,7 +1084,6 @@ public function faxListWithHttpInfo($page = 1, $page_size = 20, string $contentT $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -1139,17 +1093,16 @@ public function faxListWithHttpInfo($page = 1, $page_size = 20, string $contentT return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FaxListResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\FaxListResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1166,9 +1119,8 @@ public function faxListWithHttpInfo($page = 1, $page_size = 20, string $contentT return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxListResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -1176,23 +1128,23 @@ public function faxListWithHttpInfo($page = 1, $page_size = 20, string $contentT sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\FaxListResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1209,11 +1161,9 @@ public function faxListWithHttpInfo($page = 1, $page_size = 20, string $contentT return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1226,7 +1176,6 @@ public function faxListWithHttpInfo($page = 1, $page_size = 20, string $contentT ); $e->setResponseObject($data); break; - } throw $e; } @@ -1237,15 +1186,15 @@ public function faxListWithHttpInfo($page = 1, $page_size = 20, string $contentT * * Lists Faxes * - * @param int|null $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] to see the possible values for this operation + * @param int|null $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxList. This method will eventually become unavailable */ - public function faxListAsync($page = 1, $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) + public function faxListAsync(?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) { return $this->faxListAsyncWithHttpInfo($page, $page_size, $contentType) ->then( @@ -1260,15 +1209,15 @@ function ($response) { * * Lists Faxes * - * @param int|null $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] to see the possible values for this operation + * @param int|null $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxList. This method will eventually become unavailable */ - public function faxListAsyncWithHttpInfo($page = 1, $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) + public function faxListAsyncWithHttpInfo(?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) { $returnType = '\Dropbox\Sign\Model\FaxListResponse'; $request = $this->faxListRequest($page, $page_size, $contentType); @@ -1278,9 +1227,9 @@ public function faxListAsyncWithHttpInfo($page = 1, $page_size = 20, string $con ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1289,7 +1238,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -1303,7 +1252,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1312,29 +1261,27 @@ function ($exception) { /** * Create request for operation 'faxList' * - * @param int|null $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] to see the possible values for this operation + * @param int|null $page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxList. This method will eventually become unavailable */ - public function faxListRequest($page = 1, $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) + public function faxListRequest(?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) { - if ($page !== null && $page < 1) { - throw new \InvalidArgumentException('invalid value for "$page" when calling FaxApi.faxList, must be bigger than or equal to 1.'); + throw new InvalidArgumentException('invalid value for "$page" when calling FaxApi.faxList, must be bigger than or equal to 1.'); } if ($page_size !== null && $page_size > 100) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling FaxApi.faxList, must be smaller than or equal to 100.'); + throw new InvalidArgumentException('invalid value for "$page_size" when calling FaxApi.faxList, must be smaller than or equal to 100.'); } if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling FaxApi.faxList, must be bigger than or equal to 1.'); + throw new InvalidArgumentException('invalid value for "$page_size" when calling FaxApi.faxList, must be bigger than or equal to 1.'); } - $resourcePath = '/fax/list'; $formParams = []; $queryParams = []; @@ -1361,11 +1308,8 @@ public function faxListRequest($page = 1, $page_size = 20, string $contentType = false // required ) ?? []); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1379,7 +1323,7 @@ public function faxListRequest($page = 1, $page_size = 20, string $contentType = foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1393,9 +1337,8 @@ public function faxListRequest($page = 1, $page_size = 20, string $contentType = } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1434,13 +1377,13 @@ public function faxListRequest($page = 1, $page_size = 20, string $contentType = * * Send Fax * - * @param Model\FaxSendRequest $fax_send_request fax_send_request (required) + * @param Model\FaxSendRequest $fax_send_request fax_send_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\FaxGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function faxSend($fax_send_request) + public function faxSend(Model\FaxSendRequest $fax_send_request) { list($response) = $this->faxSendWithHttpInfo($fax_send_request); return $response; @@ -1451,15 +1394,15 @@ public function faxSend($fax_send_request) * * Send Fax * - * @param Model\FaxSendRequest $fax_send_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] to see the possible values for this operation + * @param Model\FaxSendRequest $fax_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\FaxGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxSend. This method will eventually become unavailable */ - public function faxSendWithHttpInfo($fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) + public function faxSendWithHttpInfo(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) { $request = $this->faxSendRequest($fax_send_request, $contentType); @@ -1471,14 +1414,14 @@ public function faxSendWithHttpInfo($fax_send_request, string $contentType = sel } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1486,7 +1429,6 @@ public function faxSendWithHttpInfo($fax_send_request, string $contentType = sel $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -1496,17 +1438,16 @@ public function faxSendWithHttpInfo($fax_send_request, string $contentType = sel return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FaxGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\FaxGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1523,9 +1464,8 @@ public function faxSendWithHttpInfo($fax_send_request, string $contentType = sel return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -1533,23 +1473,23 @@ public function faxSendWithHttpInfo($fax_send_request, string $contentType = sel sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\FaxGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1566,11 +1506,9 @@ public function faxSendWithHttpInfo($fax_send_request, string $contentType = sel return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1583,7 +1521,6 @@ public function faxSendWithHttpInfo($fax_send_request, string $contentType = sel ); $e->setResponseObject($data); break; - } throw $e; } @@ -1594,14 +1531,14 @@ public function faxSendWithHttpInfo($fax_send_request, string $contentType = sel * * Send Fax * - * @param Model\FaxSendRequest $fax_send_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] to see the possible values for this operation + * @param Model\FaxSendRequest $fax_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxSend. This method will eventually become unavailable */ - public function faxSendAsync($fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) + public function faxSendAsync(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) { return $this->faxSendAsyncWithHttpInfo($fax_send_request, $contentType) ->then( @@ -1616,14 +1553,14 @@ function ($response) { * * Send Fax * - * @param Model\FaxSendRequest $fax_send_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] to see the possible values for this operation + * @param Model\FaxSendRequest $fax_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxSend. This method will eventually become unavailable */ - public function faxSendAsyncWithHttpInfo($fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) + public function faxSendAsyncWithHttpInfo(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) { $returnType = '\Dropbox\Sign\Model\FaxGetResponse'; $request = $this->faxSendRequest($fax_send_request, $contentType); @@ -1633,9 +1570,9 @@ public function faxSendAsyncWithHttpInfo($fax_send_request, string $contentType ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1644,7 +1581,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -1658,7 +1595,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1667,24 +1604,22 @@ function ($exception) { /** * Create request for operation 'faxSend' * - * @param Model\FaxSendRequest $fax_send_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] to see the possible values for this operation + * @param Model\FaxSendRequest $fax_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxSend. This method will eventually become unavailable */ - public function faxSendRequest($fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) + public function faxSendRequest(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) { - // verify the required parameter 'fax_send_request' is set if ($fax_send_request === null || (is_array($fax_send_request) && count($fax_send_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $fax_send_request when calling faxSend' ); } - $resourcePath = '/fax/send'; $formParams = []; $queryParams = []; @@ -1698,11 +1633,8 @@ public function faxSendRequest($fax_send_request, string $contentType = self::co $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1710,7 +1642,7 @@ public function faxSendRequest($fax_send_request, string $contentType = self::co // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($fax_send_request)); } else { $httpBody = $fax_send_request; @@ -1723,7 +1655,7 @@ public function faxSendRequest($fax_send_request, string $contentType = self::co foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1740,9 +1672,8 @@ public function faxSendRequest($fax_send_request, string $contentType = self::co $payloadHook('multipart', $multipartContents, $fax_send_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1779,8 +1710,8 @@ public function faxSendRequest($fax_send_request, string $contentType = self::co /** * Create http client option * - * @throws \RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -1788,7 +1719,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -1804,8 +1735,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -1815,9 +1746,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); } return [ @@ -1836,8 +1767,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/FaxLineApi.php b/sdks/php/src/Api/FaxLineApi.php index 416eb0989..94a5e6e4a 100644 --- a/sdks/php/src/Api/FaxLineApi.php +++ b/sdks/php/src/Api/FaxLineApi.php @@ -1,13 +1,10 @@ [ 'application/json', @@ -102,10 +94,7 @@ class FaxLineApi protected $response; /** - * @param Configuration $config - * @param ClientInterface $client - * @param HeaderSelector $selector - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( ?Configuration $config = null, @@ -125,7 +114,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex($hostIndex): void + public function setHostIndex(int $hostIndex): void { $this->hostIndex = $hostIndex; } @@ -162,13 +151,13 @@ public function getResponse() * * Add Fax Line User * - * @param Model\FaxLineAddUserRequest $fax_line_add_user_request fax_line_add_user_request (required) + * @param Model\FaxLineAddUserRequest $fax_line_add_user_request fax_line_add_user_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\FaxLineResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function faxLineAddUser($fax_line_add_user_request) + public function faxLineAddUser(Model\FaxLineAddUserRequest $fax_line_add_user_request) { list($response) = $this->faxLineAddUserWithHttpInfo($fax_line_add_user_request); return $response; @@ -179,15 +168,15 @@ public function faxLineAddUser($fax_line_add_user_request) * * Add Fax Line User * - * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation + * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\FaxLineResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineAddUser. This method will eventually become unavailable */ - public function faxLineAddUserWithHttpInfo($fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) + public function faxLineAddUserWithHttpInfo(Model\FaxLineAddUserRequest $fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) { $request = $this->faxLineAddUserRequest($fax_line_add_user_request, $contentType); @@ -199,14 +188,14 @@ public function faxLineAddUserWithHttpInfo($fax_line_add_user_request, string $c } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -214,7 +203,6 @@ public function faxLineAddUserWithHttpInfo($fax_line_add_user_request, string $c $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -224,17 +212,16 @@ public function faxLineAddUserWithHttpInfo($fax_line_add_user_request, string $c return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FaxLineResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\FaxLineResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -251,9 +238,8 @@ public function faxLineAddUserWithHttpInfo($fax_line_add_user_request, string $c return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxLineResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -261,23 +247,23 @@ public function faxLineAddUserWithHttpInfo($fax_line_add_user_request, string $c sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -294,11 +280,9 @@ public function faxLineAddUserWithHttpInfo($fax_line_add_user_request, string $c return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -311,7 +295,6 @@ public function faxLineAddUserWithHttpInfo($fax_line_add_user_request, string $c ); $e->setResponseObject($data); break; - } throw $e; } @@ -322,14 +305,14 @@ public function faxLineAddUserWithHttpInfo($fax_line_add_user_request, string $c * * Add Fax Line User * - * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation + * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineAddUser. This method will eventually become unavailable */ - public function faxLineAddUserAsync($fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) + public function faxLineAddUserAsync(Model\FaxLineAddUserRequest $fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) { return $this->faxLineAddUserAsyncWithHttpInfo($fax_line_add_user_request, $contentType) ->then( @@ -344,14 +327,14 @@ function ($response) { * * Add Fax Line User * - * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation + * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineAddUser. This method will eventually become unavailable */ - public function faxLineAddUserAsyncWithHttpInfo($fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) + public function faxLineAddUserAsyncWithHttpInfo(Model\FaxLineAddUserRequest $fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) { $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; $request = $this->faxLineAddUserRequest($fax_line_add_user_request, $contentType); @@ -361,9 +344,9 @@ public function faxLineAddUserAsyncWithHttpInfo($fax_line_add_user_request, stri ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -372,7 +355,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -386,7 +369,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -395,24 +378,22 @@ function ($exception) { /** * Create request for operation 'faxLineAddUser' * - * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation + * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineAddUser. This method will eventually become unavailable */ - public function faxLineAddUserRequest($fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) + public function faxLineAddUserRequest(Model\FaxLineAddUserRequest $fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) { - // verify the required parameter 'fax_line_add_user_request' is set if ($fax_line_add_user_request === null || (is_array($fax_line_add_user_request) && count($fax_line_add_user_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $fax_line_add_user_request when calling faxLineAddUser' ); } - $resourcePath = '/fax_line/add_user'; $formParams = []; $queryParams = []; @@ -426,11 +407,8 @@ public function faxLineAddUserRequest($fax_line_add_user_request, string $conten $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -438,7 +416,7 @@ public function faxLineAddUserRequest($fax_line_add_user_request, string $conten // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($fax_line_add_user_request)); } else { $httpBody = $fax_line_add_user_request; @@ -451,7 +429,7 @@ public function faxLineAddUserRequest($fax_line_add_user_request, string $conten foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -468,9 +446,8 @@ public function faxLineAddUserRequest($fax_line_add_user_request, string $conten $payloadHook('multipart', $multipartContents, $fax_line_add_user_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -509,16 +486,16 @@ public function faxLineAddUserRequest($fax_line_add_user_request, string $conten * * Get Available Fax Line Area Codes * - * @param string $country Filter area codes by country (required) - * @param string|null $state Filter area codes by state (optional) - * @param string|null $province Filter area codes by province (optional) - * @param string|null $city Filter area codes by city (optional) + * @param string $country Filter area codes by country (required) + * @param string|null $state Filter area codes by state (optional) + * @param string|null $province Filter area codes by province (optional) + * @param string|null $city Filter area codes by city (optional) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\FaxLineAreaCodeGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function faxLineAreaCodeGet($country, $state = null, $province = null, $city = null) + public function faxLineAreaCodeGet(string $country, ?string $state = null, ?string $province = null, ?string $city = null) { list($response) = $this->faxLineAreaCodeGetWithHttpInfo($country, $state, $province, $city); return $response; @@ -529,18 +506,18 @@ public function faxLineAreaCodeGet($country, $state = null, $province = null, $c * * Get Available Fax Line Area Codes * - * @param string $country Filter area codes by country (required) - * @param string|null $state Filter area codes by state (optional) - * @param string|null $province Filter area codes by province (optional) - * @param string|null $city Filter area codes by city (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation + * @param string $country Filter area codes by country (required) + * @param string|null $state Filter area codes by state (optional) + * @param string|null $province Filter area codes by province (optional) + * @param string|null $city Filter area codes by city (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\FaxLineAreaCodeGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineAreaCodeGet. This method will eventually become unavailable */ - public function faxLineAreaCodeGetWithHttpInfo($country, $state = null, $province = null, $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) + public function faxLineAreaCodeGetWithHttpInfo(string $country, ?string $state = null, ?string $province = null, ?string $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) { $request = $this->faxLineAreaCodeGetRequest($country, $state, $province, $city, $contentType); @@ -552,14 +529,14 @@ public function faxLineAreaCodeGetWithHttpInfo($country, $state = null, $provinc } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -567,7 +544,6 @@ public function faxLineAreaCodeGetWithHttpInfo($country, $state = null, $provinc $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -577,17 +553,16 @@ public function faxLineAreaCodeGetWithHttpInfo($country, $state = null, $provinc return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FaxLineAreaCodeGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\FaxLineAreaCodeGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -604,9 +579,8 @@ public function faxLineAreaCodeGetWithHttpInfo($country, $state = null, $provinc return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxLineAreaCodeGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -614,23 +588,23 @@ public function faxLineAreaCodeGetWithHttpInfo($country, $state = null, $provinc sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\FaxLineAreaCodeGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -647,11 +621,9 @@ public function faxLineAreaCodeGetWithHttpInfo($country, $state = null, $provinc return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -664,7 +636,6 @@ public function faxLineAreaCodeGetWithHttpInfo($country, $state = null, $provinc ); $e->setResponseObject($data); break; - } throw $e; } @@ -675,17 +646,17 @@ public function faxLineAreaCodeGetWithHttpInfo($country, $state = null, $provinc * * Get Available Fax Line Area Codes * - * @param string $country Filter area codes by country (required) - * @param string|null $state Filter area codes by state (optional) - * @param string|null $province Filter area codes by province (optional) - * @param string|null $city Filter area codes by city (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation + * @param string $country Filter area codes by country (required) + * @param string|null $state Filter area codes by state (optional) + * @param string|null $province Filter area codes by province (optional) + * @param string|null $city Filter area codes by city (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineAreaCodeGet. This method will eventually become unavailable */ - public function faxLineAreaCodeGetAsync($country, $state = null, $province = null, $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) + public function faxLineAreaCodeGetAsync(string $country, ?string $state = null, ?string $province = null, ?string $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) { return $this->faxLineAreaCodeGetAsyncWithHttpInfo($country, $state, $province, $city, $contentType) ->then( @@ -700,17 +671,17 @@ function ($response) { * * Get Available Fax Line Area Codes * - * @param string $country Filter area codes by country (required) - * @param string|null $state Filter area codes by state (optional) - * @param string|null $province Filter area codes by province (optional) - * @param string|null $city Filter area codes by city (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation + * @param string $country Filter area codes by country (required) + * @param string|null $state Filter area codes by state (optional) + * @param string|null $province Filter area codes by province (optional) + * @param string|null $city Filter area codes by city (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineAreaCodeGet. This method will eventually become unavailable */ - public function faxLineAreaCodeGetAsyncWithHttpInfo($country, $state = null, $province = null, $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) + public function faxLineAreaCodeGetAsyncWithHttpInfo(string $country, ?string $state = null, ?string $province = null, ?string $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) { $returnType = '\Dropbox\Sign\Model\FaxLineAreaCodeGetResponse'; $request = $this->faxLineAreaCodeGetRequest($country, $state, $province, $city, $contentType); @@ -720,9 +691,9 @@ public function faxLineAreaCodeGetAsyncWithHttpInfo($country, $state = null, $pr ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -731,7 +702,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -745,7 +716,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -754,30 +725,25 @@ function ($exception) { /** * Create request for operation 'faxLineAreaCodeGet' * - * @param string $country Filter area codes by country (required) - * @param string|null $state Filter area codes by state (optional) - * @param string|null $province Filter area codes by province (optional) - * @param string|null $city Filter area codes by city (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation + * @param string $country Filter area codes by country (required) + * @param string|null $state Filter area codes by state (optional) + * @param string|null $province Filter area codes by province (optional) + * @param string|null $city Filter area codes by city (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineAreaCodeGet. This method will eventually become unavailable */ - public function faxLineAreaCodeGetRequest($country, $state = null, $province = null, $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) + public function faxLineAreaCodeGetRequest(string $country, ?string $state = null, ?string $province = null, ?string $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) { - // verify the required parameter 'country' is set if ($country === null || (is_array($country) && count($country) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $country when calling faxLineAreaCodeGet' ); } - - - - $resourcePath = '/fax_line/area_codes'; $formParams = []; $queryParams = []; @@ -822,11 +788,8 @@ public function faxLineAreaCodeGetRequest($country, $state = null, $province = n false // required ) ?? []); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -840,7 +803,7 @@ public function faxLineAreaCodeGetRequest($country, $state = null, $province = n foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -854,9 +817,8 @@ public function faxLineAreaCodeGetRequest($country, $state = null, $province = n } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -895,13 +857,13 @@ public function faxLineAreaCodeGetRequest($country, $state = null, $province = n * * Purchase Fax Line * - * @param Model\FaxLineCreateRequest $fax_line_create_request fax_line_create_request (required) + * @param Model\FaxLineCreateRequest $fax_line_create_request fax_line_create_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\FaxLineResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function faxLineCreate($fax_line_create_request) + public function faxLineCreate(Model\FaxLineCreateRequest $fax_line_create_request) { list($response) = $this->faxLineCreateWithHttpInfo($fax_line_create_request); return $response; @@ -912,15 +874,15 @@ public function faxLineCreate($fax_line_create_request) * * Purchase Fax Line * - * @param Model\FaxLineCreateRequest $fax_line_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation + * @param Model\FaxLineCreateRequest $fax_line_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\FaxLineResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineCreate. This method will eventually become unavailable */ - public function faxLineCreateWithHttpInfo($fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) + public function faxLineCreateWithHttpInfo(Model\FaxLineCreateRequest $fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) { $request = $this->faxLineCreateRequest($fax_line_create_request, $contentType); @@ -932,14 +894,14 @@ public function faxLineCreateWithHttpInfo($fax_line_create_request, string $cont } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -947,7 +909,6 @@ public function faxLineCreateWithHttpInfo($fax_line_create_request, string $cont $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -957,17 +918,16 @@ public function faxLineCreateWithHttpInfo($fax_line_create_request, string $cont return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FaxLineResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\FaxLineResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -984,9 +944,8 @@ public function faxLineCreateWithHttpInfo($fax_line_create_request, string $cont return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxLineResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -994,23 +953,23 @@ public function faxLineCreateWithHttpInfo($fax_line_create_request, string $cont sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1027,11 +986,9 @@ public function faxLineCreateWithHttpInfo($fax_line_create_request, string $cont return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1044,7 +1001,6 @@ public function faxLineCreateWithHttpInfo($fax_line_create_request, string $cont ); $e->setResponseObject($data); break; - } throw $e; } @@ -1055,14 +1011,14 @@ public function faxLineCreateWithHttpInfo($fax_line_create_request, string $cont * * Purchase Fax Line * - * @param Model\FaxLineCreateRequest $fax_line_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation + * @param Model\FaxLineCreateRequest $fax_line_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineCreate. This method will eventually become unavailable */ - public function faxLineCreateAsync($fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) + public function faxLineCreateAsync(Model\FaxLineCreateRequest $fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) { return $this->faxLineCreateAsyncWithHttpInfo($fax_line_create_request, $contentType) ->then( @@ -1077,14 +1033,14 @@ function ($response) { * * Purchase Fax Line * - * @param Model\FaxLineCreateRequest $fax_line_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation + * @param Model\FaxLineCreateRequest $fax_line_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineCreate. This method will eventually become unavailable */ - public function faxLineCreateAsyncWithHttpInfo($fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) + public function faxLineCreateAsyncWithHttpInfo(Model\FaxLineCreateRequest $fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) { $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; $request = $this->faxLineCreateRequest($fax_line_create_request, $contentType); @@ -1094,9 +1050,9 @@ public function faxLineCreateAsyncWithHttpInfo($fax_line_create_request, string ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1105,7 +1061,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -1119,7 +1075,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1128,24 +1084,22 @@ function ($exception) { /** * Create request for operation 'faxLineCreate' * - * @param Model\FaxLineCreateRequest $fax_line_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation + * @param Model\FaxLineCreateRequest $fax_line_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineCreate. This method will eventually become unavailable */ - public function faxLineCreateRequest($fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) + public function faxLineCreateRequest(Model\FaxLineCreateRequest $fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) { - // verify the required parameter 'fax_line_create_request' is set if ($fax_line_create_request === null || (is_array($fax_line_create_request) && count($fax_line_create_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $fax_line_create_request when calling faxLineCreate' ); } - $resourcePath = '/fax_line/create'; $formParams = []; $queryParams = []; @@ -1159,11 +1113,8 @@ public function faxLineCreateRequest($fax_line_create_request, string $contentTy $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1171,7 +1122,7 @@ public function faxLineCreateRequest($fax_line_create_request, string $contentTy // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($fax_line_create_request)); } else { $httpBody = $fax_line_create_request; @@ -1184,7 +1135,7 @@ public function faxLineCreateRequest($fax_line_create_request, string $contentTy foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1201,9 +1152,8 @@ public function faxLineCreateRequest($fax_line_create_request, string $contentTy $payloadHook('multipart', $multipartContents, $fax_line_create_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1242,13 +1192,12 @@ public function faxLineCreateRequest($fax_line_create_request, string $contentTy * * Delete Fax Line * - * @param Model\FaxLineDeleteRequest $fax_line_delete_request fax_line_delete_request (required) + * @param Model\FaxLineDeleteRequest $fax_line_delete_request fax_line_delete_request (required) * * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return void + * @throws InvalidArgumentException */ - public function faxLineDelete($fax_line_delete_request) + public function faxLineDelete(Model\FaxLineDeleteRequest $fax_line_delete_request) { $this->faxLineDeleteWithHttpInfo($fax_line_delete_request); } @@ -1258,15 +1207,15 @@ public function faxLineDelete($fax_line_delete_request) * * Delete Fax Line * - * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation + * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation * - * @throws 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) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineDelete. This method will eventually become unavailable */ - public function faxLineDeleteWithHttpInfo($fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) + public function faxLineDeleteWithHttpInfo(Model\FaxLineDeleteRequest $fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) { $request = $this->faxLineDeleteRequest($fax_line_delete_request, $contentType); @@ -1278,14 +1227,14 @@ public function faxLineDeleteWithHttpInfo($fax_line_delete_request, string $cont } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1293,16 +1242,12 @@ public function faxLineDeleteWithHttpInfo($fax_line_delete_request, string $cont $statusCode = $response->getStatusCode(); - return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } switch ($e->getCode()) { - } throw $e; } @@ -1313,14 +1258,14 @@ public function faxLineDeleteWithHttpInfo($fax_line_delete_request, string $cont * * Delete Fax Line * - * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation + * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineDelete. This method will eventually become unavailable */ - public function faxLineDeleteAsync($fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) + public function faxLineDeleteAsync(Model\FaxLineDeleteRequest $fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) { return $this->faxLineDeleteAsyncWithHttpInfo($fax_line_delete_request, $contentType) ->then( @@ -1335,14 +1280,14 @@ function ($response) { * * Delete Fax Line * - * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation + * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineDelete. This method will eventually become unavailable */ - public function faxLineDeleteAsyncWithHttpInfo($fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) + public function faxLineDeleteAsyncWithHttpInfo(Model\FaxLineDeleteRequest $fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) { $returnType = ''; $request = $this->faxLineDeleteRequest($fax_line_delete_request, $contentType); @@ -1350,7 +1295,7 @@ public function faxLineDeleteAsyncWithHttpInfo($fax_line_delete_request, string return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( - function ($response) use ($returnType) { + function ($response) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { @@ -1364,7 +1309,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1373,24 +1318,22 @@ function ($exception) { /** * Create request for operation 'faxLineDelete' * - * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation + * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineDelete. This method will eventually become unavailable */ - public function faxLineDeleteRequest($fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) + public function faxLineDeleteRequest(Model\FaxLineDeleteRequest $fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) { - // verify the required parameter 'fax_line_delete_request' is set if ($fax_line_delete_request === null || (is_array($fax_line_delete_request) && count($fax_line_delete_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $fax_line_delete_request when calling faxLineDelete' ); } - $resourcePath = '/fax_line'; $formParams = []; $queryParams = []; @@ -1404,11 +1347,8 @@ public function faxLineDeleteRequest($fax_line_delete_request, string $contentTy $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1416,7 +1356,7 @@ public function faxLineDeleteRequest($fax_line_delete_request, string $contentTy // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($fax_line_delete_request)); } else { $httpBody = $fax_line_delete_request; @@ -1429,7 +1369,7 @@ public function faxLineDeleteRequest($fax_line_delete_request, string $contentTy foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1446,9 +1386,8 @@ public function faxLineDeleteRequest($fax_line_delete_request, string $contentTy $payloadHook('multipart', $multipartContents, $fax_line_delete_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1487,13 +1426,13 @@ public function faxLineDeleteRequest($fax_line_delete_request, string $contentTy * * Get Fax Line * - * @param string $number The Fax Line number (required) + * @param string $number The Fax Line number (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\FaxLineResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function faxLineGet($number) + public function faxLineGet(string $number) { list($response) = $this->faxLineGetWithHttpInfo($number); return $response; @@ -1504,15 +1443,15 @@ public function faxLineGet($number) * * Get Fax Line * - * @param string $number The Fax Line number (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation + * @param string $number The Fax Line number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\FaxLineResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineGet. This method will eventually become unavailable */ - public function faxLineGetWithHttpInfo($number, string $contentType = self::contentTypes['faxLineGet'][0]) + public function faxLineGetWithHttpInfo(string $number, string $contentType = self::contentTypes['faxLineGet'][0]) { $request = $this->faxLineGetRequest($number, $contentType); @@ -1524,14 +1463,14 @@ public function faxLineGetWithHttpInfo($number, string $contentType = self::cont } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1539,7 +1478,6 @@ public function faxLineGetWithHttpInfo($number, string $contentType = self::cont $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -1549,17 +1487,16 @@ public function faxLineGetWithHttpInfo($number, string $contentType = self::cont return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FaxLineResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\FaxLineResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1576,9 +1513,8 @@ public function faxLineGetWithHttpInfo($number, string $contentType = self::cont return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxLineResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -1586,23 +1522,23 @@ public function faxLineGetWithHttpInfo($number, string $contentType = self::cont sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1619,11 +1555,9 @@ public function faxLineGetWithHttpInfo($number, string $contentType = self::cont return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1636,7 +1570,6 @@ public function faxLineGetWithHttpInfo($number, string $contentType = self::cont ); $e->setResponseObject($data); break; - } throw $e; } @@ -1647,14 +1580,14 @@ public function faxLineGetWithHttpInfo($number, string $contentType = self::cont * * Get Fax Line * - * @param string $number The Fax Line number (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation + * @param string $number The Fax Line number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineGet. This method will eventually become unavailable */ - public function faxLineGetAsync($number, string $contentType = self::contentTypes['faxLineGet'][0]) + public function faxLineGetAsync(string $number, string $contentType = self::contentTypes['faxLineGet'][0]) { return $this->faxLineGetAsyncWithHttpInfo($number, $contentType) ->then( @@ -1669,14 +1602,14 @@ function ($response) { * * Get Fax Line * - * @param string $number The Fax Line number (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation + * @param string $number The Fax Line number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineGet. This method will eventually become unavailable */ - public function faxLineGetAsyncWithHttpInfo($number, string $contentType = self::contentTypes['faxLineGet'][0]) + public function faxLineGetAsyncWithHttpInfo(string $number, string $contentType = self::contentTypes['faxLineGet'][0]) { $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; $request = $this->faxLineGetRequest($number, $contentType); @@ -1686,9 +1619,9 @@ public function faxLineGetAsyncWithHttpInfo($number, string $contentType = self: ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1697,7 +1630,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -1711,7 +1644,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1720,24 +1653,22 @@ function ($exception) { /** * Create request for operation 'faxLineGet' * - * @param string $number The Fax Line number (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation + * @param string $number The Fax Line number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineGet. This method will eventually become unavailable */ - public function faxLineGetRequest($number, string $contentType = self::contentTypes['faxLineGet'][0]) + public function faxLineGetRequest(string $number, string $contentType = self::contentTypes['faxLineGet'][0]) { - // verify the required parameter 'number' is set if ($number === null || (is_array($number) && count($number) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $number when calling faxLineGet' ); } - $resourcePath = '/fax_line'; $formParams = []; $queryParams = []; @@ -1755,11 +1686,8 @@ public function faxLineGetRequest($number, string $contentType = self::contentTy true // required ) ?? []); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1773,7 +1701,7 @@ public function faxLineGetRequest($number, string $contentType = self::contentTy foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1787,9 +1715,8 @@ public function faxLineGetRequest($number, string $contentType = self::contentTy } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1828,16 +1755,16 @@ public function faxLineGetRequest($number, string $contentType = self::contentTy * * List Fax Lines * - * @param string|null $account_id Account ID (optional) - * @param int|null $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param bool|null $show_team_lines Include Fax Lines belonging to team members in the list (optional) + * @param string|null $account_id Account ID (optional) + * @param int|null $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param bool|null $show_team_lines Include Fax Lines belonging to team members in the list (optional) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\FaxLineListResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function faxLineList($account_id = null, $page = 1, $page_size = 20, $show_team_lines = null) + public function faxLineList(?string $account_id = null, ?int $page = 1, ?int $page_size = 20, ?bool $show_team_lines = null) { list($response) = $this->faxLineListWithHttpInfo($account_id, $page, $page_size, $show_team_lines); return $response; @@ -1848,18 +1775,18 @@ public function faxLineList($account_id = null, $page = 1, $page_size = 20, $sho * * List Fax Lines * - * @param string|null $account_id Account ID (optional) - * @param int|null $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param bool|null $show_team_lines Include Fax Lines belonging to team members in the list (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation + * @param string|null $account_id Account ID (optional) + * @param int|null $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param bool|null $show_team_lines Include Fax Lines belonging to team members in the list (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\FaxLineListResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineList. This method will eventually become unavailable */ - public function faxLineListWithHttpInfo($account_id = null, $page = 1, $page_size = 20, $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) + public function faxLineListWithHttpInfo(?string $account_id = null, ?int $page = 1, ?int $page_size = 20, ?bool $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) { $request = $this->faxLineListRequest($account_id, $page, $page_size, $show_team_lines, $contentType); @@ -1871,14 +1798,14 @@ public function faxLineListWithHttpInfo($account_id = null, $page = 1, $page_siz } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1886,7 +1813,6 @@ public function faxLineListWithHttpInfo($account_id = null, $page = 1, $page_siz $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -1896,17 +1822,16 @@ public function faxLineListWithHttpInfo($account_id = null, $page = 1, $page_siz return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FaxLineListResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\FaxLineListResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1923,9 +1848,8 @@ public function faxLineListWithHttpInfo($account_id = null, $page = 1, $page_siz return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxLineListResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -1933,23 +1857,23 @@ public function faxLineListWithHttpInfo($account_id = null, $page = 1, $page_siz sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\FaxLineListResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1966,11 +1890,9 @@ public function faxLineListWithHttpInfo($account_id = null, $page = 1, $page_siz return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1983,7 +1905,6 @@ public function faxLineListWithHttpInfo($account_id = null, $page = 1, $page_siz ); $e->setResponseObject($data); break; - } throw $e; } @@ -1994,17 +1915,17 @@ public function faxLineListWithHttpInfo($account_id = null, $page = 1, $page_siz * * List Fax Lines * - * @param string|null $account_id Account ID (optional) - * @param int|null $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param bool|null $show_team_lines Include Fax Lines belonging to team members in the list (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation + * @param string|null $account_id Account ID (optional) + * @param int|null $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param bool|null $show_team_lines Include Fax Lines belonging to team members in the list (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineList. This method will eventually become unavailable */ - public function faxLineListAsync($account_id = null, $page = 1, $page_size = 20, $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) + public function faxLineListAsync(?string $account_id = null, ?int $page = 1, ?int $page_size = 20, ?bool $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) { return $this->faxLineListAsyncWithHttpInfo($account_id, $page, $page_size, $show_team_lines, $contentType) ->then( @@ -2019,17 +1940,17 @@ function ($response) { * * List Fax Lines * - * @param string|null $account_id Account ID (optional) - * @param int|null $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param bool|null $show_team_lines Include Fax Lines belonging to team members in the list (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation + * @param string|null $account_id Account ID (optional) + * @param int|null $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param bool|null $show_team_lines Include Fax Lines belonging to team members in the list (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineList. This method will eventually become unavailable */ - public function faxLineListAsyncWithHttpInfo($account_id = null, $page = 1, $page_size = 20, $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) + public function faxLineListAsyncWithHttpInfo(?string $account_id = null, ?int $page = 1, ?int $page_size = 20, ?bool $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) { $returnType = '\Dropbox\Sign\Model\FaxLineListResponse'; $request = $this->faxLineListRequest($account_id, $page, $page_size, $show_team_lines, $contentType); @@ -2039,9 +1960,9 @@ public function faxLineListAsyncWithHttpInfo($account_id = null, $page = 1, $pag ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2050,7 +1971,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -2064,7 +1985,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2073,24 +1994,18 @@ function ($exception) { /** * Create request for operation 'faxLineList' * - * @param string|null $account_id Account ID (optional) - * @param int|null $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param bool|null $show_team_lines Include Fax Lines belonging to team members in the list (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation + * @param string|null $account_id Account ID (optional) + * @param int|null $page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param bool|null $show_team_lines Include Fax Lines belonging to team members in the list (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineList. This method will eventually become unavailable */ - public function faxLineListRequest($account_id = null, $page = 1, $page_size = 20, $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) + public function faxLineListRequest(?string $account_id = null, ?int $page = 1, ?int $page_size = 20, ?bool $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) { - - - - - - $resourcePath = '/fax_line/list'; $formParams = []; $queryParams = []; @@ -2135,11 +2050,8 @@ public function faxLineListRequest($account_id = null, $page = 1, $page_size = 2 false // required ) ?? []); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -2153,7 +2065,7 @@ public function faxLineListRequest($account_id = null, $page = 1, $page_size = 2 foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -2167,9 +2079,8 @@ public function faxLineListRequest($account_id = null, $page = 1, $page_size = 2 } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2208,13 +2119,13 @@ public function faxLineListRequest($account_id = null, $page = 1, $page_size = 2 * * Remove Fax Line Access * - * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request fax_line_remove_user_request (required) + * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request fax_line_remove_user_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\FaxLineResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function faxLineRemoveUser($fax_line_remove_user_request) + public function faxLineRemoveUser(Model\FaxLineRemoveUserRequest $fax_line_remove_user_request) { list($response) = $this->faxLineRemoveUserWithHttpInfo($fax_line_remove_user_request); return $response; @@ -2225,15 +2136,15 @@ public function faxLineRemoveUser($fax_line_remove_user_request) * * Remove Fax Line Access * - * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation + * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\FaxLineResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineRemoveUser. This method will eventually become unavailable */ - public function faxLineRemoveUserWithHttpInfo($fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) + public function faxLineRemoveUserWithHttpInfo(Model\FaxLineRemoveUserRequest $fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) { $request = $this->faxLineRemoveUserRequest($fax_line_remove_user_request, $contentType); @@ -2245,14 +2156,14 @@ public function faxLineRemoveUserWithHttpInfo($fax_line_remove_user_request, str } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -2260,7 +2171,6 @@ public function faxLineRemoveUserWithHttpInfo($fax_line_remove_user_request, str $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -2270,17 +2180,16 @@ public function faxLineRemoveUserWithHttpInfo($fax_line_remove_user_request, str return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FaxLineResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\FaxLineResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2297,9 +2206,8 @@ public function faxLineRemoveUserWithHttpInfo($fax_line_remove_user_request, str return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxLineResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -2307,23 +2215,23 @@ public function faxLineRemoveUserWithHttpInfo($fax_line_remove_user_request, str sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2340,11 +2248,9 @@ public function faxLineRemoveUserWithHttpInfo($fax_line_remove_user_request, str return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2357,7 +2263,6 @@ public function faxLineRemoveUserWithHttpInfo($fax_line_remove_user_request, str ); $e->setResponseObject($data); break; - } throw $e; } @@ -2368,14 +2273,14 @@ public function faxLineRemoveUserWithHttpInfo($fax_line_remove_user_request, str * * Remove Fax Line Access * - * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation + * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineRemoveUser. This method will eventually become unavailable */ - public function faxLineRemoveUserAsync($fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) + public function faxLineRemoveUserAsync(Model\FaxLineRemoveUserRequest $fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) { return $this->faxLineRemoveUserAsyncWithHttpInfo($fax_line_remove_user_request, $contentType) ->then( @@ -2390,14 +2295,14 @@ function ($response) { * * Remove Fax Line Access * - * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation + * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineRemoveUser. This method will eventually become unavailable */ - public function faxLineRemoveUserAsyncWithHttpInfo($fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) + public function faxLineRemoveUserAsyncWithHttpInfo(Model\FaxLineRemoveUserRequest $fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) { $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; $request = $this->faxLineRemoveUserRequest($fax_line_remove_user_request, $contentType); @@ -2407,9 +2312,9 @@ public function faxLineRemoveUserAsyncWithHttpInfo($fax_line_remove_user_request ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2418,7 +2323,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -2432,7 +2337,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2441,24 +2346,22 @@ function ($exception) { /** * Create request for operation 'faxLineRemoveUser' * - * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation + * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::faxLineRemoveUser. This method will eventually become unavailable */ - public function faxLineRemoveUserRequest($fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) + public function faxLineRemoveUserRequest(Model\FaxLineRemoveUserRequest $fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) { - // verify the required parameter 'fax_line_remove_user_request' is set if ($fax_line_remove_user_request === null || (is_array($fax_line_remove_user_request) && count($fax_line_remove_user_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $fax_line_remove_user_request when calling faxLineRemoveUser' ); } - $resourcePath = '/fax_line/remove_user'; $formParams = []; $queryParams = []; @@ -2472,11 +2375,8 @@ public function faxLineRemoveUserRequest($fax_line_remove_user_request, string $ $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -2484,7 +2384,7 @@ public function faxLineRemoveUserRequest($fax_line_remove_user_request, string $ // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($fax_line_remove_user_request)); } else { $httpBody = $fax_line_remove_user_request; @@ -2497,7 +2397,7 @@ public function faxLineRemoveUserRequest($fax_line_remove_user_request, string $ foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -2514,9 +2414,8 @@ public function faxLineRemoveUserRequest($fax_line_remove_user_request, string $ $payloadHook('multipart', $multipartContents, $fax_line_remove_user_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2553,8 +2452,8 @@ public function faxLineRemoveUserRequest($fax_line_remove_user_request, string $ /** * Create http client option * - * @throws \RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -2562,7 +2461,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -2578,8 +2477,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -2589,9 +2488,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); } return [ @@ -2610,8 +2509,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/OAuthApi.php b/sdks/php/src/Api/OAuthApi.php index d2eab06d7..19b137a75 100644 --- a/sdks/php/src/Api/OAuthApi.php +++ b/sdks/php/src/Api/OAuthApi.php @@ -1,13 +1,10 @@ [ 'application/json', @@ -87,10 +79,7 @@ class OAuthApi protected $response; /** - * @param Configuration $config - * @param ClientInterface $client - * @param HeaderSelector $selector - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( ?Configuration $config = null, @@ -110,7 +99,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex($hostIndex): void + public function setHostIndex(int $hostIndex): void { $this->hostIndex = $hostIndex; } @@ -151,13 +140,13 @@ public function getResponse() * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request o_auth_token_generate_request (required) + * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request o_auth_token_generate_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\OAuthTokenResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function oauthTokenGenerate($o_auth_token_generate_request) + public function oauthTokenGenerate(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request) { list($response) = $this->oauthTokenGenerateWithHttpInfo($o_auth_token_generate_request); return $response; @@ -172,17 +161,17 @@ public function oauthTokenGenerate($o_auth_token_generate_request) * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) - * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead - * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation + * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) + * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\OAuthTokenResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::oauthTokenGenerate. This method will eventually become unavailable */ - public function oauthTokenGenerateWithHttpInfo($o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) + public function oauthTokenGenerateWithHttpInfo(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) { $request = $this->oauthTokenGenerateRequest($o_auth_token_generate_request, $hostIndex, $variables, $contentType); @@ -194,14 +183,14 @@ public function oauthTokenGenerateWithHttpInfo($o_auth_token_generate_request, ? } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -209,7 +198,6 @@ public function oauthTokenGenerateWithHttpInfo($o_auth_token_generate_request, ? $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -219,17 +207,16 @@ public function oauthTokenGenerateWithHttpInfo($o_auth_token_generate_request, ? return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\OAuthTokenResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\OAuthTokenResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -246,9 +233,8 @@ public function oauthTokenGenerateWithHttpInfo($o_auth_token_generate_request, ? return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\OAuthTokenResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -256,23 +242,23 @@ public function oauthTokenGenerateWithHttpInfo($o_auth_token_generate_request, ? sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\OAuthTokenResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -289,11 +275,9 @@ public function oauthTokenGenerateWithHttpInfo($o_auth_token_generate_request, ? return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -306,7 +290,6 @@ public function oauthTokenGenerateWithHttpInfo($o_auth_token_generate_request, ? ); $e->setResponseObject($data); break; - } throw $e; } @@ -321,16 +304,16 @@ public function oauthTokenGenerateWithHttpInfo($o_auth_token_generate_request, ? * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) - * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead - * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation + * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) + * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::oauthTokenGenerate. This method will eventually become unavailable */ - public function oauthTokenGenerateAsync($o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) + public function oauthTokenGenerateAsync(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) { return $this->oauthTokenGenerateAsyncWithHttpInfo($o_auth_token_generate_request, $hostIndex, $variables, $contentType) ->then( @@ -349,16 +332,16 @@ function ($response) { * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) - * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead - * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation + * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) + * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::oauthTokenGenerate. This method will eventually become unavailable */ - public function oauthTokenGenerateAsyncWithHttpInfo($o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) + public function oauthTokenGenerateAsyncWithHttpInfo(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) { $returnType = '\Dropbox\Sign\Model\OAuthTokenResponse'; $request = $this->oauthTokenGenerateRequest($o_auth_token_generate_request, $hostIndex, $variables, $contentType); @@ -368,9 +351,9 @@ public function oauthTokenGenerateAsyncWithHttpInfo($o_auth_token_generate_reque ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -379,7 +362,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -393,7 +376,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -402,30 +385,28 @@ function ($exception) { /** * Create request for operation 'oauthTokenGenerate' * - * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. - * if needed, use the 'variables' parameter to pass variables to the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) - * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead - * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation + * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) + * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::oauthTokenGenerate. This method will eventually become unavailable */ - public function oauthTokenGenerateRequest($o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) + public function oauthTokenGenerateRequest(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) { - // verify the required parameter 'o_auth_token_generate_request' is set if ($o_auth_token_generate_request === null || (is_array($o_auth_token_generate_request) && count($o_auth_token_generate_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $o_auth_token_generate_request when calling oauthTokenGenerate' ); } - $resourcePath = '/oauth/token'; $formParams = []; $queryParams = []; @@ -439,11 +420,8 @@ public function oauthTokenGenerateRequest($o_auth_token_generate_request, ?int $ $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -451,7 +429,7 @@ public function oauthTokenGenerateRequest($o_auth_token_generate_request, ?int $ // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($o_auth_token_generate_request)); } else { $httpBody = $o_auth_token_generate_request; @@ -464,7 +442,7 @@ public function oauthTokenGenerateRequest($o_auth_token_generate_request, ?int $ foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -481,9 +459,8 @@ public function oauthTokenGenerateRequest($o_auth_token_generate_request, ?int $ $payloadHook('multipart', $multipartContents, $o_auth_token_generate_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -491,7 +468,6 @@ public function oauthTokenGenerateRequest($o_auth_token_generate_request, ?int $ } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -503,7 +479,7 @@ public function oauthTokenGenerateRequest($o_auth_token_generate_request, ?int $ $headers ); - # Preserve the original behavior of server indexing. + // Preserve the original behavior of server indexing. if ($hostIndex === null) { $hostIndex = $this->hostIndex; } @@ -511,7 +487,7 @@ public function oauthTokenGenerateRequest($o_auth_token_generate_request, ?int $ $hostSettings = $this->getHostSettingsForoauthTokenGenerate(); if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { - throw new \InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than ".count($hostSettings)); + throw new InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than " . count($hostSettings)); } $operationHost = Configuration::getHostString($hostSettings, $hostIndex, $variables); $query = ObjectSerializer::buildQuery($queryParams); @@ -532,9 +508,9 @@ protected function getHostSettingsForoauthTokenGenerate(): array { return [ [ - "url" => "https://app.hellosign.com", - "description" => "No description provided", - ] + 'url' => 'https://app.hellosign.com', + 'description' => 'No description provided', + ], ]; } @@ -547,13 +523,13 @@ protected function getHostSettingsForoauthTokenGenerate(): array * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request o_auth_token_refresh_request (required) + * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request o_auth_token_refresh_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\OAuthTokenResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function oauthTokenRefresh($o_auth_token_refresh_request) + public function oauthTokenRefresh(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request) { list($response) = $this->oauthTokenRefreshWithHttpInfo($o_auth_token_refresh_request); return $response; @@ -568,17 +544,17 @@ public function oauthTokenRefresh($o_auth_token_refresh_request) * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) - * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead - * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation + * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) + * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\OAuthTokenResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::oauthTokenRefresh. This method will eventually become unavailable */ - public function oauthTokenRefreshWithHttpInfo($o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) + public function oauthTokenRefreshWithHttpInfo(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) { $request = $this->oauthTokenRefreshRequest($o_auth_token_refresh_request, $hostIndex, $variables, $contentType); @@ -590,14 +566,14 @@ public function oauthTokenRefreshWithHttpInfo($o_auth_token_refresh_request, ?in } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -605,7 +581,6 @@ public function oauthTokenRefreshWithHttpInfo($o_auth_token_refresh_request, ?in $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -615,17 +590,16 @@ public function oauthTokenRefreshWithHttpInfo($o_auth_token_refresh_request, ?in return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\OAuthTokenResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\OAuthTokenResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -642,9 +616,8 @@ public function oauthTokenRefreshWithHttpInfo($o_auth_token_refresh_request, ?in return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\OAuthTokenResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -652,23 +625,23 @@ public function oauthTokenRefreshWithHttpInfo($o_auth_token_refresh_request, ?in sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\OAuthTokenResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -685,11 +658,9 @@ public function oauthTokenRefreshWithHttpInfo($o_auth_token_refresh_request, ?in return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -702,7 +673,6 @@ public function oauthTokenRefreshWithHttpInfo($o_auth_token_refresh_request, ?in ); $e->setResponseObject($data); break; - } throw $e; } @@ -717,16 +687,16 @@ public function oauthTokenRefreshWithHttpInfo($o_auth_token_refresh_request, ?in * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) - * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead - * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation + * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) + * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::oauthTokenRefresh. This method will eventually become unavailable */ - public function oauthTokenRefreshAsync($o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) + public function oauthTokenRefreshAsync(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) { return $this->oauthTokenRefreshAsyncWithHttpInfo($o_auth_token_refresh_request, $hostIndex, $variables, $contentType) ->then( @@ -745,16 +715,16 @@ function ($response) { * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) - * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead - * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation + * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) + * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::oauthTokenRefresh. This method will eventually become unavailable */ - public function oauthTokenRefreshAsyncWithHttpInfo($o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) + public function oauthTokenRefreshAsyncWithHttpInfo(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) { $returnType = '\Dropbox\Sign\Model\OAuthTokenResponse'; $request = $this->oauthTokenRefreshRequest($o_auth_token_refresh_request, $hostIndex, $variables, $contentType); @@ -764,9 +734,9 @@ public function oauthTokenRefreshAsyncWithHttpInfo($o_auth_token_refresh_request ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -775,7 +745,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -789,7 +759,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -798,30 +768,28 @@ function ($exception) { /** * Create request for operation 'oauthTokenRefresh' * - * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. - * if needed, use the 'variables' parameter to pass variables to the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * - * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) - * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead - * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation + * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) + * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::oauthTokenRefresh. This method will eventually become unavailable */ - public function oauthTokenRefreshRequest($o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) + public function oauthTokenRefreshRequest(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) { - // verify the required parameter 'o_auth_token_refresh_request' is set if ($o_auth_token_refresh_request === null || (is_array($o_auth_token_refresh_request) && count($o_auth_token_refresh_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $o_auth_token_refresh_request when calling oauthTokenRefresh' ); } - $resourcePath = '/oauth/token?refresh'; $formParams = []; $queryParams = []; @@ -835,11 +803,8 @@ public function oauthTokenRefreshRequest($o_auth_token_refresh_request, ?int $ho $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -847,7 +812,7 @@ public function oauthTokenRefreshRequest($o_auth_token_refresh_request, ?int $ho // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($o_auth_token_refresh_request)); } else { $httpBody = $o_auth_token_refresh_request; @@ -860,7 +825,7 @@ public function oauthTokenRefreshRequest($o_auth_token_refresh_request, ?int $ho foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -877,9 +842,8 @@ public function oauthTokenRefreshRequest($o_auth_token_refresh_request, ?int $ho $payloadHook('multipart', $multipartContents, $o_auth_token_refresh_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -887,7 +851,6 @@ public function oauthTokenRefreshRequest($o_auth_token_refresh_request, ?int $ho } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -899,7 +862,7 @@ public function oauthTokenRefreshRequest($o_auth_token_refresh_request, ?int $ho $headers ); - # Preserve the original behavior of server indexing. + // Preserve the original behavior of server indexing. if ($hostIndex === null) { $hostIndex = $this->hostIndex; } @@ -907,7 +870,7 @@ public function oauthTokenRefreshRequest($o_auth_token_refresh_request, ?int $ho $hostSettings = $this->getHostSettingsForoauthTokenRefresh(); if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { - throw new \InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than ".count($hostSettings)); + throw new InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than " . count($hostSettings)); } $operationHost = Configuration::getHostString($hostSettings, $hostIndex, $variables); $query = ObjectSerializer::buildQuery($queryParams); @@ -928,17 +891,17 @@ protected function getHostSettingsForoauthTokenRefresh(): array { return [ [ - "url" => "https://app.hellosign.com", - "description" => "No description provided", - ] + 'url' => 'https://app.hellosign.com', + 'description' => 'No description provided', + ], ]; } /** * Create http client option * - * @throws \RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -946,7 +909,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -962,8 +925,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -973,9 +936,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); } return [ @@ -994,8 +957,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/ReportApi.php b/sdks/php/src/Api/ReportApi.php index 4db2fcd16..cde61fcaf 100644 --- a/sdks/php/src/Api/ReportApi.php +++ b/sdks/php/src/Api/ReportApi.php @@ -1,13 +1,10 @@ [ 'application/json', @@ -84,10 +76,7 @@ class ReportApi protected $response; /** - * @param Configuration $config - * @param ClientInterface $client - * @param HeaderSelector $selector - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( ?Configuration $config = null, @@ -107,7 +96,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex($hostIndex): void + public function setHostIndex(int $hostIndex): void { $this->hostIndex = $hostIndex; } @@ -144,13 +133,13 @@ public function getResponse() * * Create Report * - * @param Model\ReportCreateRequest $report_create_request report_create_request (required) + * @param Model\ReportCreateRequest $report_create_request report_create_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\ReportCreateResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function reportCreate($report_create_request) + public function reportCreate(Model\ReportCreateRequest $report_create_request) { list($response) = $this->reportCreateWithHttpInfo($report_create_request); return $response; @@ -161,15 +150,15 @@ public function reportCreate($report_create_request) * * Create Report * - * @param Model\ReportCreateRequest $report_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation + * @param Model\ReportCreateRequest $report_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\ReportCreateResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::reportCreate. This method will eventually become unavailable */ - public function reportCreateWithHttpInfo($report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) + public function reportCreateWithHttpInfo(Model\ReportCreateRequest $report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) { $request = $this->reportCreateRequest($report_create_request, $contentType); @@ -181,14 +170,14 @@ public function reportCreateWithHttpInfo($report_create_request, string $content } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -196,7 +185,6 @@ public function reportCreateWithHttpInfo($report_create_request, string $content $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -206,17 +194,16 @@ public function reportCreateWithHttpInfo($report_create_request, string $content return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\ReportCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\ReportCreateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -233,9 +220,8 @@ public function reportCreateWithHttpInfo($report_create_request, string $content return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ReportCreateResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -243,23 +229,23 @@ public function reportCreateWithHttpInfo($report_create_request, string $content sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\ReportCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -276,11 +262,9 @@ public function reportCreateWithHttpInfo($report_create_request, string $content return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -293,7 +277,6 @@ public function reportCreateWithHttpInfo($report_create_request, string $content ); $e->setResponseObject($data); break; - } throw $e; } @@ -304,14 +287,14 @@ public function reportCreateWithHttpInfo($report_create_request, string $content * * Create Report * - * @param Model\ReportCreateRequest $report_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation + * @param Model\ReportCreateRequest $report_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::reportCreate. This method will eventually become unavailable */ - public function reportCreateAsync($report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) + public function reportCreateAsync(Model\ReportCreateRequest $report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) { return $this->reportCreateAsyncWithHttpInfo($report_create_request, $contentType) ->then( @@ -326,14 +309,14 @@ function ($response) { * * Create Report * - * @param Model\ReportCreateRequest $report_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation + * @param Model\ReportCreateRequest $report_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::reportCreate. This method will eventually become unavailable */ - public function reportCreateAsyncWithHttpInfo($report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) + public function reportCreateAsyncWithHttpInfo(Model\ReportCreateRequest $report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) { $returnType = '\Dropbox\Sign\Model\ReportCreateResponse'; $request = $this->reportCreateRequest($report_create_request, $contentType); @@ -343,9 +326,9 @@ public function reportCreateAsyncWithHttpInfo($report_create_request, string $co ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -354,7 +337,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -368,7 +351,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -377,24 +360,22 @@ function ($exception) { /** * Create request for operation 'reportCreate' * - * @param Model\ReportCreateRequest $report_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation + * @param Model\ReportCreateRequest $report_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::reportCreate. This method will eventually become unavailable */ - public function reportCreateRequest($report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) + public function reportCreateRequest(Model\ReportCreateRequest $report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) { - // verify the required parameter 'report_create_request' is set if ($report_create_request === null || (is_array($report_create_request) && count($report_create_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $report_create_request when calling reportCreate' ); } - $resourcePath = '/report/create'; $formParams = []; $queryParams = []; @@ -408,11 +389,8 @@ public function reportCreateRequest($report_create_request, string $contentType $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -420,7 +398,7 @@ public function reportCreateRequest($report_create_request, string $contentType // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($report_create_request)); } else { $httpBody = $report_create_request; @@ -433,7 +411,7 @@ public function reportCreateRequest($report_create_request, string $contentType foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -450,9 +428,8 @@ public function reportCreateRequest($report_create_request, string $contentType $payloadHook('multipart', $multipartContents, $report_create_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -489,8 +466,8 @@ public function reportCreateRequest($report_create_request, string $contentType /** * Create http client option * - * @throws \RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -498,7 +475,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -514,8 +491,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -525,9 +502,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); } return [ @@ -546,8 +523,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/SignatureRequestApi.php b/sdks/php/src/Api/SignatureRequestApi.php index b03c9e5b2..3f6ad70ec 100644 --- a/sdks/php/src/Api/SignatureRequestApi.php +++ b/sdks/php/src/Api/SignatureRequestApi.php @@ -1,13 +1,10 @@ [ 'application/json', @@ -151,10 +144,7 @@ class SignatureRequestApi protected $response; /** - * @param Configuration $config - * @param ClientInterface $client - * @param HeaderSelector $selector - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( ?Configuration $config = null, @@ -174,7 +164,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex($hostIndex): void + public function setHostIndex(int $hostIndex): void { $this->hostIndex = $hostIndex; } @@ -211,13 +201,13 @@ public function getResponse() * * Embedded Bulk Send with Template * - * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request signature_request_bulk_create_embedded_with_template_request (required) + * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request signature_request_bulk_create_embedded_with_template_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\BulkSendJobSendResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function signatureRequestBulkCreateEmbeddedWithTemplate($signature_request_bulk_create_embedded_with_template_request) + public function signatureRequestBulkCreateEmbeddedWithTemplate(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request) { list($response) = $this->signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo($signature_request_bulk_create_embedded_with_template_request); return $response; @@ -228,15 +218,15 @@ public function signatureRequestBulkCreateEmbeddedWithTemplate($signature_reques * * Embedded Bulk Send with Template * - * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\BulkSendJobSendResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestBulkCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo($signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) + public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) { $request = $this->signatureRequestBulkCreateEmbeddedWithTemplateRequest($signature_request_bulk_create_embedded_with_template_request, $contentType); @@ -248,14 +238,14 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo($sign } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -263,7 +253,6 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo($sign $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -273,17 +262,16 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo($sign return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\BulkSendJobSendResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\BulkSendJobSendResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -300,9 +288,8 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo($sign return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\BulkSendJobSendResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -310,23 +297,23 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo($sign sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\BulkSendJobSendResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -343,11 +330,9 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo($sign return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -360,7 +345,6 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo($sign ); $e->setResponseObject($data); break; - } throw $e; } @@ -371,14 +355,14 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo($sign * * Embedded Bulk Send with Template * - * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestBulkCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkCreateEmbeddedWithTemplateAsync($signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) + public function signatureRequestBulkCreateEmbeddedWithTemplateAsync(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) { return $this->signatureRequestBulkCreateEmbeddedWithTemplateAsyncWithHttpInfo($signature_request_bulk_create_embedded_with_template_request, $contentType) ->then( @@ -393,14 +377,14 @@ function ($response) { * * Embedded Bulk Send with Template * - * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestBulkCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkCreateEmbeddedWithTemplateAsyncWithHttpInfo($signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) + public function signatureRequestBulkCreateEmbeddedWithTemplateAsyncWithHttpInfo(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\BulkSendJobSendResponse'; $request = $this->signatureRequestBulkCreateEmbeddedWithTemplateRequest($signature_request_bulk_create_embedded_with_template_request, $contentType); @@ -410,9 +394,9 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateAsyncWithHttpInfo( ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -421,7 +405,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -435,7 +419,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -444,24 +428,22 @@ function ($exception) { /** * Create request for operation 'signatureRequestBulkCreateEmbeddedWithTemplate' * - * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestBulkCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkCreateEmbeddedWithTemplateRequest($signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) + public function signatureRequestBulkCreateEmbeddedWithTemplateRequest(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) { - // verify the required parameter 'signature_request_bulk_create_embedded_with_template_request' is set if ($signature_request_bulk_create_embedded_with_template_request === null || (is_array($signature_request_bulk_create_embedded_with_template_request) && count($signature_request_bulk_create_embedded_with_template_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_bulk_create_embedded_with_template_request when calling signatureRequestBulkCreateEmbeddedWithTemplate' ); } - $resourcePath = '/signature_request/bulk_create_embedded_with_template'; $formParams = []; $queryParams = []; @@ -475,11 +457,8 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateRequest($signature $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -487,7 +466,7 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateRequest($signature // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_bulk_create_embedded_with_template_request)); } else { $httpBody = $signature_request_bulk_create_embedded_with_template_request; @@ -500,7 +479,7 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateRequest($signature foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -517,9 +496,8 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateRequest($signature $payloadHook('multipart', $multipartContents, $signature_request_bulk_create_embedded_with_template_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -558,13 +536,13 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateRequest($signature * * Bulk Send with Template * - * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request signature_request_bulk_send_with_template_request (required) + * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request signature_request_bulk_send_with_template_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\BulkSendJobSendResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function signatureRequestBulkSendWithTemplate($signature_request_bulk_send_with_template_request) + public function signatureRequestBulkSendWithTemplate(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request) { list($response) = $this->signatureRequestBulkSendWithTemplateWithHttpInfo($signature_request_bulk_send_with_template_request); return $response; @@ -575,15 +553,15 @@ public function signatureRequestBulkSendWithTemplate($signature_request_bulk_sen * * Bulk Send with Template * - * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\BulkSendJobSendResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestBulkSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkSendWithTemplateWithHttpInfo($signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) + public function signatureRequestBulkSendWithTemplateWithHttpInfo(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) { $request = $this->signatureRequestBulkSendWithTemplateRequest($signature_request_bulk_send_with_template_request, $contentType); @@ -595,14 +573,14 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo($signature_requ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -610,7 +588,6 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo($signature_requ $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -620,17 +597,16 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo($signature_requ return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\BulkSendJobSendResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\BulkSendJobSendResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -647,9 +623,8 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo($signature_requ return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\BulkSendJobSendResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -657,23 +632,23 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo($signature_requ sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\BulkSendJobSendResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -690,11 +665,9 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo($signature_requ return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -707,7 +680,6 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo($signature_requ ); $e->setResponseObject($data); break; - } throw $e; } @@ -718,14 +690,14 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo($signature_requ * * Bulk Send with Template * - * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestBulkSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkSendWithTemplateAsync($signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) + public function signatureRequestBulkSendWithTemplateAsync(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) { return $this->signatureRequestBulkSendWithTemplateAsyncWithHttpInfo($signature_request_bulk_send_with_template_request, $contentType) ->then( @@ -740,14 +712,14 @@ function ($response) { * * Bulk Send with Template * - * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestBulkSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkSendWithTemplateAsyncWithHttpInfo($signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) + public function signatureRequestBulkSendWithTemplateAsyncWithHttpInfo(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\BulkSendJobSendResponse'; $request = $this->signatureRequestBulkSendWithTemplateRequest($signature_request_bulk_send_with_template_request, $contentType); @@ -757,9 +729,9 @@ public function signatureRequestBulkSendWithTemplateAsyncWithHttpInfo($signature ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -768,7 +740,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -782,7 +754,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -791,24 +763,22 @@ function ($exception) { /** * Create request for operation 'signatureRequestBulkSendWithTemplate' * - * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestBulkSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkSendWithTemplateRequest($signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) + public function signatureRequestBulkSendWithTemplateRequest(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) { - // verify the required parameter 'signature_request_bulk_send_with_template_request' is set if ($signature_request_bulk_send_with_template_request === null || (is_array($signature_request_bulk_send_with_template_request) && count($signature_request_bulk_send_with_template_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_bulk_send_with_template_request when calling signatureRequestBulkSendWithTemplate' ); } - $resourcePath = '/signature_request/bulk_send_with_template'; $formParams = []; $queryParams = []; @@ -822,11 +792,8 @@ public function signatureRequestBulkSendWithTemplateRequest($signature_request_b $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -834,7 +801,7 @@ public function signatureRequestBulkSendWithTemplateRequest($signature_request_b // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_bulk_send_with_template_request)); } else { $httpBody = $signature_request_bulk_send_with_template_request; @@ -847,7 +814,7 @@ public function signatureRequestBulkSendWithTemplateRequest($signature_request_b foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -864,9 +831,8 @@ public function signatureRequestBulkSendWithTemplateRequest($signature_request_b $payloadHook('multipart', $multipartContents, $signature_request_bulk_send_with_template_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -909,13 +875,12 @@ public function signatureRequestBulkSendWithTemplateRequest($signature_request_b * * Cancel Incomplete Signature Request * - * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) + * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) * * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return void + * @throws InvalidArgumentException */ - public function signatureRequestCancel($signature_request_id) + public function signatureRequestCancel(string $signature_request_id) { $this->signatureRequestCancelWithHttpInfo($signature_request_id); } @@ -925,15 +890,15 @@ public function signatureRequestCancel($signature_request_id) * * Cancel Incomplete Signature Request * - * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation + * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation * - * @throws 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) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestCancel. This method will eventually become unavailable */ - public function signatureRequestCancelWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) + public function signatureRequestCancelWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) { $request = $this->signatureRequestCancelRequest($signature_request_id, $contentType); @@ -945,14 +910,14 @@ public function signatureRequestCancelWithHttpInfo($signature_request_id, string } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -960,16 +925,12 @@ public function signatureRequestCancelWithHttpInfo($signature_request_id, string $statusCode = $response->getStatusCode(); - return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } switch ($e->getCode()) { - } throw $e; } @@ -980,14 +941,14 @@ public function signatureRequestCancelWithHttpInfo($signature_request_id, string * * Cancel Incomplete Signature Request * - * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation + * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestCancel. This method will eventually become unavailable */ - public function signatureRequestCancelAsync($signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) + public function signatureRequestCancelAsync(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) { return $this->signatureRequestCancelAsyncWithHttpInfo($signature_request_id, $contentType) ->then( @@ -1002,14 +963,14 @@ function ($response) { * * Cancel Incomplete Signature Request * - * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation + * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestCancel. This method will eventually become unavailable */ - public function signatureRequestCancelAsyncWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) + public function signatureRequestCancelAsyncWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) { $returnType = ''; $request = $this->signatureRequestCancelRequest($signature_request_id, $contentType); @@ -1017,7 +978,7 @@ public function signatureRequestCancelAsyncWithHttpInfo($signature_request_id, s return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( - function ($response) use ($returnType) { + function ($response) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { @@ -1031,7 +992,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1040,24 +1001,22 @@ function ($exception) { /** * Create request for operation 'signatureRequestCancel' * - * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation + * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestCancel. This method will eventually become unavailable */ - public function signatureRequestCancelRequest($signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) + public function signatureRequestCancelRequest(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) { - // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestCancel' ); } - $resourcePath = '/signature_request/cancel/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -1065,20 +1024,17 @@ public function signatureRequestCancelRequest($signature_request_id, string $con $httpBody = ''; $multipart = false; - - // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1092,7 +1048,7 @@ public function signatureRequestCancelRequest($signature_request_id, string $con foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1106,9 +1062,8 @@ public function signatureRequestCancelRequest($signature_request_id, string $con } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1151,13 +1106,13 @@ public function signatureRequestCancelRequest($signature_request_id, string $con * * Create Embedded Signature Request * - * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request signature_request_create_embedded_request (required) + * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request signature_request_create_embedded_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function signatureRequestCreateEmbedded($signature_request_create_embedded_request) + public function signatureRequestCreateEmbedded(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request) { list($response) = $this->signatureRequestCreateEmbeddedWithHttpInfo($signature_request_create_embedded_request); return $response; @@ -1168,15 +1123,15 @@ public function signatureRequestCreateEmbedded($signature_request_create_embedde * * Create Embedded Signature Request * - * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation + * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestCreateEmbedded. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedWithHttpInfo($signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) + public function signatureRequestCreateEmbeddedWithHttpInfo(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) { $request = $this->signatureRequestCreateEmbeddedRequest($signature_request_create_embedded_request, $contentType); @@ -1188,14 +1143,14 @@ public function signatureRequestCreateEmbeddedWithHttpInfo($signature_request_cr } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1203,7 +1158,6 @@ public function signatureRequestCreateEmbeddedWithHttpInfo($signature_request_cr $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -1213,17 +1167,16 @@ public function signatureRequestCreateEmbeddedWithHttpInfo($signature_request_cr return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1240,9 +1193,8 @@ public function signatureRequestCreateEmbeddedWithHttpInfo($signature_request_cr return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -1250,23 +1202,23 @@ public function signatureRequestCreateEmbeddedWithHttpInfo($signature_request_cr sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1283,11 +1235,9 @@ public function signatureRequestCreateEmbeddedWithHttpInfo($signature_request_cr return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1300,7 +1250,6 @@ public function signatureRequestCreateEmbeddedWithHttpInfo($signature_request_cr ); $e->setResponseObject($data); break; - } throw $e; } @@ -1311,14 +1260,14 @@ public function signatureRequestCreateEmbeddedWithHttpInfo($signature_request_cr * * Create Embedded Signature Request * - * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation + * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestCreateEmbedded. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedAsync($signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) + public function signatureRequestCreateEmbeddedAsync(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) { return $this->signatureRequestCreateEmbeddedAsyncWithHttpInfo($signature_request_create_embedded_request, $contentType) ->then( @@ -1333,14 +1282,14 @@ function ($response) { * * Create Embedded Signature Request * - * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation + * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestCreateEmbedded. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedAsyncWithHttpInfo($signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) + public function signatureRequestCreateEmbeddedAsyncWithHttpInfo(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestCreateEmbeddedRequest($signature_request_create_embedded_request, $contentType); @@ -1350,9 +1299,9 @@ public function signatureRequestCreateEmbeddedAsyncWithHttpInfo($signature_reque ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1361,7 +1310,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -1375,7 +1324,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1384,24 +1333,22 @@ function ($exception) { /** * Create request for operation 'signatureRequestCreateEmbedded' * - * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation + * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestCreateEmbedded. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedRequest($signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) + public function signatureRequestCreateEmbeddedRequest(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) { - // verify the required parameter 'signature_request_create_embedded_request' is set if ($signature_request_create_embedded_request === null || (is_array($signature_request_create_embedded_request) && count($signature_request_create_embedded_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_create_embedded_request when calling signatureRequestCreateEmbedded' ); } - $resourcePath = '/signature_request/create_embedded'; $formParams = []; $queryParams = []; @@ -1415,11 +1362,8 @@ public function signatureRequestCreateEmbeddedRequest($signature_request_create_ $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1427,7 +1371,7 @@ public function signatureRequestCreateEmbeddedRequest($signature_request_create_ // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_create_embedded_request)); } else { $httpBody = $signature_request_create_embedded_request; @@ -1440,7 +1384,7 @@ public function signatureRequestCreateEmbeddedRequest($signature_request_create_ foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1457,9 +1401,8 @@ public function signatureRequestCreateEmbeddedRequest($signature_request_create_ $payloadHook('multipart', $multipartContents, $signature_request_create_embedded_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1502,13 +1445,13 @@ public function signatureRequestCreateEmbeddedRequest($signature_request_create_ * * Create Embedded Signature Request with Template * - * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request signature_request_create_embedded_with_template_request (required) + * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request signature_request_create_embedded_with_template_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function signatureRequestCreateEmbeddedWithTemplate($signature_request_create_embedded_with_template_request) + public function signatureRequestCreateEmbeddedWithTemplate(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request) { list($response) = $this->signatureRequestCreateEmbeddedWithTemplateWithHttpInfo($signature_request_create_embedded_with_template_request); return $response; @@ -1519,15 +1462,15 @@ public function signatureRequestCreateEmbeddedWithTemplate($signature_request_cr * * Create Embedded Signature Request with Template * - * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo($signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) + public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) { $request = $this->signatureRequestCreateEmbeddedWithTemplateRequest($signature_request_create_embedded_with_template_request, $contentType); @@ -1539,14 +1482,14 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo($signatur } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1554,7 +1497,6 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo($signatur $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -1564,17 +1506,16 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo($signatur return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1591,9 +1532,8 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo($signatur return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -1601,23 +1541,23 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo($signatur sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1634,11 +1574,9 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo($signatur return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1651,7 +1589,6 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo($signatur ); $e->setResponseObject($data); break; - } throw $e; } @@ -1662,14 +1599,14 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo($signatur * * Create Embedded Signature Request with Template * - * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedWithTemplateAsync($signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) + public function signatureRequestCreateEmbeddedWithTemplateAsync(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) { return $this->signatureRequestCreateEmbeddedWithTemplateAsyncWithHttpInfo($signature_request_create_embedded_with_template_request, $contentType) ->then( @@ -1684,14 +1621,14 @@ function ($response) { * * Create Embedded Signature Request with Template * - * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedWithTemplateAsyncWithHttpInfo($signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) + public function signatureRequestCreateEmbeddedWithTemplateAsyncWithHttpInfo(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestCreateEmbeddedWithTemplateRequest($signature_request_create_embedded_with_template_request, $contentType); @@ -1701,9 +1638,9 @@ public function signatureRequestCreateEmbeddedWithTemplateAsyncWithHttpInfo($sig ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1712,7 +1649,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -1726,7 +1663,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1735,24 +1672,22 @@ function ($exception) { /** * Create request for operation 'signatureRequestCreateEmbeddedWithTemplate' * - * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedWithTemplateRequest($signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) + public function signatureRequestCreateEmbeddedWithTemplateRequest(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) { - // verify the required parameter 'signature_request_create_embedded_with_template_request' is set if ($signature_request_create_embedded_with_template_request === null || (is_array($signature_request_create_embedded_with_template_request) && count($signature_request_create_embedded_with_template_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_create_embedded_with_template_request when calling signatureRequestCreateEmbeddedWithTemplate' ); } - $resourcePath = '/signature_request/create_embedded_with_template'; $formParams = []; $queryParams = []; @@ -1766,11 +1701,8 @@ public function signatureRequestCreateEmbeddedWithTemplateRequest($signature_req $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1778,7 +1710,7 @@ public function signatureRequestCreateEmbeddedWithTemplateRequest($signature_req // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_create_embedded_with_template_request)); } else { $httpBody = $signature_request_create_embedded_with_template_request; @@ -1791,7 +1723,7 @@ public function signatureRequestCreateEmbeddedWithTemplateRequest($signature_req foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1808,9 +1740,8 @@ public function signatureRequestCreateEmbeddedWithTemplateRequest($signature_req $payloadHook('multipart', $multipartContents, $signature_request_create_embedded_with_template_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1853,14 +1784,14 @@ public function signatureRequestCreateEmbeddedWithTemplateRequest($signature_req * * Edit Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditRequest $signature_request_edit_request signature_request_edit_request (required) + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditRequest $signature_request_edit_request signature_request_edit_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function signatureRequestEdit($signature_request_id, $signature_request_edit_request) + public function signatureRequestEdit(string $signature_request_id, Model\SignatureRequestEditRequest $signature_request_edit_request) { list($response) = $this->signatureRequestEditWithHttpInfo($signature_request_id, $signature_request_edit_request); return $response; @@ -1871,16 +1802,16 @@ public function signatureRequestEdit($signature_request_id, $signature_request_e * * Edit Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEdit. This method will eventually become unavailable */ - public function signatureRequestEditWithHttpInfo($signature_request_id, $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) + public function signatureRequestEditWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditRequest $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) { $request = $this->signatureRequestEditRequest($signature_request_id, $signature_request_edit_request, $contentType); @@ -1892,14 +1823,14 @@ public function signatureRequestEditWithHttpInfo($signature_request_id, $signatu } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1907,7 +1838,6 @@ public function signatureRequestEditWithHttpInfo($signature_request_id, $signatu $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -1917,17 +1847,16 @@ public function signatureRequestEditWithHttpInfo($signature_request_id, $signatu return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1944,9 +1873,8 @@ public function signatureRequestEditWithHttpInfo($signature_request_id, $signatu return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -1954,23 +1882,23 @@ public function signatureRequestEditWithHttpInfo($signature_request_id, $signatu sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1987,11 +1915,9 @@ public function signatureRequestEditWithHttpInfo($signature_request_id, $signatu return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2004,7 +1930,6 @@ public function signatureRequestEditWithHttpInfo($signature_request_id, $signatu ); $e->setResponseObject($data); break; - } throw $e; } @@ -2015,15 +1940,15 @@ public function signatureRequestEditWithHttpInfo($signature_request_id, $signatu * * Edit Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEdit. This method will eventually become unavailable */ - public function signatureRequestEditAsync($signature_request_id, $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) + public function signatureRequestEditAsync(string $signature_request_id, Model\SignatureRequestEditRequest $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) { return $this->signatureRequestEditAsyncWithHttpInfo($signature_request_id, $signature_request_edit_request, $contentType) ->then( @@ -2038,15 +1963,15 @@ function ($response) { * * Edit Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEdit. This method will eventually become unavailable */ - public function signatureRequestEditAsyncWithHttpInfo($signature_request_id, $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) + public function signatureRequestEditAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditRequest $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestEditRequest($signature_request_id, $signature_request_edit_request, $contentType); @@ -2056,9 +1981,9 @@ public function signatureRequestEditAsyncWithHttpInfo($signature_request_id, $si ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2067,7 +1992,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -2081,7 +2006,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2090,32 +2015,30 @@ function ($exception) { /** * Create request for operation 'signatureRequestEdit' * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEdit. This method will eventually become unavailable */ - public function signatureRequestEditRequest($signature_request_id, $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) + public function signatureRequestEditRequest(string $signature_request_id, Model\SignatureRequestEditRequest $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) { - // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestEdit' ); } // verify the required parameter 'signature_request_edit_request' is set if ($signature_request_edit_request === null || (is_array($signature_request_edit_request) && count($signature_request_edit_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_edit_request when calling signatureRequestEdit' ); } - $resourcePath = '/signature_request/edit/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -2129,19 +2052,17 @@ public function signatureRequestEditRequest($signature_request_id, $signature_re $multipart = !empty($formParams); - // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -2149,7 +2070,7 @@ public function signatureRequestEditRequest($signature_request_id, $signature_re // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_edit_request)); } else { $httpBody = $signature_request_edit_request; @@ -2162,7 +2083,7 @@ public function signatureRequestEditRequest($signature_request_id, $signature_re foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -2179,9 +2100,8 @@ public function signatureRequestEditRequest($signature_request_id, $signature_re $payloadHook('multipart', $multipartContents, $signature_request_edit_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2224,14 +2144,14 @@ public function signatureRequestEditRequest($signature_request_id, $signature_re * * Edit Embedded Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request signature_request_edit_embedded_request (required) + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request signature_request_edit_embedded_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function signatureRequestEditEmbedded($signature_request_id, $signature_request_edit_embedded_request) + public function signatureRequestEditEmbedded(string $signature_request_id, Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request) { list($response) = $this->signatureRequestEditEmbeddedWithHttpInfo($signature_request_id, $signature_request_edit_embedded_request); return $response; @@ -2242,16 +2162,16 @@ public function signatureRequestEditEmbedded($signature_request_id, $signature_r * * Edit Embedded Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEditEmbedded. This method will eventually become unavailable */ - public function signatureRequestEditEmbeddedWithHttpInfo($signature_request_id, $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) + public function signatureRequestEditEmbeddedWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) { $request = $this->signatureRequestEditEmbeddedRequest($signature_request_id, $signature_request_edit_embedded_request, $contentType); @@ -2263,14 +2183,14 @@ public function signatureRequestEditEmbeddedWithHttpInfo($signature_request_id, } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -2278,7 +2198,6 @@ public function signatureRequestEditEmbeddedWithHttpInfo($signature_request_id, $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -2288,17 +2207,16 @@ public function signatureRequestEditEmbeddedWithHttpInfo($signature_request_id, return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2315,9 +2233,8 @@ public function signatureRequestEditEmbeddedWithHttpInfo($signature_request_id, return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -2325,23 +2242,23 @@ public function signatureRequestEditEmbeddedWithHttpInfo($signature_request_id, sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2358,11 +2275,9 @@ public function signatureRequestEditEmbeddedWithHttpInfo($signature_request_id, return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2375,7 +2290,6 @@ public function signatureRequestEditEmbeddedWithHttpInfo($signature_request_id, ); $e->setResponseObject($data); break; - } throw $e; } @@ -2386,15 +2300,15 @@ public function signatureRequestEditEmbeddedWithHttpInfo($signature_request_id, * * Edit Embedded Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEditEmbedded. This method will eventually become unavailable */ - public function signatureRequestEditEmbeddedAsync($signature_request_id, $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) + public function signatureRequestEditEmbeddedAsync(string $signature_request_id, Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) { return $this->signatureRequestEditEmbeddedAsyncWithHttpInfo($signature_request_id, $signature_request_edit_embedded_request, $contentType) ->then( @@ -2409,15 +2323,15 @@ function ($response) { * * Edit Embedded Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEditEmbedded. This method will eventually become unavailable */ - public function signatureRequestEditEmbeddedAsyncWithHttpInfo($signature_request_id, $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) + public function signatureRequestEditEmbeddedAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestEditEmbeddedRequest($signature_request_id, $signature_request_edit_embedded_request, $contentType); @@ -2427,9 +2341,9 @@ public function signatureRequestEditEmbeddedAsyncWithHttpInfo($signature_request ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2438,7 +2352,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -2452,7 +2366,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2461,32 +2375,30 @@ function ($exception) { /** * Create request for operation 'signatureRequestEditEmbedded' * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEditEmbedded. This method will eventually become unavailable */ - public function signatureRequestEditEmbeddedRequest($signature_request_id, $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) + public function signatureRequestEditEmbeddedRequest(string $signature_request_id, Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) { - // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestEditEmbedded' ); } // verify the required parameter 'signature_request_edit_embedded_request' is set if ($signature_request_edit_embedded_request === null || (is_array($signature_request_edit_embedded_request) && count($signature_request_edit_embedded_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_edit_embedded_request when calling signatureRequestEditEmbedded' ); } - $resourcePath = '/signature_request/edit_embedded/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -2500,19 +2412,17 @@ public function signatureRequestEditEmbeddedRequest($signature_request_id, $sign $multipart = !empty($formParams); - // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -2520,7 +2430,7 @@ public function signatureRequestEditEmbeddedRequest($signature_request_id, $sign // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_edit_embedded_request)); } else { $httpBody = $signature_request_edit_embedded_request; @@ -2533,7 +2443,7 @@ public function signatureRequestEditEmbeddedRequest($signature_request_id, $sign foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -2550,9 +2460,8 @@ public function signatureRequestEditEmbeddedRequest($signature_request_id, $sign $payloadHook('multipart', $multipartContents, $signature_request_edit_embedded_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2595,14 +2504,14 @@ public function signatureRequestEditEmbeddedRequest($signature_request_id, $sign * * Edit Embedded Signature Request with Template * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request signature_request_edit_embedded_with_template_request (required) + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request signature_request_edit_embedded_with_template_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function signatureRequestEditEmbeddedWithTemplate($signature_request_id, $signature_request_edit_embedded_with_template_request) + public function signatureRequestEditEmbeddedWithTemplate(string $signature_request_id, Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request) { list($response) = $this->signatureRequestEditEmbeddedWithTemplateWithHttpInfo($signature_request_id, $signature_request_edit_embedded_with_template_request); return $response; @@ -2613,16 +2522,16 @@ public function signatureRequestEditEmbeddedWithTemplate($signature_request_id, * * Edit Embedded Signature Request with Template * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEditEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo($signature_request_id, $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) + public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) { $request = $this->signatureRequestEditEmbeddedWithTemplateRequest($signature_request_id, $signature_request_edit_embedded_with_template_request, $contentType); @@ -2634,14 +2543,14 @@ public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo($signature_ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -2649,7 +2558,6 @@ public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo($signature_ $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -2659,17 +2567,16 @@ public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo($signature_ return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2686,9 +2593,8 @@ public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo($signature_ return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -2696,23 +2602,23 @@ public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo($signature_ sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2729,11 +2635,9 @@ public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo($signature_ return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2746,7 +2650,6 @@ public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo($signature_ ); $e->setResponseObject($data); break; - } throw $e; } @@ -2757,15 +2660,15 @@ public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo($signature_ * * Edit Embedded Signature Request with Template * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEditEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestEditEmbeddedWithTemplateAsync($signature_request_id, $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) + public function signatureRequestEditEmbeddedWithTemplateAsync(string $signature_request_id, Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) { return $this->signatureRequestEditEmbeddedWithTemplateAsyncWithHttpInfo($signature_request_id, $signature_request_edit_embedded_with_template_request, $contentType) ->then( @@ -2780,15 +2683,15 @@ function ($response) { * * Edit Embedded Signature Request with Template * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEditEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestEditEmbeddedWithTemplateAsyncWithHttpInfo($signature_request_id, $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) + public function signatureRequestEditEmbeddedWithTemplateAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestEditEmbeddedWithTemplateRequest($signature_request_id, $signature_request_edit_embedded_with_template_request, $contentType); @@ -2798,9 +2701,9 @@ public function signatureRequestEditEmbeddedWithTemplateAsyncWithHttpInfo($signa ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2809,7 +2712,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -2823,7 +2726,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2832,32 +2735,30 @@ function ($exception) { /** * Create request for operation 'signatureRequestEditEmbeddedWithTemplate' * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEditEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestEditEmbeddedWithTemplateRequest($signature_request_id, $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) + public function signatureRequestEditEmbeddedWithTemplateRequest(string $signature_request_id, Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) { - // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestEditEmbeddedWithTemplate' ); } // verify the required parameter 'signature_request_edit_embedded_with_template_request' is set if ($signature_request_edit_embedded_with_template_request === null || (is_array($signature_request_edit_embedded_with_template_request) && count($signature_request_edit_embedded_with_template_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_edit_embedded_with_template_request when calling signatureRequestEditEmbeddedWithTemplate' ); } - $resourcePath = '/signature_request/edit_embedded_with_template/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -2871,19 +2772,17 @@ public function signatureRequestEditEmbeddedWithTemplateRequest($signature_reque $multipart = !empty($formParams); - // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -2891,7 +2790,7 @@ public function signatureRequestEditEmbeddedWithTemplateRequest($signature_reque // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_edit_embedded_with_template_request)); } else { $httpBody = $signature_request_edit_embedded_with_template_request; @@ -2904,7 +2803,7 @@ public function signatureRequestEditEmbeddedWithTemplateRequest($signature_reque foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -2921,9 +2820,8 @@ public function signatureRequestEditEmbeddedWithTemplateRequest($signature_reque $payloadHook('multipart', $multipartContents, $signature_request_edit_embedded_with_template_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2966,14 +2864,14 @@ public function signatureRequestEditEmbeddedWithTemplateRequest($signature_reque * * Edit Signature Request With Template * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request signature_request_edit_with_template_request (required) + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request signature_request_edit_with_template_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function signatureRequestEditWithTemplate($signature_request_id, $signature_request_edit_with_template_request) + public function signatureRequestEditWithTemplate(string $signature_request_id, Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request) { list($response) = $this->signatureRequestEditWithTemplateWithHttpInfo($signature_request_id, $signature_request_edit_with_template_request); return $response; @@ -2984,16 +2882,16 @@ public function signatureRequestEditWithTemplate($signature_request_id, $signatu * * Edit Signature Request With Template * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEditWithTemplate. This method will eventually become unavailable */ - public function signatureRequestEditWithTemplateWithHttpInfo($signature_request_id, $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) + public function signatureRequestEditWithTemplateWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) { $request = $this->signatureRequestEditWithTemplateRequest($signature_request_id, $signature_request_edit_with_template_request, $contentType); @@ -3005,14 +2903,14 @@ public function signatureRequestEditWithTemplateWithHttpInfo($signature_request_ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -3020,7 +2918,6 @@ public function signatureRequestEditWithTemplateWithHttpInfo($signature_request_ $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -3030,17 +2927,16 @@ public function signatureRequestEditWithTemplateWithHttpInfo($signature_request_ return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3057,9 +2953,8 @@ public function signatureRequestEditWithTemplateWithHttpInfo($signature_request_ return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -3067,23 +2962,23 @@ public function signatureRequestEditWithTemplateWithHttpInfo($signature_request_ sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3100,11 +2995,9 @@ public function signatureRequestEditWithTemplateWithHttpInfo($signature_request_ return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -3117,7 +3010,6 @@ public function signatureRequestEditWithTemplateWithHttpInfo($signature_request_ ); $e->setResponseObject($data); break; - } throw $e; } @@ -3128,15 +3020,15 @@ public function signatureRequestEditWithTemplateWithHttpInfo($signature_request_ * * Edit Signature Request With Template * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEditWithTemplate. This method will eventually become unavailable */ - public function signatureRequestEditWithTemplateAsync($signature_request_id, $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) + public function signatureRequestEditWithTemplateAsync(string $signature_request_id, Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) { return $this->signatureRequestEditWithTemplateAsyncWithHttpInfo($signature_request_id, $signature_request_edit_with_template_request, $contentType) ->then( @@ -3151,15 +3043,15 @@ function ($response) { * * Edit Signature Request With Template * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEditWithTemplate. This method will eventually become unavailable */ - public function signatureRequestEditWithTemplateAsyncWithHttpInfo($signature_request_id, $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) + public function signatureRequestEditWithTemplateAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestEditWithTemplateRequest($signature_request_id, $signature_request_edit_with_template_request, $contentType); @@ -3169,9 +3061,9 @@ public function signatureRequestEditWithTemplateAsyncWithHttpInfo($signature_req ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -3180,7 +3072,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -3194,7 +3086,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -3203,32 +3095,30 @@ function ($exception) { /** * Create request for operation 'signatureRequestEditWithTemplate' * - * @param string $signature_request_id The id of the SignatureRequest to edit. (required) - * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestEditWithTemplate. This method will eventually become unavailable */ - public function signatureRequestEditWithTemplateRequest($signature_request_id, $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) + public function signatureRequestEditWithTemplateRequest(string $signature_request_id, Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) { - // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestEditWithTemplate' ); } // verify the required parameter 'signature_request_edit_with_template_request' is set if ($signature_request_edit_with_template_request === null || (is_array($signature_request_edit_with_template_request) && count($signature_request_edit_with_template_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_edit_with_template_request when calling signatureRequestEditWithTemplate' ); } - $resourcePath = '/signature_request/edit_with_template/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -3242,19 +3132,17 @@ public function signatureRequestEditWithTemplateRequest($signature_request_id, $ $multipart = !empty($formParams); - // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -3262,7 +3150,7 @@ public function signatureRequestEditWithTemplateRequest($signature_request_id, $ // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_edit_with_template_request)); } else { $httpBody = $signature_request_edit_with_template_request; @@ -3275,7 +3163,7 @@ public function signatureRequestEditWithTemplateRequest($signature_request_id, $ foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -3292,9 +3180,8 @@ public function signatureRequestEditWithTemplateRequest($signature_request_id, $ $payloadHook('multipart', $multipartContents, $signature_request_edit_with_template_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -3337,14 +3224,14 @@ public function signatureRequestEditWithTemplateRequest($signature_request_id, $ * * Download Files * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') * + * @return SplFileObject * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return \SplFileObject|\Dropbox\Sign\Model\ErrorResponse + * @throws InvalidArgumentException */ - public function signatureRequestFiles($signature_request_id, $file_type = 'pdf') + public function signatureRequestFiles(string $signature_request_id, ?string $file_type = 'pdf') { list($response) = $this->signatureRequestFilesWithHttpInfo($signature_request_id, $file_type); return $response; @@ -3355,16 +3242,16 @@ public function signatureRequestFiles($signature_request_id, $file_type = 'pdf') * * Download Files * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of \SplFileObject|\Dropbox\Sign\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestFiles. This method will eventually become unavailable */ - public function signatureRequestFilesWithHttpInfo($signature_request_id, $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) + public function signatureRequestFilesWithHttpInfo(string $signature_request_id, ?string $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) { $request = $this->signatureRequestFilesRequest($signature_request_id, $file_type, $contentType); @@ -3376,14 +3263,14 @@ public function signatureRequestFilesWithHttpInfo($signature_request_id, $file_t } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -3391,7 +3278,6 @@ public function signatureRequestFilesWithHttpInfo($signature_request_id, $file_t $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -3401,17 +3287,16 @@ public function signatureRequestFilesWithHttpInfo($signature_request_id, $file_t return $result; } - switch ($statusCode) { case 200: if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\SplFileObject' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3428,9 +3313,8 @@ public function signatureRequestFilesWithHttpInfo($signature_request_id, $file_t return [ ObjectSerializer::deserialize($content, '\SplFileObject', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -3438,23 +3322,23 @@ public function signatureRequestFilesWithHttpInfo($signature_request_id, $file_t sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\SplFileObject'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3471,11 +3355,9 @@ public function signatureRequestFilesWithHttpInfo($signature_request_id, $file_t return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -3488,7 +3370,6 @@ public function signatureRequestFilesWithHttpInfo($signature_request_id, $file_t ); $e->setResponseObject($data); break; - } throw $e; } @@ -3499,15 +3380,15 @@ public function signatureRequestFilesWithHttpInfo($signature_request_id, $file_t * * Download Files * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestFiles. This method will eventually become unavailable */ - public function signatureRequestFilesAsync($signature_request_id, $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) + public function signatureRequestFilesAsync(string $signature_request_id, ?string $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) { return $this->signatureRequestFilesAsyncWithHttpInfo($signature_request_id, $file_type, $contentType) ->then( @@ -3522,15 +3403,15 @@ function ($response) { * * Download Files * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestFiles. This method will eventually become unavailable */ - public function signatureRequestFilesAsyncWithHttpInfo($signature_request_id, $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) + public function signatureRequestFilesAsyncWithHttpInfo(string $signature_request_id, ?string $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) { $returnType = '\SplFileObject'; $request = $this->signatureRequestFilesRequest($signature_request_id, $file_type, $contentType); @@ -3540,9 +3421,9 @@ public function signatureRequestFilesAsyncWithHttpInfo($signature_request_id, $f ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -3551,7 +3432,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -3565,7 +3446,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -3574,26 +3455,23 @@ function ($exception) { /** * Create request for operation 'signatureRequestFiles' * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestFiles. This method will eventually become unavailable */ - public function signatureRequestFilesRequest($signature_request_id, $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) + public function signatureRequestFilesRequest(string $signature_request_id, ?string $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) { - // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestFiles' ); } - - $resourcePath = '/signature_request/files/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -3611,19 +3489,17 @@ public function signatureRequestFilesRequest($signature_request_id, $file_type = false // required ) ?? []); - // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/pdf', 'application/zip', 'application/json', ], + $multipart ? ['multipart/form-data'] : ['application/pdf', 'application/zip', 'application/json'], $contentType, $multipart ); @@ -3637,7 +3513,7 @@ public function signatureRequestFilesRequest($signature_request_id, $file_type = foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -3651,9 +3527,8 @@ public function signatureRequestFilesRequest($signature_request_id, $file_type = } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -3696,13 +3571,13 @@ public function signatureRequestFilesRequest($signature_request_id, $file_type = * * Download Files as Data Uri * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\FileResponseDataUri + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function signatureRequestFilesAsDataUri($signature_request_id) + public function signatureRequestFilesAsDataUri(string $signature_request_id) { list($response) = $this->signatureRequestFilesAsDataUriWithHttpInfo($signature_request_id); return $response; @@ -3713,15 +3588,15 @@ public function signatureRequestFilesAsDataUri($signature_request_id) * * Download Files as Data Uri * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\FileResponseDataUri, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestFilesAsDataUri. This method will eventually become unavailable */ - public function signatureRequestFilesAsDataUriWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) + public function signatureRequestFilesAsDataUriWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) { $request = $this->signatureRequestFilesAsDataUriRequest($signature_request_id, $contentType); @@ -3733,14 +3608,14 @@ public function signatureRequestFilesAsDataUriWithHttpInfo($signature_request_id } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -3748,7 +3623,6 @@ public function signatureRequestFilesAsDataUriWithHttpInfo($signature_request_id $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -3758,17 +3632,16 @@ public function signatureRequestFilesAsDataUriWithHttpInfo($signature_request_id return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FileResponseDataUri' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\FileResponseDataUri' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3785,9 +3658,8 @@ public function signatureRequestFilesAsDataUriWithHttpInfo($signature_request_id return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FileResponseDataUri', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -3795,23 +3667,23 @@ public function signatureRequestFilesAsDataUriWithHttpInfo($signature_request_id sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\FileResponseDataUri'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3828,11 +3700,9 @@ public function signatureRequestFilesAsDataUriWithHttpInfo($signature_request_id return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -3845,7 +3715,6 @@ public function signatureRequestFilesAsDataUriWithHttpInfo($signature_request_id ); $e->setResponseObject($data); break; - } throw $e; } @@ -3856,14 +3725,14 @@ public function signatureRequestFilesAsDataUriWithHttpInfo($signature_request_id * * Download Files as Data Uri * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestFilesAsDataUri. This method will eventually become unavailable */ - public function signatureRequestFilesAsDataUriAsync($signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) + public function signatureRequestFilesAsDataUriAsync(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) { return $this->signatureRequestFilesAsDataUriAsyncWithHttpInfo($signature_request_id, $contentType) ->then( @@ -3878,14 +3747,14 @@ function ($response) { * * Download Files as Data Uri * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestFilesAsDataUri. This method will eventually become unavailable */ - public function signatureRequestFilesAsDataUriAsyncWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) + public function signatureRequestFilesAsDataUriAsyncWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) { $returnType = '\Dropbox\Sign\Model\FileResponseDataUri'; $request = $this->signatureRequestFilesAsDataUriRequest($signature_request_id, $contentType); @@ -3895,9 +3764,9 @@ public function signatureRequestFilesAsDataUriAsyncWithHttpInfo($signature_reque ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -3906,7 +3775,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -3920,7 +3789,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -3929,24 +3798,22 @@ function ($exception) { /** * Create request for operation 'signatureRequestFilesAsDataUri' * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestFilesAsDataUri. This method will eventually become unavailable */ - public function signatureRequestFilesAsDataUriRequest($signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) + public function signatureRequestFilesAsDataUriRequest(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) { - // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestFilesAsDataUri' ); } - $resourcePath = '/signature_request/files_as_data_uri/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -3954,20 +3821,17 @@ public function signatureRequestFilesAsDataUriRequest($signature_request_id, str $httpBody = ''; $multipart = false; - - // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -3981,7 +3845,7 @@ public function signatureRequestFilesAsDataUriRequest($signature_request_id, str foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -3995,9 +3859,8 @@ public function signatureRequestFilesAsDataUriRequest($signature_request_id, str } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -4040,14 +3903,14 @@ public function signatureRequestFilesAsDataUriRequest($signature_request_id, str * * Download Files as File Url * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\FileResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function signatureRequestFilesAsFileUrl($signature_request_id, $force_download = 1) + public function signatureRequestFilesAsFileUrl(string $signature_request_id, ?int $force_download = 1) { list($response) = $this->signatureRequestFilesAsFileUrlWithHttpInfo($signature_request_id, $force_download); return $response; @@ -4058,16 +3921,16 @@ public function signatureRequestFilesAsFileUrl($signature_request_id, $force_dow * * Download Files as File Url * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\FileResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestFilesAsFileUrl. This method will eventually become unavailable */ - public function signatureRequestFilesAsFileUrlWithHttpInfo($signature_request_id, $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) + public function signatureRequestFilesAsFileUrlWithHttpInfo(string $signature_request_id, ?int $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) { $request = $this->signatureRequestFilesAsFileUrlRequest($signature_request_id, $force_download, $contentType); @@ -4079,14 +3942,14 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo($signature_request_id } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -4094,7 +3957,6 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo($signature_request_id $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -4104,17 +3966,16 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo($signature_request_id return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FileResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\FileResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -4131,9 +3992,8 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo($signature_request_id return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FileResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -4141,23 +4001,23 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo($signature_request_id sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\FileResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -4174,11 +4034,9 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo($signature_request_id return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -4191,7 +4049,6 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo($signature_request_id ); $e->setResponseObject($data); break; - } throw $e; } @@ -4202,15 +4059,15 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo($signature_request_id * * Download Files as File Url * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestFilesAsFileUrl. This method will eventually become unavailable */ - public function signatureRequestFilesAsFileUrlAsync($signature_request_id, $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) + public function signatureRequestFilesAsFileUrlAsync(string $signature_request_id, ?int $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) { return $this->signatureRequestFilesAsFileUrlAsyncWithHttpInfo($signature_request_id, $force_download, $contentType) ->then( @@ -4225,15 +4082,15 @@ function ($response) { * * Download Files as File Url * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestFilesAsFileUrl. This method will eventually become unavailable */ - public function signatureRequestFilesAsFileUrlAsyncWithHttpInfo($signature_request_id, $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) + public function signatureRequestFilesAsFileUrlAsyncWithHttpInfo(string $signature_request_id, ?int $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) { $returnType = '\Dropbox\Sign\Model\FileResponse'; $request = $this->signatureRequestFilesAsFileUrlRequest($signature_request_id, $force_download, $contentType); @@ -4243,9 +4100,9 @@ public function signatureRequestFilesAsFileUrlAsyncWithHttpInfo($signature_reque ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -4254,7 +4111,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -4268,7 +4125,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -4277,26 +4134,23 @@ function ($exception) { /** * Create request for operation 'signatureRequestFilesAsFileUrl' * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestFilesAsFileUrl. This method will eventually become unavailable */ - public function signatureRequestFilesAsFileUrlRequest($signature_request_id, $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) + public function signatureRequestFilesAsFileUrlRequest(string $signature_request_id, ?int $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) { - // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestFilesAsFileUrl' ); } - - $resourcePath = '/signature_request/files_as_file_url/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -4314,19 +4168,17 @@ public function signatureRequestFilesAsFileUrlRequest($signature_request_id, $fo false // required ) ?? []); - // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -4340,7 +4192,7 @@ public function signatureRequestFilesAsFileUrlRequest($signature_request_id, $fo foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -4354,9 +4206,8 @@ public function signatureRequestFilesAsFileUrlRequest($signature_request_id, $fo } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -4399,13 +4250,13 @@ public function signatureRequestFilesAsFileUrlRequest($signature_request_id, $fo * * Get Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function signatureRequestGet($signature_request_id) + public function signatureRequestGet(string $signature_request_id) { list($response) = $this->signatureRequestGetWithHttpInfo($signature_request_id); return $response; @@ -4416,15 +4267,15 @@ public function signatureRequestGet($signature_request_id) * * Get Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestGet. This method will eventually become unavailable */ - public function signatureRequestGetWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) + public function signatureRequestGetWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) { $request = $this->signatureRequestGetRequest($signature_request_id, $contentType); @@ -4436,14 +4287,14 @@ public function signatureRequestGetWithHttpInfo($signature_request_id, string $c } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -4451,7 +4302,6 @@ public function signatureRequestGetWithHttpInfo($signature_request_id, string $c $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -4461,17 +4311,16 @@ public function signatureRequestGetWithHttpInfo($signature_request_id, string $c return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -4488,9 +4337,8 @@ public function signatureRequestGetWithHttpInfo($signature_request_id, string $c return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -4498,23 +4346,23 @@ public function signatureRequestGetWithHttpInfo($signature_request_id, string $c sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -4531,11 +4379,9 @@ public function signatureRequestGetWithHttpInfo($signature_request_id, string $c return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -4548,7 +4394,6 @@ public function signatureRequestGetWithHttpInfo($signature_request_id, string $c ); $e->setResponseObject($data); break; - } throw $e; } @@ -4559,14 +4404,14 @@ public function signatureRequestGetWithHttpInfo($signature_request_id, string $c * * Get Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestGet. This method will eventually become unavailable */ - public function signatureRequestGetAsync($signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) + public function signatureRequestGetAsync(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) { return $this->signatureRequestGetAsyncWithHttpInfo($signature_request_id, $contentType) ->then( @@ -4581,14 +4426,14 @@ function ($response) { * * Get Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestGet. This method will eventually become unavailable */ - public function signatureRequestGetAsyncWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) + public function signatureRequestGetAsyncWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestGetRequest($signature_request_id, $contentType); @@ -4598,9 +4443,9 @@ public function signatureRequestGetAsyncWithHttpInfo($signature_request_id, stri ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -4609,7 +4454,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -4623,7 +4468,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -4632,24 +4477,22 @@ function ($exception) { /** * Create request for operation 'signatureRequestGet' * - * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestGet. This method will eventually become unavailable */ - public function signatureRequestGetRequest($signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) + public function signatureRequestGetRequest(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) { - // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestGet' ); } - $resourcePath = '/signature_request/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -4657,20 +4500,17 @@ public function signatureRequestGetRequest($signature_request_id, string $conten $httpBody = ''; $multipart = false; - - // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -4684,7 +4524,7 @@ public function signatureRequestGetRequest($signature_request_id, string $conten foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -4698,9 +4538,8 @@ public function signatureRequestGetRequest($signature_request_id, string $conten } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -4743,16 +4582,16 @@ public function signatureRequestGetRequest($signature_request_id, string $conten * * List Signature Requests * - * @param string|null $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int|null $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string|null $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param string|null $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\SignatureRequestListResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function signatureRequestList($account_id = null, $page = 1, $page_size = 20, $query = null) + public function signatureRequestList(?string $account_id = null, ?int $page = 1, ?int $page_size = 20, ?string $query = null) { list($response) = $this->signatureRequestListWithHttpInfo($account_id, $page, $page_size, $query); return $response; @@ -4763,18 +4602,18 @@ public function signatureRequestList($account_id = null, $page = 1, $page_size = * * List Signature Requests * - * @param string|null $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int|null $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string|null $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation + * @param string|null $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\SignatureRequestListResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestList. This method will eventually become unavailable */ - public function signatureRequestListWithHttpInfo($account_id = null, $page = 1, $page_size = 20, $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) + public function signatureRequestListWithHttpInfo(?string $account_id = null, ?int $page = 1, ?int $page_size = 20, ?string $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) { $request = $this->signatureRequestListRequest($account_id, $page, $page_size, $query, $contentType); @@ -4786,14 +4625,14 @@ public function signatureRequestListWithHttpInfo($account_id = null, $page = 1, } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -4801,7 +4640,6 @@ public function signatureRequestListWithHttpInfo($account_id = null, $page = 1, $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -4811,17 +4649,16 @@ public function signatureRequestListWithHttpInfo($account_id = null, $page = 1, return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestListResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestListResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -4838,9 +4675,8 @@ public function signatureRequestListWithHttpInfo($account_id = null, $page = 1, return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestListResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -4848,23 +4684,23 @@ public function signatureRequestListWithHttpInfo($account_id = null, $page = 1, sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestListResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -4881,11 +4717,9 @@ public function signatureRequestListWithHttpInfo($account_id = null, $page = 1, return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -4898,7 +4732,6 @@ public function signatureRequestListWithHttpInfo($account_id = null, $page = 1, ); $e->setResponseObject($data); break; - } throw $e; } @@ -4909,17 +4742,17 @@ public function signatureRequestListWithHttpInfo($account_id = null, $page = 1, * * List Signature Requests * - * @param string|null $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int|null $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string|null $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation + * @param string|null $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestList. This method will eventually become unavailable */ - public function signatureRequestListAsync($account_id = null, $page = 1, $page_size = 20, $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) + public function signatureRequestListAsync(?string $account_id = null, ?int $page = 1, ?int $page_size = 20, ?string $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) { return $this->signatureRequestListAsyncWithHttpInfo($account_id, $page, $page_size, $query, $contentType) ->then( @@ -4934,17 +4767,17 @@ function ($response) { * * List Signature Requests * - * @param string|null $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int|null $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string|null $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation + * @param string|null $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestList. This method will eventually become unavailable */ - public function signatureRequestListAsyncWithHttpInfo($account_id = null, $page = 1, $page_size = 20, $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) + public function signatureRequestListAsyncWithHttpInfo(?string $account_id = null, ?int $page = 1, ?int $page_size = 20, ?string $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestListResponse'; $request = $this->signatureRequestListRequest($account_id, $page, $page_size, $query, $contentType); @@ -4954,9 +4787,9 @@ public function signatureRequestListAsyncWithHttpInfo($account_id = null, $page ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -4965,7 +4798,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -4979,7 +4812,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -4988,24 +4821,18 @@ function ($exception) { /** * Create request for operation 'signatureRequestList' * - * @param string|null $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int|null $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string|null $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation + * @param string|null $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestList. This method will eventually become unavailable */ - public function signatureRequestListRequest($account_id = null, $page = 1, $page_size = 20, $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) + public function signatureRequestListRequest(?string $account_id = null, ?int $page = 1, ?int $page_size = 20, ?string $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) { - - - - - - $resourcePath = '/signature_request/list'; $formParams = []; $queryParams = []; @@ -5050,11 +4877,8 @@ public function signatureRequestListRequest($account_id = null, $page = 1, $page false // required ) ?? []); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -5068,7 +4892,7 @@ public function signatureRequestListRequest($account_id = null, $page = 1, $page foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -5082,9 +4906,8 @@ public function signatureRequestListRequest($account_id = null, $page = 1, $page } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -5127,13 +4950,13 @@ public function signatureRequestListRequest($account_id = null, $page = 1, $page * * Release On-Hold Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to release. (required) + * @param string $signature_request_id The id of the SignatureRequest to release. (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function signatureRequestReleaseHold($signature_request_id) + public function signatureRequestReleaseHold(string $signature_request_id) { list($response) = $this->signatureRequestReleaseHoldWithHttpInfo($signature_request_id); return $response; @@ -5144,15 +4967,15 @@ public function signatureRequestReleaseHold($signature_request_id) * * Release On-Hold Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to release. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to release. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestReleaseHold. This method will eventually become unavailable */ - public function signatureRequestReleaseHoldWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) + public function signatureRequestReleaseHoldWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) { $request = $this->signatureRequestReleaseHoldRequest($signature_request_id, $contentType); @@ -5164,14 +4987,14 @@ public function signatureRequestReleaseHoldWithHttpInfo($signature_request_id, s } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -5179,7 +5002,6 @@ public function signatureRequestReleaseHoldWithHttpInfo($signature_request_id, s $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -5189,17 +5011,16 @@ public function signatureRequestReleaseHoldWithHttpInfo($signature_request_id, s return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -5216,9 +5037,8 @@ public function signatureRequestReleaseHoldWithHttpInfo($signature_request_id, s return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -5226,23 +5046,23 @@ public function signatureRequestReleaseHoldWithHttpInfo($signature_request_id, s sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -5259,11 +5079,9 @@ public function signatureRequestReleaseHoldWithHttpInfo($signature_request_id, s return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -5276,7 +5094,6 @@ public function signatureRequestReleaseHoldWithHttpInfo($signature_request_id, s ); $e->setResponseObject($data); break; - } throw $e; } @@ -5287,14 +5104,14 @@ public function signatureRequestReleaseHoldWithHttpInfo($signature_request_id, s * * Release On-Hold Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to release. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to release. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestReleaseHold. This method will eventually become unavailable */ - public function signatureRequestReleaseHoldAsync($signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) + public function signatureRequestReleaseHoldAsync(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) { return $this->signatureRequestReleaseHoldAsyncWithHttpInfo($signature_request_id, $contentType) ->then( @@ -5309,14 +5126,14 @@ function ($response) { * * Release On-Hold Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to release. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to release. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestReleaseHold. This method will eventually become unavailable */ - public function signatureRequestReleaseHoldAsyncWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) + public function signatureRequestReleaseHoldAsyncWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestReleaseHoldRequest($signature_request_id, $contentType); @@ -5326,9 +5143,9 @@ public function signatureRequestReleaseHoldAsyncWithHttpInfo($signature_request_ ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -5337,7 +5154,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -5351,7 +5168,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -5360,24 +5177,22 @@ function ($exception) { /** * Create request for operation 'signatureRequestReleaseHold' * - * @param string $signature_request_id The id of the SignatureRequest to release. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to release. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestReleaseHold. This method will eventually become unavailable */ - public function signatureRequestReleaseHoldRequest($signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) + public function signatureRequestReleaseHoldRequest(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) { - // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestReleaseHold' ); } - $resourcePath = '/signature_request/release_hold/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -5385,20 +5200,17 @@ public function signatureRequestReleaseHoldRequest($signature_request_id, string $httpBody = ''; $multipart = false; - - // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -5412,7 +5224,7 @@ public function signatureRequestReleaseHoldRequest($signature_request_id, string foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -5426,9 +5238,8 @@ public function signatureRequestReleaseHoldRequest($signature_request_id, string } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -5471,14 +5282,14 @@ public function signatureRequestReleaseHoldRequest($signature_request_id, string * * Send Request Reminder * - * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) - * @param Model\SignatureRequestRemindRequest $signature_request_remind_request signature_request_remind_request (required) + * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) + * @param Model\SignatureRequestRemindRequest $signature_request_remind_request signature_request_remind_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function signatureRequestRemind($signature_request_id, $signature_request_remind_request) + public function signatureRequestRemind(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request) { list($response) = $this->signatureRequestRemindWithHttpInfo($signature_request_id, $signature_request_remind_request); return $response; @@ -5489,16 +5300,16 @@ public function signatureRequestRemind($signature_request_id, $signature_request * * Send Request Reminder * - * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) - * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) + * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestRemind. This method will eventually become unavailable */ - public function signatureRequestRemindWithHttpInfo($signature_request_id, $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) + public function signatureRequestRemindWithHttpInfo(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) { $request = $this->signatureRequestRemindRequest($signature_request_id, $signature_request_remind_request, $contentType); @@ -5510,14 +5321,14 @@ public function signatureRequestRemindWithHttpInfo($signature_request_id, $signa } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -5525,7 +5336,6 @@ public function signatureRequestRemindWithHttpInfo($signature_request_id, $signa $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -5535,17 +5345,16 @@ public function signatureRequestRemindWithHttpInfo($signature_request_id, $signa return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -5562,9 +5371,8 @@ public function signatureRequestRemindWithHttpInfo($signature_request_id, $signa return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -5572,23 +5380,23 @@ public function signatureRequestRemindWithHttpInfo($signature_request_id, $signa sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -5605,11 +5413,9 @@ public function signatureRequestRemindWithHttpInfo($signature_request_id, $signa return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -5622,7 +5428,6 @@ public function signatureRequestRemindWithHttpInfo($signature_request_id, $signa ); $e->setResponseObject($data); break; - } throw $e; } @@ -5633,15 +5438,15 @@ public function signatureRequestRemindWithHttpInfo($signature_request_id, $signa * * Send Request Reminder * - * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) - * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) + * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestRemind. This method will eventually become unavailable */ - public function signatureRequestRemindAsync($signature_request_id, $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) + public function signatureRequestRemindAsync(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) { return $this->signatureRequestRemindAsyncWithHttpInfo($signature_request_id, $signature_request_remind_request, $contentType) ->then( @@ -5656,15 +5461,15 @@ function ($response) { * * Send Request Reminder * - * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) - * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) + * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestRemind. This method will eventually become unavailable */ - public function signatureRequestRemindAsyncWithHttpInfo($signature_request_id, $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) + public function signatureRequestRemindAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestRemindRequest($signature_request_id, $signature_request_remind_request, $contentType); @@ -5674,9 +5479,9 @@ public function signatureRequestRemindAsyncWithHttpInfo($signature_request_id, $ ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -5685,7 +5490,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -5699,7 +5504,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -5708,32 +5513,30 @@ function ($exception) { /** * Create request for operation 'signatureRequestRemind' * - * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) - * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) + * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestRemind. This method will eventually become unavailable */ - public function signatureRequestRemindRequest($signature_request_id, $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) + public function signatureRequestRemindRequest(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) { - // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestRemind' ); } // verify the required parameter 'signature_request_remind_request' is set if ($signature_request_remind_request === null || (is_array($signature_request_remind_request) && count($signature_request_remind_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_remind_request when calling signatureRequestRemind' ); } - $resourcePath = '/signature_request/remind/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -5747,19 +5550,17 @@ public function signatureRequestRemindRequest($signature_request_id, $signature_ $multipart = !empty($formParams); - // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -5767,7 +5568,7 @@ public function signatureRequestRemindRequest($signature_request_id, $signature_ // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_remind_request)); } else { $httpBody = $signature_request_remind_request; @@ -5780,7 +5581,7 @@ public function signatureRequestRemindRequest($signature_request_id, $signature_ foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -5797,9 +5598,8 @@ public function signatureRequestRemindRequest($signature_request_id, $signature_ $payloadHook('multipart', $multipartContents, $signature_request_remind_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -5842,13 +5642,12 @@ public function signatureRequestRemindRequest($signature_request_id, $signature_ * * Remove Signature Request Access * - * @param string $signature_request_id The id of the SignatureRequest to remove. (required) + * @param string $signature_request_id The id of the SignatureRequest to remove. (required) * * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return void + * @throws InvalidArgumentException */ - public function signatureRequestRemove($signature_request_id) + public function signatureRequestRemove(string $signature_request_id) { $this->signatureRequestRemoveWithHttpInfo($signature_request_id); } @@ -5858,15 +5657,15 @@ public function signatureRequestRemove($signature_request_id) * * Remove Signature Request Access * - * @param string $signature_request_id The id of the SignatureRequest to remove. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to remove. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation * - * @throws 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) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestRemove. This method will eventually become unavailable */ - public function signatureRequestRemoveWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) + public function signatureRequestRemoveWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) { $request = $this->signatureRequestRemoveRequest($signature_request_id, $contentType); @@ -5878,14 +5677,14 @@ public function signatureRequestRemoveWithHttpInfo($signature_request_id, string } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -5893,16 +5692,12 @@ public function signatureRequestRemoveWithHttpInfo($signature_request_id, string $statusCode = $response->getStatusCode(); - return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } switch ($e->getCode()) { - } throw $e; } @@ -5913,14 +5708,14 @@ public function signatureRequestRemoveWithHttpInfo($signature_request_id, string * * Remove Signature Request Access * - * @param string $signature_request_id The id of the SignatureRequest to remove. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to remove. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestRemove. This method will eventually become unavailable */ - public function signatureRequestRemoveAsync($signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) + public function signatureRequestRemoveAsync(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) { return $this->signatureRequestRemoveAsyncWithHttpInfo($signature_request_id, $contentType) ->then( @@ -5935,14 +5730,14 @@ function ($response) { * * Remove Signature Request Access * - * @param string $signature_request_id The id of the SignatureRequest to remove. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to remove. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestRemove. This method will eventually become unavailable */ - public function signatureRequestRemoveAsyncWithHttpInfo($signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) + public function signatureRequestRemoveAsyncWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) { $returnType = ''; $request = $this->signatureRequestRemoveRequest($signature_request_id, $contentType); @@ -5950,7 +5745,7 @@ public function signatureRequestRemoveAsyncWithHttpInfo($signature_request_id, s return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( - function ($response) use ($returnType) { + function ($response) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { @@ -5964,7 +5759,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -5973,24 +5768,22 @@ function ($exception) { /** * Create request for operation 'signatureRequestRemove' * - * @param string $signature_request_id The id of the SignatureRequest to remove. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to remove. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestRemove. This method will eventually become unavailable */ - public function signatureRequestRemoveRequest($signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) + public function signatureRequestRemoveRequest(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) { - // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestRemove' ); } - $resourcePath = '/signature_request/remove/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -5998,20 +5791,17 @@ public function signatureRequestRemoveRequest($signature_request_id, string $con $httpBody = ''; $multipart = false; - - // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -6025,7 +5815,7 @@ public function signatureRequestRemoveRequest($signature_request_id, string $con foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -6039,9 +5829,8 @@ public function signatureRequestRemoveRequest($signature_request_id, string $con } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -6080,13 +5869,13 @@ public function signatureRequestRemoveRequest($signature_request_id, string $con * * Send Signature Request * - * @param Model\SignatureRequestSendRequest $signature_request_send_request signature_request_send_request (required) + * @param Model\SignatureRequestSendRequest $signature_request_send_request signature_request_send_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function signatureRequestSend($signature_request_send_request) + public function signatureRequestSend(Model\SignatureRequestSendRequest $signature_request_send_request) { list($response) = $this->signatureRequestSendWithHttpInfo($signature_request_send_request); return $response; @@ -6097,15 +5886,15 @@ public function signatureRequestSend($signature_request_send_request) * * Send Signature Request * - * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation + * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestSend. This method will eventually become unavailable */ - public function signatureRequestSendWithHttpInfo($signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) + public function signatureRequestSendWithHttpInfo(Model\SignatureRequestSendRequest $signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) { $request = $this->signatureRequestSendRequest($signature_request_send_request, $contentType); @@ -6117,14 +5906,14 @@ public function signatureRequestSendWithHttpInfo($signature_request_send_request } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -6132,7 +5921,6 @@ public function signatureRequestSendWithHttpInfo($signature_request_send_request $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -6142,17 +5930,16 @@ public function signatureRequestSendWithHttpInfo($signature_request_send_request return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -6169,9 +5956,8 @@ public function signatureRequestSendWithHttpInfo($signature_request_send_request return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -6179,23 +5965,23 @@ public function signatureRequestSendWithHttpInfo($signature_request_send_request sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -6212,11 +5998,9 @@ public function signatureRequestSendWithHttpInfo($signature_request_send_request return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -6229,7 +6013,6 @@ public function signatureRequestSendWithHttpInfo($signature_request_send_request ); $e->setResponseObject($data); break; - } throw $e; } @@ -6240,14 +6023,14 @@ public function signatureRequestSendWithHttpInfo($signature_request_send_request * * Send Signature Request * - * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation + * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestSend. This method will eventually become unavailable */ - public function signatureRequestSendAsync($signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) + public function signatureRequestSendAsync(Model\SignatureRequestSendRequest $signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) { return $this->signatureRequestSendAsyncWithHttpInfo($signature_request_send_request, $contentType) ->then( @@ -6262,14 +6045,14 @@ function ($response) { * * Send Signature Request * - * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation + * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestSend. This method will eventually become unavailable */ - public function signatureRequestSendAsyncWithHttpInfo($signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) + public function signatureRequestSendAsyncWithHttpInfo(Model\SignatureRequestSendRequest $signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestSendRequest($signature_request_send_request, $contentType); @@ -6279,9 +6062,9 @@ public function signatureRequestSendAsyncWithHttpInfo($signature_request_send_re ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -6290,7 +6073,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -6304,7 +6087,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -6313,24 +6096,22 @@ function ($exception) { /** * Create request for operation 'signatureRequestSend' * - * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation + * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestSend. This method will eventually become unavailable */ - public function signatureRequestSendRequest($signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) + public function signatureRequestSendRequest(Model\SignatureRequestSendRequest $signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) { - // verify the required parameter 'signature_request_send_request' is set if ($signature_request_send_request === null || (is_array($signature_request_send_request) && count($signature_request_send_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_send_request when calling signatureRequestSend' ); } - $resourcePath = '/signature_request/send'; $formParams = []; $queryParams = []; @@ -6344,11 +6125,8 @@ public function signatureRequestSendRequest($signature_request_send_request, str $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -6356,7 +6134,7 @@ public function signatureRequestSendRequest($signature_request_send_request, str // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_send_request)); } else { $httpBody = $signature_request_send_request; @@ -6369,7 +6147,7 @@ public function signatureRequestSendRequest($signature_request_send_request, str foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -6386,9 +6164,8 @@ public function signatureRequestSendRequest($signature_request_send_request, str $payloadHook('multipart', $multipartContents, $signature_request_send_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -6431,13 +6208,13 @@ public function signatureRequestSendRequest($signature_request_send_request, str * * Send with Template * - * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request signature_request_send_with_template_request (required) + * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request signature_request_send_with_template_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function signatureRequestSendWithTemplate($signature_request_send_with_template_request) + public function signatureRequestSendWithTemplate(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request) { list($response) = $this->signatureRequestSendWithTemplateWithHttpInfo($signature_request_send_with_template_request); return $response; @@ -6448,15 +6225,15 @@ public function signatureRequestSendWithTemplate($signature_request_send_with_te * * Send with Template * - * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestSendWithTemplateWithHttpInfo($signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) + public function signatureRequestSendWithTemplateWithHttpInfo(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) { $request = $this->signatureRequestSendWithTemplateRequest($signature_request_send_with_template_request, $contentType); @@ -6468,14 +6245,14 @@ public function signatureRequestSendWithTemplateWithHttpInfo($signature_request_ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -6483,7 +6260,6 @@ public function signatureRequestSendWithTemplateWithHttpInfo($signature_request_ $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -6493,17 +6269,16 @@ public function signatureRequestSendWithTemplateWithHttpInfo($signature_request_ return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -6520,9 +6295,8 @@ public function signatureRequestSendWithTemplateWithHttpInfo($signature_request_ return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -6530,23 +6304,23 @@ public function signatureRequestSendWithTemplateWithHttpInfo($signature_request_ sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -6563,11 +6337,9 @@ public function signatureRequestSendWithTemplateWithHttpInfo($signature_request_ return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -6580,7 +6352,6 @@ public function signatureRequestSendWithTemplateWithHttpInfo($signature_request_ ); $e->setResponseObject($data); break; - } throw $e; } @@ -6591,14 +6362,14 @@ public function signatureRequestSendWithTemplateWithHttpInfo($signature_request_ * * Send with Template * - * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestSendWithTemplateAsync($signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) + public function signatureRequestSendWithTemplateAsync(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) { return $this->signatureRequestSendWithTemplateAsyncWithHttpInfo($signature_request_send_with_template_request, $contentType) ->then( @@ -6613,14 +6384,14 @@ function ($response) { * * Send with Template * - * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestSendWithTemplateAsyncWithHttpInfo($signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) + public function signatureRequestSendWithTemplateAsyncWithHttpInfo(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestSendWithTemplateRequest($signature_request_send_with_template_request, $contentType); @@ -6630,9 +6401,9 @@ public function signatureRequestSendWithTemplateAsyncWithHttpInfo($signature_req ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -6641,7 +6412,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -6655,7 +6426,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -6664,24 +6435,22 @@ function ($exception) { /** * Create request for operation 'signatureRequestSendWithTemplate' * - * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation + * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestSendWithTemplateRequest($signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) + public function signatureRequestSendWithTemplateRequest(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) { - // verify the required parameter 'signature_request_send_with_template_request' is set if ($signature_request_send_with_template_request === null || (is_array($signature_request_send_with_template_request) && count($signature_request_send_with_template_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_send_with_template_request when calling signatureRequestSendWithTemplate' ); } - $resourcePath = '/signature_request/send_with_template'; $formParams = []; $queryParams = []; @@ -6695,11 +6464,8 @@ public function signatureRequestSendWithTemplateRequest($signature_request_send_ $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -6707,7 +6473,7 @@ public function signatureRequestSendWithTemplateRequest($signature_request_send_ // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_send_with_template_request)); } else { $httpBody = $signature_request_send_with_template_request; @@ -6720,7 +6486,7 @@ public function signatureRequestSendWithTemplateRequest($signature_request_send_ foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -6737,9 +6503,8 @@ public function signatureRequestSendWithTemplateRequest($signature_request_send_ $payloadHook('multipart', $multipartContents, $signature_request_send_with_template_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -6782,14 +6547,14 @@ public function signatureRequestSendWithTemplateRequest($signature_request_send_ * * Update Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to update. (required) - * @param Model\SignatureRequestUpdateRequest $signature_request_update_request signature_request_update_request (required) + * @param string $signature_request_id The id of the SignatureRequest to update. (required) + * @param Model\SignatureRequestUpdateRequest $signature_request_update_request signature_request_update_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function signatureRequestUpdate($signature_request_id, $signature_request_update_request) + public function signatureRequestUpdate(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request) { list($response) = $this->signatureRequestUpdateWithHttpInfo($signature_request_id, $signature_request_update_request); return $response; @@ -6800,16 +6565,16 @@ public function signatureRequestUpdate($signature_request_id, $signature_request * * Update Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to update. (required) - * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to update. (required) + * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestUpdate. This method will eventually become unavailable */ - public function signatureRequestUpdateWithHttpInfo($signature_request_id, $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) + public function signatureRequestUpdateWithHttpInfo(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) { $request = $this->signatureRequestUpdateRequest($signature_request_id, $signature_request_update_request, $contentType); @@ -6821,14 +6586,14 @@ public function signatureRequestUpdateWithHttpInfo($signature_request_id, $signa } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -6836,7 +6601,6 @@ public function signatureRequestUpdateWithHttpInfo($signature_request_id, $signa $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -6846,17 +6610,16 @@ public function signatureRequestUpdateWithHttpInfo($signature_request_id, $signa return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -6873,9 +6636,8 @@ public function signatureRequestUpdateWithHttpInfo($signature_request_id, $signa return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -6883,23 +6645,23 @@ public function signatureRequestUpdateWithHttpInfo($signature_request_id, $signa sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -6916,11 +6678,9 @@ public function signatureRequestUpdateWithHttpInfo($signature_request_id, $signa return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -6933,7 +6693,6 @@ public function signatureRequestUpdateWithHttpInfo($signature_request_id, $signa ); $e->setResponseObject($data); break; - } throw $e; } @@ -6944,15 +6703,15 @@ public function signatureRequestUpdateWithHttpInfo($signature_request_id, $signa * * Update Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to update. (required) - * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to update. (required) + * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestUpdate. This method will eventually become unavailable */ - public function signatureRequestUpdateAsync($signature_request_id, $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) + public function signatureRequestUpdateAsync(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) { return $this->signatureRequestUpdateAsyncWithHttpInfo($signature_request_id, $signature_request_update_request, $contentType) ->then( @@ -6967,15 +6726,15 @@ function ($response) { * * Update Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to update. (required) - * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to update. (required) + * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestUpdate. This method will eventually become unavailable */ - public function signatureRequestUpdateAsyncWithHttpInfo($signature_request_id, $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) + public function signatureRequestUpdateAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; $request = $this->signatureRequestUpdateRequest($signature_request_id, $signature_request_update_request, $contentType); @@ -6985,9 +6744,9 @@ public function signatureRequestUpdateAsyncWithHttpInfo($signature_request_id, $ ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -6996,7 +6755,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -7010,7 +6769,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -7019,32 +6778,30 @@ function ($exception) { /** * Create request for operation 'signatureRequestUpdate' * - * @param string $signature_request_id The id of the SignatureRequest to update. (required) - * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation + * @param string $signature_request_id The id of the SignatureRequest to update. (required) + * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::signatureRequestUpdate. This method will eventually become unavailable */ - public function signatureRequestUpdateRequest($signature_request_id, $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) + public function signatureRequestUpdateRequest(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) { - // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling signatureRequestUpdate' ); } // verify the required parameter 'signature_request_update_request' is set if ($signature_request_update_request === null || (is_array($signature_request_update_request) && count($signature_request_update_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_update_request when calling signatureRequestUpdate' ); } - $resourcePath = '/signature_request/update/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -7058,19 +6815,17 @@ public function signatureRequestUpdateRequest($signature_request_id, $signature_ $multipart = !empty($formParams); - // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -7078,7 +6833,7 @@ public function signatureRequestUpdateRequest($signature_request_id, $signature_ // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_update_request)); } else { $httpBody = $signature_request_update_request; @@ -7091,7 +6846,7 @@ public function signatureRequestUpdateRequest($signature_request_id, $signature_ foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -7108,9 +6863,8 @@ public function signatureRequestUpdateRequest($signature_request_id, $signature_ $payloadHook('multipart', $multipartContents, $signature_request_update_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -7151,8 +6905,8 @@ public function signatureRequestUpdateRequest($signature_request_id, $signature_ /** * Create http client option * - * @throws \RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -7160,7 +6914,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -7176,8 +6930,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -7187,9 +6941,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); } return [ @@ -7208,8 +6962,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/TeamApi.php b/sdks/php/src/Api/TeamApi.php index 82f9d07d8..8b61a5d4b 100644 --- a/sdks/php/src/Api/TeamApi.php +++ b/sdks/php/src/Api/TeamApi.php @@ -1,13 +1,10 @@ [ 'application/json', @@ -111,10 +103,7 @@ class TeamApi protected $response; /** - * @param Configuration $config - * @param ClientInterface $client - * @param HeaderSelector $selector - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( ?Configuration $config = null, @@ -134,7 +123,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex($hostIndex): void + public function setHostIndex(int $hostIndex): void { $this->hostIndex = $hostIndex; } @@ -171,14 +160,14 @@ public function getResponse() * * Add User to Team * - * @param Model\TeamAddMemberRequest $team_add_member_request team_add_member_request (required) - * @param string|null $team_id The id of the team. (optional) + * @param Model\TeamAddMemberRequest $team_add_member_request team_add_member_request (required) + * @param string|null $team_id The id of the team. (optional) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\TeamGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function teamAddMember($team_add_member_request, $team_id = null) + public function teamAddMember(Model\TeamAddMemberRequest $team_add_member_request, ?string $team_id = null) { list($response) = $this->teamAddMemberWithHttpInfo($team_add_member_request, $team_id); return $response; @@ -189,16 +178,16 @@ public function teamAddMember($team_add_member_request, $team_id = null) * * Add User to Team * - * @param Model\TeamAddMemberRequest $team_add_member_request (required) - * @param string|null $team_id The id of the team. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation + * @param Model\TeamAddMemberRequest $team_add_member_request (required) + * @param string|null $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\TeamGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamAddMember. This method will eventually become unavailable */ - public function teamAddMemberWithHttpInfo($team_add_member_request, $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) + public function teamAddMemberWithHttpInfo(Model\TeamAddMemberRequest $team_add_member_request, ?string $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) { $request = $this->teamAddMemberRequest($team_add_member_request, $team_id, $contentType); @@ -210,14 +199,14 @@ public function teamAddMemberWithHttpInfo($team_add_member_request, $team_id = n } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -225,7 +214,6 @@ public function teamAddMemberWithHttpInfo($team_add_member_request, $team_id = n $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -235,17 +223,16 @@ public function teamAddMemberWithHttpInfo($team_add_member_request, $team_id = n return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\TeamGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -262,9 +249,8 @@ public function teamAddMemberWithHttpInfo($team_add_member_request, $team_id = n return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -272,23 +258,23 @@ public function teamAddMemberWithHttpInfo($team_add_member_request, $team_id = n sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -305,11 +291,9 @@ public function teamAddMemberWithHttpInfo($team_add_member_request, $team_id = n return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -322,7 +306,6 @@ public function teamAddMemberWithHttpInfo($team_add_member_request, $team_id = n ); $e->setResponseObject($data); break; - } throw $e; } @@ -333,15 +316,15 @@ public function teamAddMemberWithHttpInfo($team_add_member_request, $team_id = n * * Add User to Team * - * @param Model\TeamAddMemberRequest $team_add_member_request (required) - * @param string|null $team_id The id of the team. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation + * @param Model\TeamAddMemberRequest $team_add_member_request (required) + * @param string|null $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamAddMember. This method will eventually become unavailable */ - public function teamAddMemberAsync($team_add_member_request, $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) + public function teamAddMemberAsync(Model\TeamAddMemberRequest $team_add_member_request, ?string $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) { return $this->teamAddMemberAsyncWithHttpInfo($team_add_member_request, $team_id, $contentType) ->then( @@ -356,15 +339,15 @@ function ($response) { * * Add User to Team * - * @param Model\TeamAddMemberRequest $team_add_member_request (required) - * @param string|null $team_id The id of the team. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation + * @param Model\TeamAddMemberRequest $team_add_member_request (required) + * @param string|null $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamAddMember. This method will eventually become unavailable */ - public function teamAddMemberAsyncWithHttpInfo($team_add_member_request, $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) + public function teamAddMemberAsyncWithHttpInfo(Model\TeamAddMemberRequest $team_add_member_request, ?string $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) { $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; $request = $this->teamAddMemberRequest($team_add_member_request, $team_id, $contentType); @@ -374,9 +357,9 @@ public function teamAddMemberAsyncWithHttpInfo($team_add_member_request, $team_i ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -385,7 +368,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -399,7 +382,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -408,26 +391,23 @@ function ($exception) { /** * Create request for operation 'teamAddMember' * - * @param Model\TeamAddMemberRequest $team_add_member_request (required) - * @param string|null $team_id The id of the team. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation + * @param Model\TeamAddMemberRequest $team_add_member_request (required) + * @param string|null $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamAddMember. This method will eventually become unavailable */ - public function teamAddMemberRequest($team_add_member_request, $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) + public function teamAddMemberRequest(Model\TeamAddMemberRequest $team_add_member_request, ?string $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) { - // verify the required parameter 'team_add_member_request' is set if ($team_add_member_request === null || (is_array($team_add_member_request) && count($team_add_member_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $team_add_member_request when calling teamAddMember' ); } - - $resourcePath = '/team/add_member'; $formParams = []; $queryParams = []; @@ -450,11 +430,8 @@ public function teamAddMemberRequest($team_add_member_request, $team_id = null, false // required ) ?? []); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -462,7 +439,7 @@ public function teamAddMemberRequest($team_add_member_request, $team_id = null, // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($team_add_member_request)); } else { $httpBody = $team_add_member_request; @@ -475,7 +452,7 @@ public function teamAddMemberRequest($team_add_member_request, $team_id = null, foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -492,9 +469,8 @@ public function teamAddMemberRequest($team_add_member_request, $team_id = null, $payloadHook('multipart', $multipartContents, $team_add_member_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -537,13 +513,13 @@ public function teamAddMemberRequest($team_add_member_request, $team_id = null, * * Create Team * - * @param Model\TeamCreateRequest $team_create_request team_create_request (required) + * @param Model\TeamCreateRequest $team_create_request team_create_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\TeamGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function teamCreate($team_create_request) + public function teamCreate(Model\TeamCreateRequest $team_create_request) { list($response) = $this->teamCreateWithHttpInfo($team_create_request); return $response; @@ -554,15 +530,15 @@ public function teamCreate($team_create_request) * * Create Team * - * @param Model\TeamCreateRequest $team_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation + * @param Model\TeamCreateRequest $team_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\TeamGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamCreate. This method will eventually become unavailable */ - public function teamCreateWithHttpInfo($team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) + public function teamCreateWithHttpInfo(Model\TeamCreateRequest $team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) { $request = $this->teamCreateRequest($team_create_request, $contentType); @@ -574,14 +550,14 @@ public function teamCreateWithHttpInfo($team_create_request, string $contentType } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -589,7 +565,6 @@ public function teamCreateWithHttpInfo($team_create_request, string $contentType $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -599,17 +574,16 @@ public function teamCreateWithHttpInfo($team_create_request, string $contentType return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\TeamGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -626,9 +600,8 @@ public function teamCreateWithHttpInfo($team_create_request, string $contentType return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -636,23 +609,23 @@ public function teamCreateWithHttpInfo($team_create_request, string $contentType sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -669,11 +642,9 @@ public function teamCreateWithHttpInfo($team_create_request, string $contentType return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -686,7 +657,6 @@ public function teamCreateWithHttpInfo($team_create_request, string $contentType ); $e->setResponseObject($data); break; - } throw $e; } @@ -697,14 +667,14 @@ public function teamCreateWithHttpInfo($team_create_request, string $contentType * * Create Team * - * @param Model\TeamCreateRequest $team_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation + * @param Model\TeamCreateRequest $team_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamCreate. This method will eventually become unavailable */ - public function teamCreateAsync($team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) + public function teamCreateAsync(Model\TeamCreateRequest $team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) { return $this->teamCreateAsyncWithHttpInfo($team_create_request, $contentType) ->then( @@ -719,14 +689,14 @@ function ($response) { * * Create Team * - * @param Model\TeamCreateRequest $team_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation + * @param Model\TeamCreateRequest $team_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamCreate. This method will eventually become unavailable */ - public function teamCreateAsyncWithHttpInfo($team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) + public function teamCreateAsyncWithHttpInfo(Model\TeamCreateRequest $team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) { $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; $request = $this->teamCreateRequest($team_create_request, $contentType); @@ -736,9 +706,9 @@ public function teamCreateAsyncWithHttpInfo($team_create_request, string $conten ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -747,7 +717,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -761,7 +731,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -770,24 +740,22 @@ function ($exception) { /** * Create request for operation 'teamCreate' * - * @param Model\TeamCreateRequest $team_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation + * @param Model\TeamCreateRequest $team_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamCreate. This method will eventually become unavailable */ - public function teamCreateRequest($team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) + public function teamCreateRequest(Model\TeamCreateRequest $team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) { - // verify the required parameter 'team_create_request' is set if ($team_create_request === null || (is_array($team_create_request) && count($team_create_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $team_create_request when calling teamCreate' ); } - $resourcePath = '/team/create'; $formParams = []; $queryParams = []; @@ -801,11 +769,8 @@ public function teamCreateRequest($team_create_request, string $contentType = se $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -813,7 +778,7 @@ public function teamCreateRequest($team_create_request, string $contentType = se // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($team_create_request)); } else { $httpBody = $team_create_request; @@ -826,7 +791,7 @@ public function teamCreateRequest($team_create_request, string $contentType = se foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -843,9 +808,8 @@ public function teamCreateRequest($team_create_request, string $contentType = se $payloadHook('multipart', $multipartContents, $team_create_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -888,10 +852,8 @@ public function teamCreateRequest($team_create_request, string $contentType = se * * Delete Team * - * * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return void + * @throws InvalidArgumentException */ public function teamDelete() { @@ -903,11 +865,11 @@ public function teamDelete() * * Delete Team * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation * - * @throws 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) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamDelete. This method will eventually become unavailable */ public function teamDeleteWithHttpInfo(string $contentType = self::contentTypes['teamDelete'][0]) @@ -922,14 +884,14 @@ public function teamDeleteWithHttpInfo(string $contentType = self::contentTypes[ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -937,16 +899,12 @@ public function teamDeleteWithHttpInfo(string $contentType = self::contentTypes[ $statusCode = $response->getStatusCode(); - return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } switch ($e->getCode()) { - } throw $e; } @@ -957,10 +915,10 @@ public function teamDeleteWithHttpInfo(string $contentType = self::contentTypes[ * * Delete Team * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamDelete. This method will eventually become unavailable */ public function teamDeleteAsync(string $contentType = self::contentTypes['teamDelete'][0]) @@ -978,10 +936,10 @@ function ($response) { * * Delete Team * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamDelete. This method will eventually become unavailable */ public function teamDeleteAsyncWithHttpInfo(string $contentType = self::contentTypes['teamDelete'][0]) @@ -992,7 +950,7 @@ public function teamDeleteAsyncWithHttpInfo(string $contentType = self::contentT return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( - function ($response) use ($returnType) { + function ($response) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { @@ -1006,7 +964,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1015,16 +973,14 @@ function ($exception) { /** * Create request for operation 'teamDelete' * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamDelete. This method will eventually become unavailable */ public function teamDeleteRequest(string $contentType = self::contentTypes['teamDelete'][0]) { - - $resourcePath = '/team/destroy'; $formParams = []; $queryParams = []; @@ -1032,12 +988,8 @@ public function teamDeleteRequest(string $contentType = self::contentTypes['team $httpBody = ''; $multipart = false; - - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1051,7 +1003,7 @@ public function teamDeleteRequest(string $contentType = self::contentTypes['team foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1065,9 +1017,8 @@ public function teamDeleteRequest(string $contentType = self::contentTypes['team } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1110,10 +1061,9 @@ public function teamDeleteRequest(string $contentType = self::contentTypes['team * * Get Team * - * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\TeamGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function teamGet() { @@ -1126,11 +1076,11 @@ public function teamGet() * * Get Team * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\TeamGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamGet. This method will eventually become unavailable */ public function teamGetWithHttpInfo(string $contentType = self::contentTypes['teamGet'][0]) @@ -1145,14 +1095,14 @@ public function teamGetWithHttpInfo(string $contentType = self::contentTypes['te } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1160,7 +1110,6 @@ public function teamGetWithHttpInfo(string $contentType = self::contentTypes['te $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -1170,17 +1119,16 @@ public function teamGetWithHttpInfo(string $contentType = self::contentTypes['te return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\TeamGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1197,9 +1145,8 @@ public function teamGetWithHttpInfo(string $contentType = self::contentTypes['te return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -1207,23 +1154,23 @@ public function teamGetWithHttpInfo(string $contentType = self::contentTypes['te sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1240,11 +1187,9 @@ public function teamGetWithHttpInfo(string $contentType = self::contentTypes['te return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1257,7 +1202,6 @@ public function teamGetWithHttpInfo(string $contentType = self::contentTypes['te ); $e->setResponseObject($data); break; - } throw $e; } @@ -1268,10 +1212,10 @@ public function teamGetWithHttpInfo(string $contentType = self::contentTypes['te * * Get Team * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamGet. This method will eventually become unavailable */ public function teamGetAsync(string $contentType = self::contentTypes['teamGet'][0]) @@ -1289,10 +1233,10 @@ function ($response) { * * Get Team * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamGet. This method will eventually become unavailable */ public function teamGetAsyncWithHttpInfo(string $contentType = self::contentTypes['teamGet'][0]) @@ -1305,9 +1249,9 @@ public function teamGetAsyncWithHttpInfo(string $contentType = self::contentType ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1316,7 +1260,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -1330,7 +1274,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1339,16 +1283,14 @@ function ($exception) { /** * Create request for operation 'teamGet' * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamGet. This method will eventually become unavailable */ public function teamGetRequest(string $contentType = self::contentTypes['teamGet'][0]) { - - $resourcePath = '/team'; $formParams = []; $queryParams = []; @@ -1356,12 +1298,8 @@ public function teamGetRequest(string $contentType = self::contentTypes['teamGet $httpBody = ''; $multipart = false; - - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1375,7 +1313,7 @@ public function teamGetRequest(string $contentType = self::contentTypes['teamGet foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1389,9 +1327,8 @@ public function teamGetRequest(string $contentType = self::contentTypes['teamGet } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1434,13 +1371,13 @@ public function teamGetRequest(string $contentType = self::contentTypes['teamGet * * Get Team Info * - * @param string|null $team_id The id of the team. (optional) + * @param string|null $team_id The id of the team. (optional) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\TeamGetInfoResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function teamInfo($team_id = null) + public function teamInfo(?string $team_id = null) { list($response) = $this->teamInfoWithHttpInfo($team_id); return $response; @@ -1451,15 +1388,15 @@ public function teamInfo($team_id = null) * * Get Team Info * - * @param string|null $team_id The id of the team. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation + * @param string|null $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\TeamGetInfoResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamInfo. This method will eventually become unavailable */ - public function teamInfoWithHttpInfo($team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) + public function teamInfoWithHttpInfo(?string $team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) { $request = $this->teamInfoRequest($team_id, $contentType); @@ -1471,14 +1408,14 @@ public function teamInfoWithHttpInfo($team_id = null, string $contentType = self } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1486,7 +1423,6 @@ public function teamInfoWithHttpInfo($team_id = null, string $contentType = self $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -1496,17 +1432,16 @@ public function teamInfoWithHttpInfo($team_id = null, string $contentType = self return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TeamGetInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\TeamGetInfoResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1523,9 +1458,8 @@ public function teamInfoWithHttpInfo($team_id = null, string $contentType = self return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetInfoResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -1533,23 +1467,23 @@ public function teamInfoWithHttpInfo($team_id = null, string $contentType = self sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\TeamGetInfoResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1566,11 +1500,9 @@ public function teamInfoWithHttpInfo($team_id = null, string $contentType = self return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1583,7 +1515,6 @@ public function teamInfoWithHttpInfo($team_id = null, string $contentType = self ); $e->setResponseObject($data); break; - } throw $e; } @@ -1594,14 +1525,14 @@ public function teamInfoWithHttpInfo($team_id = null, string $contentType = self * * Get Team Info * - * @param string|null $team_id The id of the team. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation + * @param string|null $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamInfo. This method will eventually become unavailable */ - public function teamInfoAsync($team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) + public function teamInfoAsync(?string $team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) { return $this->teamInfoAsyncWithHttpInfo($team_id, $contentType) ->then( @@ -1616,14 +1547,14 @@ function ($response) { * * Get Team Info * - * @param string|null $team_id The id of the team. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation + * @param string|null $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamInfo. This method will eventually become unavailable */ - public function teamInfoAsyncWithHttpInfo($team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) + public function teamInfoAsyncWithHttpInfo(?string $team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) { $returnType = '\Dropbox\Sign\Model\TeamGetInfoResponse'; $request = $this->teamInfoRequest($team_id, $contentType); @@ -1633,9 +1564,9 @@ public function teamInfoAsyncWithHttpInfo($team_id = null, string $contentType = ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1644,7 +1575,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -1658,7 +1589,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1667,18 +1598,15 @@ function ($exception) { /** * Create request for operation 'teamInfo' * - * @param string|null $team_id The id of the team. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation + * @param string|null $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamInfo. This method will eventually become unavailable */ - public function teamInfoRequest($team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) + public function teamInfoRequest(?string $team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) { - - - $resourcePath = '/team/info'; $formParams = []; $queryParams = []; @@ -1696,11 +1624,8 @@ public function teamInfoRequest($team_id = null, string $contentType = self::con false // required ) ?? []); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1714,7 +1639,7 @@ public function teamInfoRequest($team_id = null, string $contentType = self::con foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1728,9 +1653,8 @@ public function teamInfoRequest($team_id = null, string $contentType = self::con } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1773,13 +1697,13 @@ public function teamInfoRequest($team_id = null, string $contentType = self::con * * List Team Invites * - * @param string|null $email_address The email address for which to display the team invites. (optional) + * @param string|null $email_address The email address for which to display the team invites. (optional) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\TeamInvitesResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function teamInvites($email_address = null) + public function teamInvites(?string $email_address = null) { list($response) = $this->teamInvitesWithHttpInfo($email_address); return $response; @@ -1790,15 +1714,15 @@ public function teamInvites($email_address = null) * * List Team Invites * - * @param string|null $email_address The email address for which to display the team invites. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation + * @param string|null $email_address The email address for which to display the team invites. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\TeamInvitesResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamInvites. This method will eventually become unavailable */ - public function teamInvitesWithHttpInfo($email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) + public function teamInvitesWithHttpInfo(?string $email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) { $request = $this->teamInvitesRequest($email_address, $contentType); @@ -1810,14 +1734,14 @@ public function teamInvitesWithHttpInfo($email_address = null, string $contentTy } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1825,7 +1749,6 @@ public function teamInvitesWithHttpInfo($email_address = null, string $contentTy $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -1835,17 +1758,16 @@ public function teamInvitesWithHttpInfo($email_address = null, string $contentTy return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TeamInvitesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\TeamInvitesResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1862,9 +1784,8 @@ public function teamInvitesWithHttpInfo($email_address = null, string $contentTy return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamInvitesResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -1872,23 +1793,23 @@ public function teamInvitesWithHttpInfo($email_address = null, string $contentTy sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\TeamInvitesResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1905,11 +1826,9 @@ public function teamInvitesWithHttpInfo($email_address = null, string $contentTy return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1922,7 +1841,6 @@ public function teamInvitesWithHttpInfo($email_address = null, string $contentTy ); $e->setResponseObject($data); break; - } throw $e; } @@ -1933,14 +1851,14 @@ public function teamInvitesWithHttpInfo($email_address = null, string $contentTy * * List Team Invites * - * @param string|null $email_address The email address for which to display the team invites. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation + * @param string|null $email_address The email address for which to display the team invites. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamInvites. This method will eventually become unavailable */ - public function teamInvitesAsync($email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) + public function teamInvitesAsync(?string $email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) { return $this->teamInvitesAsyncWithHttpInfo($email_address, $contentType) ->then( @@ -1955,14 +1873,14 @@ function ($response) { * * List Team Invites * - * @param string|null $email_address The email address for which to display the team invites. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation + * @param string|null $email_address The email address for which to display the team invites. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamInvites. This method will eventually become unavailable */ - public function teamInvitesAsyncWithHttpInfo($email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) + public function teamInvitesAsyncWithHttpInfo(?string $email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) { $returnType = '\Dropbox\Sign\Model\TeamInvitesResponse'; $request = $this->teamInvitesRequest($email_address, $contentType); @@ -1972,9 +1890,9 @@ public function teamInvitesAsyncWithHttpInfo($email_address = null, string $cont ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1983,7 +1901,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -1997,7 +1915,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2006,18 +1924,15 @@ function ($exception) { /** * Create request for operation 'teamInvites' * - * @param string|null $email_address The email address for which to display the team invites. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation + * @param string|null $email_address The email address for which to display the team invites. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamInvites. This method will eventually become unavailable */ - public function teamInvitesRequest($email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) + public function teamInvitesRequest(?string $email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) { - - - $resourcePath = '/team/invites'; $formParams = []; $queryParams = []; @@ -2035,11 +1950,8 @@ public function teamInvitesRequest($email_address = null, string $contentType = false // required ) ?? []); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -2053,7 +1965,7 @@ public function teamInvitesRequest($email_address = null, string $contentType = foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -2067,9 +1979,8 @@ public function teamInvitesRequest($email_address = null, string $contentType = } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2112,15 +2023,15 @@ public function teamInvitesRequest($email_address = null, string $contentType = * * List Team Members * - * @param string $team_id The id of the team that a member list is being requested from. (required) - * @param int|null $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $team_id The id of the team that a member list is being requested from. (required) + * @param int|null $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\TeamMembersResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function teamMembers($team_id, $page = 1, $page_size = 20) + public function teamMembers(string $team_id, ?int $page = 1, ?int $page_size = 20) { list($response) = $this->teamMembersWithHttpInfo($team_id, $page, $page_size); return $response; @@ -2131,17 +2042,17 @@ public function teamMembers($team_id, $page = 1, $page_size = 20) * * List Team Members * - * @param string $team_id The id of the team that a member list is being requested from. (required) - * @param int|null $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation + * @param string $team_id The id of the team that a member list is being requested from. (required) + * @param int|null $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\TeamMembersResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamMembers. This method will eventually become unavailable */ - public function teamMembersWithHttpInfo($team_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) + public function teamMembersWithHttpInfo(string $team_id, ?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) { $request = $this->teamMembersRequest($team_id, $page, $page_size, $contentType); @@ -2153,14 +2064,14 @@ public function teamMembersWithHttpInfo($team_id, $page = 1, $page_size = 20, st } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -2168,7 +2079,6 @@ public function teamMembersWithHttpInfo($team_id, $page = 1, $page_size = 20, st $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -2178,17 +2088,16 @@ public function teamMembersWithHttpInfo($team_id, $page = 1, $page_size = 20, st return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TeamMembersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\TeamMembersResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2205,9 +2114,8 @@ public function teamMembersWithHttpInfo($team_id, $page = 1, $page_size = 20, st return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamMembersResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -2215,23 +2123,23 @@ public function teamMembersWithHttpInfo($team_id, $page = 1, $page_size = 20, st sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\TeamMembersResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2248,11 +2156,9 @@ public function teamMembersWithHttpInfo($team_id, $page = 1, $page_size = 20, st return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2265,7 +2171,6 @@ public function teamMembersWithHttpInfo($team_id, $page = 1, $page_size = 20, st ); $e->setResponseObject($data); break; - } throw $e; } @@ -2276,16 +2181,16 @@ public function teamMembersWithHttpInfo($team_id, $page = 1, $page_size = 20, st * * List Team Members * - * @param string $team_id The id of the team that a member list is being requested from. (required) - * @param int|null $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation + * @param string $team_id The id of the team that a member list is being requested from. (required) + * @param int|null $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamMembers. This method will eventually become unavailable */ - public function teamMembersAsync($team_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) + public function teamMembersAsync(string $team_id, ?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) { return $this->teamMembersAsyncWithHttpInfo($team_id, $page, $page_size, $contentType) ->then( @@ -2300,16 +2205,16 @@ function ($response) { * * List Team Members * - * @param string $team_id The id of the team that a member list is being requested from. (required) - * @param int|null $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation + * @param string $team_id The id of the team that a member list is being requested from. (required) + * @param int|null $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamMembers. This method will eventually become unavailable */ - public function teamMembersAsyncWithHttpInfo($team_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) + public function teamMembersAsyncWithHttpInfo(string $team_id, ?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) { $returnType = '\Dropbox\Sign\Model\TeamMembersResponse'; $request = $this->teamMembersRequest($team_id, $page, $page_size, $contentType); @@ -2319,9 +2224,9 @@ public function teamMembersAsyncWithHttpInfo($team_id, $page = 1, $page_size = 2 ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2330,7 +2235,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -2344,7 +2249,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2353,34 +2258,31 @@ function ($exception) { /** * Create request for operation 'teamMembers' * - * @param string $team_id The id of the team that a member list is being requested from. (required) - * @param int|null $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation + * @param string $team_id The id of the team that a member list is being requested from. (required) + * @param int|null $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamMembers. This method will eventually become unavailable */ - public function teamMembersRequest($team_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) + public function teamMembersRequest(string $team_id, ?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) { - // verify the required parameter 'team_id' is set if ($team_id === null || (is_array($team_id) && count($team_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $team_id when calling teamMembers' ); } - if ($page_size !== null && $page_size > 100) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling TeamApi.teamMembers, must be smaller than or equal to 100.'); + throw new InvalidArgumentException('invalid value for "$page_size" when calling TeamApi.teamMembers, must be smaller than or equal to 100.'); } if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling TeamApi.teamMembers, must be bigger than or equal to 1.'); + throw new InvalidArgumentException('invalid value for "$page_size" when calling TeamApi.teamMembers, must be bigger than or equal to 1.'); } - $resourcePath = '/team/members/{team_id}'; $formParams = []; $queryParams = []; @@ -2407,19 +2309,17 @@ public function teamMembersRequest($team_id, $page = 1, $page_size = 20, string false // required ) ?? []); - // path params if ($team_id !== null) { $resourcePath = str_replace( - '{' . 'team_id' . '}', + '{team_id}', ObjectSerializer::toPathValue($team_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -2433,7 +2333,7 @@ public function teamMembersRequest($team_id, $page = 1, $page_size = 20, string foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -2447,9 +2347,8 @@ public function teamMembersRequest($team_id, $page = 1, $page_size = 20, string } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2492,13 +2391,13 @@ public function teamMembersRequest($team_id, $page = 1, $page_size = 20, string * * Remove User from Team * - * @param Model\TeamRemoveMemberRequest $team_remove_member_request team_remove_member_request (required) + * @param Model\TeamRemoveMemberRequest $team_remove_member_request team_remove_member_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\TeamGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function teamRemoveMember($team_remove_member_request) + public function teamRemoveMember(Model\TeamRemoveMemberRequest $team_remove_member_request) { list($response) = $this->teamRemoveMemberWithHttpInfo($team_remove_member_request); return $response; @@ -2509,15 +2408,15 @@ public function teamRemoveMember($team_remove_member_request) * * Remove User from Team * - * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation + * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\TeamGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamRemoveMember. This method will eventually become unavailable */ - public function teamRemoveMemberWithHttpInfo($team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) + public function teamRemoveMemberWithHttpInfo(Model\TeamRemoveMemberRequest $team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) { $request = $this->teamRemoveMemberRequest($team_remove_member_request, $contentType); @@ -2529,14 +2428,14 @@ public function teamRemoveMemberWithHttpInfo($team_remove_member_request, string } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -2544,7 +2443,6 @@ public function teamRemoveMemberWithHttpInfo($team_remove_member_request, string $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -2554,17 +2452,16 @@ public function teamRemoveMemberWithHttpInfo($team_remove_member_request, string return $result; } - switch ($statusCode) { case 201: if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\TeamGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2581,9 +2478,8 @@ public function teamRemoveMemberWithHttpInfo($team_remove_member_request, string return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -2591,23 +2487,23 @@ public function teamRemoveMemberWithHttpInfo($team_remove_member_request, string sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2624,11 +2520,9 @@ public function teamRemoveMemberWithHttpInfo($team_remove_member_request, string return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2641,7 +2535,6 @@ public function teamRemoveMemberWithHttpInfo($team_remove_member_request, string ); $e->setResponseObject($data); break; - } throw $e; } @@ -2652,14 +2545,14 @@ public function teamRemoveMemberWithHttpInfo($team_remove_member_request, string * * Remove User from Team * - * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation + * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamRemoveMember. This method will eventually become unavailable */ - public function teamRemoveMemberAsync($team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) + public function teamRemoveMemberAsync(Model\TeamRemoveMemberRequest $team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) { return $this->teamRemoveMemberAsyncWithHttpInfo($team_remove_member_request, $contentType) ->then( @@ -2674,14 +2567,14 @@ function ($response) { * * Remove User from Team * - * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation + * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamRemoveMember. This method will eventually become unavailable */ - public function teamRemoveMemberAsyncWithHttpInfo($team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) + public function teamRemoveMemberAsyncWithHttpInfo(Model\TeamRemoveMemberRequest $team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) { $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; $request = $this->teamRemoveMemberRequest($team_remove_member_request, $contentType); @@ -2691,9 +2584,9 @@ public function teamRemoveMemberAsyncWithHttpInfo($team_remove_member_request, s ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2702,7 +2595,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -2716,7 +2609,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2725,24 +2618,22 @@ function ($exception) { /** * Create request for operation 'teamRemoveMember' * - * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation + * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamRemoveMember. This method will eventually become unavailable */ - public function teamRemoveMemberRequest($team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) + public function teamRemoveMemberRequest(Model\TeamRemoveMemberRequest $team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) { - // verify the required parameter 'team_remove_member_request' is set if ($team_remove_member_request === null || (is_array($team_remove_member_request) && count($team_remove_member_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $team_remove_member_request when calling teamRemoveMember' ); } - $resourcePath = '/team/remove_member'; $formParams = []; $queryParams = []; @@ -2756,11 +2647,8 @@ public function teamRemoveMemberRequest($team_remove_member_request, string $con $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -2768,7 +2656,7 @@ public function teamRemoveMemberRequest($team_remove_member_request, string $con // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($team_remove_member_request)); } else { $httpBody = $team_remove_member_request; @@ -2781,7 +2669,7 @@ public function teamRemoveMemberRequest($team_remove_member_request, string $con foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -2798,9 +2686,8 @@ public function teamRemoveMemberRequest($team_remove_member_request, string $con $payloadHook('multipart', $multipartContents, $team_remove_member_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2843,15 +2730,15 @@ public function teamRemoveMemberRequest($team_remove_member_request, string $con * * List Sub Teams * - * @param string $team_id The id of the parent Team. (required) - * @param int|null $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $team_id The id of the parent Team. (required) + * @param int|null $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\TeamSubTeamsResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function teamSubTeams($team_id, $page = 1, $page_size = 20) + public function teamSubTeams(string $team_id, ?int $page = 1, ?int $page_size = 20) { list($response) = $this->teamSubTeamsWithHttpInfo($team_id, $page, $page_size); return $response; @@ -2862,17 +2749,17 @@ public function teamSubTeams($team_id, $page = 1, $page_size = 20) * * List Sub Teams * - * @param string $team_id The id of the parent Team. (required) - * @param int|null $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation + * @param string $team_id The id of the parent Team. (required) + * @param int|null $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\TeamSubTeamsResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamSubTeams. This method will eventually become unavailable */ - public function teamSubTeamsWithHttpInfo($team_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) + public function teamSubTeamsWithHttpInfo(string $team_id, ?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) { $request = $this->teamSubTeamsRequest($team_id, $page, $page_size, $contentType); @@ -2884,14 +2771,14 @@ public function teamSubTeamsWithHttpInfo($team_id, $page = 1, $page_size = 20, s } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -2899,7 +2786,6 @@ public function teamSubTeamsWithHttpInfo($team_id, $page = 1, $page_size = 20, s $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -2909,17 +2795,16 @@ public function teamSubTeamsWithHttpInfo($team_id, $page = 1, $page_size = 20, s return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TeamSubTeamsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\TeamSubTeamsResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2936,9 +2821,8 @@ public function teamSubTeamsWithHttpInfo($team_id, $page = 1, $page_size = 20, s return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamSubTeamsResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -2946,23 +2830,23 @@ public function teamSubTeamsWithHttpInfo($team_id, $page = 1, $page_size = 20, s sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\TeamSubTeamsResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2979,11 +2863,9 @@ public function teamSubTeamsWithHttpInfo($team_id, $page = 1, $page_size = 20, s return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2996,7 +2878,6 @@ public function teamSubTeamsWithHttpInfo($team_id, $page = 1, $page_size = 20, s ); $e->setResponseObject($data); break; - } throw $e; } @@ -3007,16 +2888,16 @@ public function teamSubTeamsWithHttpInfo($team_id, $page = 1, $page_size = 20, s * * List Sub Teams * - * @param string $team_id The id of the parent Team. (required) - * @param int|null $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation + * @param string $team_id The id of the parent Team. (required) + * @param int|null $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamSubTeams. This method will eventually become unavailable */ - public function teamSubTeamsAsync($team_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) + public function teamSubTeamsAsync(string $team_id, ?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) { return $this->teamSubTeamsAsyncWithHttpInfo($team_id, $page, $page_size, $contentType) ->then( @@ -3031,16 +2912,16 @@ function ($response) { * * List Sub Teams * - * @param string $team_id The id of the parent Team. (required) - * @param int|null $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation + * @param string $team_id The id of the parent Team. (required) + * @param int|null $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamSubTeams. This method will eventually become unavailable */ - public function teamSubTeamsAsyncWithHttpInfo($team_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) + public function teamSubTeamsAsyncWithHttpInfo(string $team_id, ?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) { $returnType = '\Dropbox\Sign\Model\TeamSubTeamsResponse'; $request = $this->teamSubTeamsRequest($team_id, $page, $page_size, $contentType); @@ -3050,9 +2931,9 @@ public function teamSubTeamsAsyncWithHttpInfo($team_id, $page = 1, $page_size = ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -3061,7 +2942,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -3075,7 +2956,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -3084,34 +2965,31 @@ function ($exception) { /** * Create request for operation 'teamSubTeams' * - * @param string $team_id The id of the parent Team. (required) - * @param int|null $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation + * @param string $team_id The id of the parent Team. (required) + * @param int|null $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamSubTeams. This method will eventually become unavailable */ - public function teamSubTeamsRequest($team_id, $page = 1, $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) + public function teamSubTeamsRequest(string $team_id, ?int $page = 1, ?int $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) { - // verify the required parameter 'team_id' is set if ($team_id === null || (is_array($team_id) && count($team_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $team_id when calling teamSubTeams' ); } - if ($page_size !== null && $page_size > 100) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling TeamApi.teamSubTeams, must be smaller than or equal to 100.'); + throw new InvalidArgumentException('invalid value for "$page_size" when calling TeamApi.teamSubTeams, must be smaller than or equal to 100.'); } if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling TeamApi.teamSubTeams, must be bigger than or equal to 1.'); + throw new InvalidArgumentException('invalid value for "$page_size" when calling TeamApi.teamSubTeams, must be bigger than or equal to 1.'); } - $resourcePath = '/team/sub_teams/{team_id}'; $formParams = []; $queryParams = []; @@ -3138,19 +3016,17 @@ public function teamSubTeamsRequest($team_id, $page = 1, $page_size = 20, string false // required ) ?? []); - // path params if ($team_id !== null) { $resourcePath = str_replace( - '{' . 'team_id' . '}', + '{team_id}', ObjectSerializer::toPathValue($team_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -3164,7 +3040,7 @@ public function teamSubTeamsRequest($team_id, $page = 1, $page_size = 20, string foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -3178,9 +3054,8 @@ public function teamSubTeamsRequest($team_id, $page = 1, $page_size = 20, string } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -3223,13 +3098,13 @@ public function teamSubTeamsRequest($team_id, $page = 1, $page_size = 20, string * * Update Team * - * @param Model\TeamUpdateRequest $team_update_request team_update_request (required) + * @param Model\TeamUpdateRequest $team_update_request team_update_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\TeamGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function teamUpdate($team_update_request) + public function teamUpdate(Model\TeamUpdateRequest $team_update_request) { list($response) = $this->teamUpdateWithHttpInfo($team_update_request); return $response; @@ -3240,15 +3115,15 @@ public function teamUpdate($team_update_request) * * Update Team * - * @param Model\TeamUpdateRequest $team_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation + * @param Model\TeamUpdateRequest $team_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\TeamGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamUpdate. This method will eventually become unavailable */ - public function teamUpdateWithHttpInfo($team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) + public function teamUpdateWithHttpInfo(Model\TeamUpdateRequest $team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) { $request = $this->teamUpdateRequest($team_update_request, $contentType); @@ -3260,14 +3135,14 @@ public function teamUpdateWithHttpInfo($team_update_request, string $contentType } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -3275,7 +3150,6 @@ public function teamUpdateWithHttpInfo($team_update_request, string $contentType $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -3285,17 +3159,16 @@ public function teamUpdateWithHttpInfo($team_update_request, string $contentType return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\TeamGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3312,9 +3185,8 @@ public function teamUpdateWithHttpInfo($team_update_request, string $contentType return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -3322,23 +3194,23 @@ public function teamUpdateWithHttpInfo($team_update_request, string $contentType sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3355,11 +3227,9 @@ public function teamUpdateWithHttpInfo($team_update_request, string $contentType return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -3372,7 +3242,6 @@ public function teamUpdateWithHttpInfo($team_update_request, string $contentType ); $e->setResponseObject($data); break; - } throw $e; } @@ -3383,14 +3252,14 @@ public function teamUpdateWithHttpInfo($team_update_request, string $contentType * * Update Team * - * @param Model\TeamUpdateRequest $team_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation + * @param Model\TeamUpdateRequest $team_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamUpdate. This method will eventually become unavailable */ - public function teamUpdateAsync($team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) + public function teamUpdateAsync(Model\TeamUpdateRequest $team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) { return $this->teamUpdateAsyncWithHttpInfo($team_update_request, $contentType) ->then( @@ -3405,14 +3274,14 @@ function ($response) { * * Update Team * - * @param Model\TeamUpdateRequest $team_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation + * @param Model\TeamUpdateRequest $team_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamUpdate. This method will eventually become unavailable */ - public function teamUpdateAsyncWithHttpInfo($team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) + public function teamUpdateAsyncWithHttpInfo(Model\TeamUpdateRequest $team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) { $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; $request = $this->teamUpdateRequest($team_update_request, $contentType); @@ -3422,9 +3291,9 @@ public function teamUpdateAsyncWithHttpInfo($team_update_request, string $conten ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -3433,7 +3302,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -3447,7 +3316,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -3456,24 +3325,22 @@ function ($exception) { /** * Create request for operation 'teamUpdate' * - * @param Model\TeamUpdateRequest $team_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation + * @param Model\TeamUpdateRequest $team_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::teamUpdate. This method will eventually become unavailable */ - public function teamUpdateRequest($team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) + public function teamUpdateRequest(Model\TeamUpdateRequest $team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) { - // verify the required parameter 'team_update_request' is set if ($team_update_request === null || (is_array($team_update_request) && count($team_update_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $team_update_request when calling teamUpdate' ); } - $resourcePath = '/team'; $formParams = []; $queryParams = []; @@ -3487,11 +3354,8 @@ public function teamUpdateRequest($team_update_request, string $contentType = se $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -3499,7 +3363,7 @@ public function teamUpdateRequest($team_update_request, string $contentType = se // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($team_update_request)); } else { $httpBody = $team_update_request; @@ -3512,7 +3376,7 @@ public function teamUpdateRequest($team_update_request, string $contentType = se foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -3529,9 +3393,8 @@ public function teamUpdateRequest($team_update_request, string $contentType = se $payloadHook('multipart', $multipartContents, $team_update_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -3572,8 +3435,8 @@ public function teamUpdateRequest($team_update_request, string $contentType = se /** * Create http client option * - * @throws \RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -3581,7 +3444,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -3597,8 +3460,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -3608,9 +3471,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); } return [ @@ -3629,8 +3492,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/TemplateApi.php b/sdks/php/src/Api/TemplateApi.php index a03fe5f71..2d39bc886 100644 --- a/sdks/php/src/Api/TemplateApi.php +++ b/sdks/php/src/Api/TemplateApi.php @@ -1,13 +1,10 @@ [ 'application/json', @@ -117,10 +110,7 @@ class TemplateApi protected $response; /** - * @param Configuration $config - * @param ClientInterface $client - * @param HeaderSelector $selector - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( ?Configuration $config = null, @@ -140,7 +130,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex($hostIndex): void + public function setHostIndex(int $hostIndex): void { $this->hostIndex = $hostIndex; } @@ -177,14 +167,14 @@ public function getResponse() * * Add User to Template * - * @param string $template_id The id of the Template to give the Account access to. (required) - * @param Model\TemplateAddUserRequest $template_add_user_request template_add_user_request (required) + * @param string $template_id The id of the Template to give the Account access to. (required) + * @param Model\TemplateAddUserRequest $template_add_user_request template_add_user_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\TemplateGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function templateAddUser($template_id, $template_add_user_request) + public function templateAddUser(string $template_id, Model\TemplateAddUserRequest $template_add_user_request) { list($response) = $this->templateAddUserWithHttpInfo($template_id, $template_add_user_request); return $response; @@ -195,16 +185,16 @@ public function templateAddUser($template_id, $template_add_user_request) * * Add User to Template * - * @param string $template_id The id of the Template to give the Account access to. (required) - * @param Model\TemplateAddUserRequest $template_add_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation + * @param string $template_id The id of the Template to give the Account access to. (required) + * @param Model\TemplateAddUserRequest $template_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\TemplateGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateAddUser. This method will eventually become unavailable */ - public function templateAddUserWithHttpInfo($template_id, $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) + public function templateAddUserWithHttpInfo(string $template_id, Model\TemplateAddUserRequest $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) { $request = $this->templateAddUserRequest($template_id, $template_add_user_request, $contentType); @@ -216,14 +206,14 @@ public function templateAddUserWithHttpInfo($template_id, $template_add_user_req } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -231,7 +221,6 @@ public function templateAddUserWithHttpInfo($template_id, $template_add_user_req $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -241,17 +230,16 @@ public function templateAddUserWithHttpInfo($template_id, $template_add_user_req return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TemplateGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\TemplateGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -268,9 +256,8 @@ public function templateAddUserWithHttpInfo($template_id, $template_add_user_req return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -278,23 +265,23 @@ public function templateAddUserWithHttpInfo($template_id, $template_add_user_req sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -311,11 +298,9 @@ public function templateAddUserWithHttpInfo($template_id, $template_add_user_req return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -328,7 +313,6 @@ public function templateAddUserWithHttpInfo($template_id, $template_add_user_req ); $e->setResponseObject($data); break; - } throw $e; } @@ -339,15 +323,15 @@ public function templateAddUserWithHttpInfo($template_id, $template_add_user_req * * Add User to Template * - * @param string $template_id The id of the Template to give the Account access to. (required) - * @param Model\TemplateAddUserRequest $template_add_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation + * @param string $template_id The id of the Template to give the Account access to. (required) + * @param Model\TemplateAddUserRequest $template_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateAddUser. This method will eventually become unavailable */ - public function templateAddUserAsync($template_id, $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) + public function templateAddUserAsync(string $template_id, Model\TemplateAddUserRequest $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) { return $this->templateAddUserAsyncWithHttpInfo($template_id, $template_add_user_request, $contentType) ->then( @@ -362,15 +346,15 @@ function ($response) { * * Add User to Template * - * @param string $template_id The id of the Template to give the Account access to. (required) - * @param Model\TemplateAddUserRequest $template_add_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation + * @param string $template_id The id of the Template to give the Account access to. (required) + * @param Model\TemplateAddUserRequest $template_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateAddUser. This method will eventually become unavailable */ - public function templateAddUserAsyncWithHttpInfo($template_id, $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) + public function templateAddUserAsyncWithHttpInfo(string $template_id, Model\TemplateAddUserRequest $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; $request = $this->templateAddUserRequest($template_id, $template_add_user_request, $contentType); @@ -380,9 +364,9 @@ public function templateAddUserAsyncWithHttpInfo($template_id, $template_add_use ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -391,7 +375,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -405,7 +389,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -414,32 +398,30 @@ function ($exception) { /** * Create request for operation 'templateAddUser' * - * @param string $template_id The id of the Template to give the Account access to. (required) - * @param Model\TemplateAddUserRequest $template_add_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation + * @param string $template_id The id of the Template to give the Account access to. (required) + * @param Model\TemplateAddUserRequest $template_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateAddUser. This method will eventually become unavailable */ - public function templateAddUserRequest($template_id, $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) + public function templateAddUserRequest(string $template_id, Model\TemplateAddUserRequest $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) { - // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $template_id when calling templateAddUser' ); } // verify the required parameter 'template_add_user_request' is set if ($template_add_user_request === null || (is_array($template_add_user_request) && count($template_add_user_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $template_add_user_request when calling templateAddUser' ); } - $resourcePath = '/template/add_user/{template_id}'; $formParams = []; $queryParams = []; @@ -453,19 +435,17 @@ public function templateAddUserRequest($template_id, $template_add_user_request, $multipart = !empty($formParams); - // path params if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', + '{template_id}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -473,7 +453,7 @@ public function templateAddUserRequest($template_id, $template_add_user_request, // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_add_user_request)); } else { $httpBody = $template_add_user_request; @@ -486,7 +466,7 @@ public function templateAddUserRequest($template_id, $template_add_user_request, foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -503,9 +483,8 @@ public function templateAddUserRequest($template_id, $template_add_user_request, $payloadHook('multipart', $multipartContents, $template_add_user_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -548,13 +527,13 @@ public function templateAddUserRequest($template_id, $template_add_user_request, * * Create Template * - * @param Model\TemplateCreateRequest $template_create_request template_create_request (required) + * @param Model\TemplateCreateRequest $template_create_request template_create_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\TemplateCreateResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function templateCreate($template_create_request) + public function templateCreate(Model\TemplateCreateRequest $template_create_request) { list($response) = $this->templateCreateWithHttpInfo($template_create_request); return $response; @@ -565,15 +544,15 @@ public function templateCreate($template_create_request) * * Create Template * - * @param Model\TemplateCreateRequest $template_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation + * @param Model\TemplateCreateRequest $template_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\TemplateCreateResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateCreate. This method will eventually become unavailable */ - public function templateCreateWithHttpInfo($template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) + public function templateCreateWithHttpInfo(Model\TemplateCreateRequest $template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) { $request = $this->templateCreateRequest($template_create_request, $contentType); @@ -585,14 +564,14 @@ public function templateCreateWithHttpInfo($template_create_request, string $con } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -600,7 +579,6 @@ public function templateCreateWithHttpInfo($template_create_request, string $con $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -610,17 +588,16 @@ public function templateCreateWithHttpInfo($template_create_request, string $con return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TemplateCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\TemplateCreateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -637,9 +614,8 @@ public function templateCreateWithHttpInfo($template_create_request, string $con return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateCreateResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -647,23 +623,23 @@ public function templateCreateWithHttpInfo($template_create_request, string $con sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\TemplateCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -680,11 +656,9 @@ public function templateCreateWithHttpInfo($template_create_request, string $con return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -697,7 +671,6 @@ public function templateCreateWithHttpInfo($template_create_request, string $con ); $e->setResponseObject($data); break; - } throw $e; } @@ -708,14 +681,14 @@ public function templateCreateWithHttpInfo($template_create_request, string $con * * Create Template * - * @param Model\TemplateCreateRequest $template_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation + * @param Model\TemplateCreateRequest $template_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateCreate. This method will eventually become unavailable */ - public function templateCreateAsync($template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) + public function templateCreateAsync(Model\TemplateCreateRequest $template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) { return $this->templateCreateAsyncWithHttpInfo($template_create_request, $contentType) ->then( @@ -730,14 +703,14 @@ function ($response) { * * Create Template * - * @param Model\TemplateCreateRequest $template_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation + * @param Model\TemplateCreateRequest $template_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateCreate. This method will eventually become unavailable */ - public function templateCreateAsyncWithHttpInfo($template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) + public function templateCreateAsyncWithHttpInfo(Model\TemplateCreateRequest $template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateCreateResponse'; $request = $this->templateCreateRequest($template_create_request, $contentType); @@ -747,9 +720,9 @@ public function templateCreateAsyncWithHttpInfo($template_create_request, string ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -758,7 +731,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -772,7 +745,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -781,24 +754,22 @@ function ($exception) { /** * Create request for operation 'templateCreate' * - * @param Model\TemplateCreateRequest $template_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation + * @param Model\TemplateCreateRequest $template_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateCreate. This method will eventually become unavailable */ - public function templateCreateRequest($template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) + public function templateCreateRequest(Model\TemplateCreateRequest $template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) { - // verify the required parameter 'template_create_request' is set if ($template_create_request === null || (is_array($template_create_request) && count($template_create_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $template_create_request when calling templateCreate' ); } - $resourcePath = '/template/create'; $formParams = []; $queryParams = []; @@ -812,11 +783,8 @@ public function templateCreateRequest($template_create_request, string $contentT $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -824,7 +792,7 @@ public function templateCreateRequest($template_create_request, string $contentT // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_create_request)); } else { $httpBody = $template_create_request; @@ -837,7 +805,7 @@ public function templateCreateRequest($template_create_request, string $contentT foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -854,9 +822,8 @@ public function templateCreateRequest($template_create_request, string $contentT $payloadHook('multipart', $multipartContents, $template_create_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -899,13 +866,13 @@ public function templateCreateRequest($template_create_request, string $contentT * * Create Embedded Template Draft * - * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request template_create_embedded_draft_request (required) + * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request template_create_embedded_draft_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\TemplateCreateEmbeddedDraftResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function templateCreateEmbeddedDraft($template_create_embedded_draft_request) + public function templateCreateEmbeddedDraft(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request) { list($response) = $this->templateCreateEmbeddedDraftWithHttpInfo($template_create_embedded_draft_request); return $response; @@ -916,15 +883,15 @@ public function templateCreateEmbeddedDraft($template_create_embedded_draft_requ * * Create Embedded Template Draft * - * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation + * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\TemplateCreateEmbeddedDraftResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateCreateEmbeddedDraft. This method will eventually become unavailable */ - public function templateCreateEmbeddedDraftWithHttpInfo($template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) + public function templateCreateEmbeddedDraftWithHttpInfo(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) { $request = $this->templateCreateEmbeddedDraftRequest($template_create_embedded_draft_request, $contentType); @@ -936,14 +903,14 @@ public function templateCreateEmbeddedDraftWithHttpInfo($template_create_embedde } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -951,7 +918,6 @@ public function templateCreateEmbeddedDraftWithHttpInfo($template_create_embedde $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -961,17 +927,16 @@ public function templateCreateEmbeddedDraftWithHttpInfo($template_create_embedde return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -988,9 +953,8 @@ public function templateCreateEmbeddedDraftWithHttpInfo($template_create_embedde return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -998,23 +962,23 @@ public function templateCreateEmbeddedDraftWithHttpInfo($template_create_embedde sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1031,11 +995,9 @@ public function templateCreateEmbeddedDraftWithHttpInfo($template_create_embedde return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1048,7 +1010,6 @@ public function templateCreateEmbeddedDraftWithHttpInfo($template_create_embedde ); $e->setResponseObject($data); break; - } throw $e; } @@ -1059,14 +1020,14 @@ public function templateCreateEmbeddedDraftWithHttpInfo($template_create_embedde * * Create Embedded Template Draft * - * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation + * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateCreateEmbeddedDraft. This method will eventually become unavailable */ - public function templateCreateEmbeddedDraftAsync($template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) + public function templateCreateEmbeddedDraftAsync(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) { return $this->templateCreateEmbeddedDraftAsyncWithHttpInfo($template_create_embedded_draft_request, $contentType) ->then( @@ -1081,14 +1042,14 @@ function ($response) { * * Create Embedded Template Draft * - * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation + * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateCreateEmbeddedDraft. This method will eventually become unavailable */ - public function templateCreateEmbeddedDraftAsyncWithHttpInfo($template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) + public function templateCreateEmbeddedDraftAsyncWithHttpInfo(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse'; $request = $this->templateCreateEmbeddedDraftRequest($template_create_embedded_draft_request, $contentType); @@ -1098,9 +1059,9 @@ public function templateCreateEmbeddedDraftAsyncWithHttpInfo($template_create_em ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1109,7 +1070,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -1123,7 +1084,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1132,24 +1093,22 @@ function ($exception) { /** * Create request for operation 'templateCreateEmbeddedDraft' * - * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation + * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateCreateEmbeddedDraft. This method will eventually become unavailable */ - public function templateCreateEmbeddedDraftRequest($template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) + public function templateCreateEmbeddedDraftRequest(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) { - // verify the required parameter 'template_create_embedded_draft_request' is set if ($template_create_embedded_draft_request === null || (is_array($template_create_embedded_draft_request) && count($template_create_embedded_draft_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $template_create_embedded_draft_request when calling templateCreateEmbeddedDraft' ); } - $resourcePath = '/template/create_embedded_draft'; $formParams = []; $queryParams = []; @@ -1163,11 +1122,8 @@ public function templateCreateEmbeddedDraftRequest($template_create_embedded_dra $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1175,7 +1131,7 @@ public function templateCreateEmbeddedDraftRequest($template_create_embedded_dra // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_create_embedded_draft_request)); } else { $httpBody = $template_create_embedded_draft_request; @@ -1188,7 +1144,7 @@ public function templateCreateEmbeddedDraftRequest($template_create_embedded_dra foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1205,9 +1161,8 @@ public function templateCreateEmbeddedDraftRequest($template_create_embedded_dra $payloadHook('multipart', $multipartContents, $template_create_embedded_draft_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1250,13 +1205,12 @@ public function templateCreateEmbeddedDraftRequest($template_create_embedded_dra * * Delete Template * - * @param string $template_id The id of the Template to delete. (required) + * @param string $template_id The id of the Template to delete. (required) * * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return void + * @throws InvalidArgumentException */ - public function templateDelete($template_id) + public function templateDelete(string $template_id) { $this->templateDeleteWithHttpInfo($template_id); } @@ -1266,15 +1220,15 @@ public function templateDelete($template_id) * * Delete Template * - * @param string $template_id The id of the Template to delete. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation + * @param string $template_id The id of the Template to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation * - * @throws 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) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateDelete. This method will eventually become unavailable */ - public function templateDeleteWithHttpInfo($template_id, string $contentType = self::contentTypes['templateDelete'][0]) + public function templateDeleteWithHttpInfo(string $template_id, string $contentType = self::contentTypes['templateDelete'][0]) { $request = $this->templateDeleteRequest($template_id, $contentType); @@ -1286,14 +1240,14 @@ public function templateDeleteWithHttpInfo($template_id, string $contentType = s } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1301,16 +1255,12 @@ public function templateDeleteWithHttpInfo($template_id, string $contentType = s $statusCode = $response->getStatusCode(); - return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } switch ($e->getCode()) { - } throw $e; } @@ -1321,14 +1271,14 @@ public function templateDeleteWithHttpInfo($template_id, string $contentType = s * * Delete Template * - * @param string $template_id The id of the Template to delete. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation + * @param string $template_id The id of the Template to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateDelete. This method will eventually become unavailable */ - public function templateDeleteAsync($template_id, string $contentType = self::contentTypes['templateDelete'][0]) + public function templateDeleteAsync(string $template_id, string $contentType = self::contentTypes['templateDelete'][0]) { return $this->templateDeleteAsyncWithHttpInfo($template_id, $contentType) ->then( @@ -1343,14 +1293,14 @@ function ($response) { * * Delete Template * - * @param string $template_id The id of the Template to delete. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation + * @param string $template_id The id of the Template to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateDelete. This method will eventually become unavailable */ - public function templateDeleteAsyncWithHttpInfo($template_id, string $contentType = self::contentTypes['templateDelete'][0]) + public function templateDeleteAsyncWithHttpInfo(string $template_id, string $contentType = self::contentTypes['templateDelete'][0]) { $returnType = ''; $request = $this->templateDeleteRequest($template_id, $contentType); @@ -1358,7 +1308,7 @@ public function templateDeleteAsyncWithHttpInfo($template_id, string $contentTyp return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( - function ($response) use ($returnType) { + function ($response) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { @@ -1372,7 +1322,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1381,24 +1331,22 @@ function ($exception) { /** * Create request for operation 'templateDelete' * - * @param string $template_id The id of the Template to delete. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation + * @param string $template_id The id of the Template to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateDelete. This method will eventually become unavailable */ - public function templateDeleteRequest($template_id, string $contentType = self::contentTypes['templateDelete'][0]) + public function templateDeleteRequest(string $template_id, string $contentType = self::contentTypes['templateDelete'][0]) { - // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $template_id when calling templateDelete' ); } - $resourcePath = '/template/delete/{template_id}'; $formParams = []; $queryParams = []; @@ -1406,20 +1354,17 @@ public function templateDeleteRequest($template_id, string $contentType = self:: $httpBody = ''; $multipart = false; - - // path params if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', + '{template_id}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1433,7 +1378,7 @@ public function templateDeleteRequest($template_id, string $contentType = self:: foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1447,9 +1392,8 @@ public function templateDeleteRequest($template_id, string $contentType = self:: } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1492,14 +1436,14 @@ public function templateDeleteRequest($template_id, string $contentType = self:: * * Get Template Files * - * @param string $template_id The id of the template files to retrieve. (required) - * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $template_id The id of the template files to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) * + * @return SplFileObject * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return \SplFileObject|\Dropbox\Sign\Model\ErrorResponse + * @throws InvalidArgumentException */ - public function templateFiles($template_id, $file_type = null) + public function templateFiles(string $template_id, ?string $file_type = null) { list($response) = $this->templateFilesWithHttpInfo($template_id, $file_type); return $response; @@ -1510,16 +1454,16 @@ public function templateFiles($template_id, $file_type = null) * * Get Template Files * - * @param string $template_id The id of the template files to retrieve. (required) - * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of \SplFileObject|\Dropbox\Sign\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateFiles. This method will eventually become unavailable */ - public function templateFilesWithHttpInfo($template_id, $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) + public function templateFilesWithHttpInfo(string $template_id, ?string $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) { $request = $this->templateFilesRequest($template_id, $file_type, $contentType); @@ -1531,14 +1475,14 @@ public function templateFilesWithHttpInfo($template_id, $file_type = null, strin } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1546,7 +1490,6 @@ public function templateFilesWithHttpInfo($template_id, $file_type = null, strin $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -1556,17 +1499,16 @@ public function templateFilesWithHttpInfo($template_id, $file_type = null, strin return $result; } - switch ($statusCode) { case 200: if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\SplFileObject' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1583,9 +1525,8 @@ public function templateFilesWithHttpInfo($template_id, $file_type = null, strin return [ ObjectSerializer::deserialize($content, '\SplFileObject', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -1593,23 +1534,23 @@ public function templateFilesWithHttpInfo($template_id, $file_type = null, strin sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\SplFileObject'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1626,11 +1567,9 @@ public function templateFilesWithHttpInfo($template_id, $file_type = null, strin return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1643,7 +1582,6 @@ public function templateFilesWithHttpInfo($template_id, $file_type = null, strin ); $e->setResponseObject($data); break; - } throw $e; } @@ -1654,15 +1592,15 @@ public function templateFilesWithHttpInfo($template_id, $file_type = null, strin * * Get Template Files * - * @param string $template_id The id of the template files to retrieve. (required) - * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateFiles. This method will eventually become unavailable */ - public function templateFilesAsync($template_id, $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) + public function templateFilesAsync(string $template_id, ?string $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) { return $this->templateFilesAsyncWithHttpInfo($template_id, $file_type, $contentType) ->then( @@ -1677,15 +1615,15 @@ function ($response) { * * Get Template Files * - * @param string $template_id The id of the template files to retrieve. (required) - * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateFiles. This method will eventually become unavailable */ - public function templateFilesAsyncWithHttpInfo($template_id, $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) + public function templateFilesAsyncWithHttpInfo(string $template_id, ?string $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) { $returnType = '\SplFileObject'; $request = $this->templateFilesRequest($template_id, $file_type, $contentType); @@ -1695,9 +1633,9 @@ public function templateFilesAsyncWithHttpInfo($template_id, $file_type = null, ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1706,7 +1644,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -1720,7 +1658,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1729,26 +1667,23 @@ function ($exception) { /** * Create request for operation 'templateFiles' * - * @param string $template_id The id of the template files to retrieve. (required) - * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param string|null $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateFiles. This method will eventually become unavailable */ - public function templateFilesRequest($template_id, $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) + public function templateFilesRequest(string $template_id, ?string $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) { - // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $template_id when calling templateFiles' ); } - - $resourcePath = '/template/files/{template_id}'; $formParams = []; $queryParams = []; @@ -1766,19 +1701,17 @@ public function templateFilesRequest($template_id, $file_type = null, string $co false // required ) ?? []); - // path params if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', + '{template_id}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/pdf', 'application/zip', 'application/json', ], + $multipart ? ['multipart/form-data'] : ['application/pdf', 'application/zip', 'application/json'], $contentType, $multipart ); @@ -1792,7 +1725,7 @@ public function templateFilesRequest($template_id, $file_type = null, string $co foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1806,9 +1739,8 @@ public function templateFilesRequest($template_id, $file_type = null, string $co } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1851,13 +1783,13 @@ public function templateFilesRequest($template_id, $file_type = null, string $co * * Get Template Files as Data Uri * - * @param string $template_id The id of the template files to retrieve. (required) + * @param string $template_id The id of the template files to retrieve. (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\FileResponseDataUri + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function templateFilesAsDataUri($template_id) + public function templateFilesAsDataUri(string $template_id) { list($response) = $this->templateFilesAsDataUriWithHttpInfo($template_id); return $response; @@ -1868,15 +1800,15 @@ public function templateFilesAsDataUri($template_id) * * Get Template Files as Data Uri * - * @param string $template_id The id of the template files to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\FileResponseDataUri, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateFilesAsDataUri. This method will eventually become unavailable */ - public function templateFilesAsDataUriWithHttpInfo($template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) + public function templateFilesAsDataUriWithHttpInfo(string $template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) { $request = $this->templateFilesAsDataUriRequest($template_id, $contentType); @@ -1888,14 +1820,14 @@ public function templateFilesAsDataUriWithHttpInfo($template_id, string $content } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1903,7 +1835,6 @@ public function templateFilesAsDataUriWithHttpInfo($template_id, string $content $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -1913,17 +1844,16 @@ public function templateFilesAsDataUriWithHttpInfo($template_id, string $content return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FileResponseDataUri' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\FileResponseDataUri' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1940,9 +1870,8 @@ public function templateFilesAsDataUriWithHttpInfo($template_id, string $content return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FileResponseDataUri', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -1950,23 +1879,23 @@ public function templateFilesAsDataUriWithHttpInfo($template_id, string $content sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\FileResponseDataUri'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1983,11 +1912,9 @@ public function templateFilesAsDataUriWithHttpInfo($template_id, string $content return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2000,7 +1927,6 @@ public function templateFilesAsDataUriWithHttpInfo($template_id, string $content ); $e->setResponseObject($data); break; - } throw $e; } @@ -2011,14 +1937,14 @@ public function templateFilesAsDataUriWithHttpInfo($template_id, string $content * * Get Template Files as Data Uri * - * @param string $template_id The id of the template files to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateFilesAsDataUri. This method will eventually become unavailable */ - public function templateFilesAsDataUriAsync($template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) + public function templateFilesAsDataUriAsync(string $template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) { return $this->templateFilesAsDataUriAsyncWithHttpInfo($template_id, $contentType) ->then( @@ -2033,14 +1959,14 @@ function ($response) { * * Get Template Files as Data Uri * - * @param string $template_id The id of the template files to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateFilesAsDataUri. This method will eventually become unavailable */ - public function templateFilesAsDataUriAsyncWithHttpInfo($template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) + public function templateFilesAsDataUriAsyncWithHttpInfo(string $template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) { $returnType = '\Dropbox\Sign\Model\FileResponseDataUri'; $request = $this->templateFilesAsDataUriRequest($template_id, $contentType); @@ -2050,9 +1976,9 @@ public function templateFilesAsDataUriAsyncWithHttpInfo($template_id, string $co ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2061,7 +1987,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -2075,7 +2001,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2084,24 +2010,22 @@ function ($exception) { /** * Create request for operation 'templateFilesAsDataUri' * - * @param string $template_id The id of the template files to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateFilesAsDataUri. This method will eventually become unavailable */ - public function templateFilesAsDataUriRequest($template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) + public function templateFilesAsDataUriRequest(string $template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) { - // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $template_id when calling templateFilesAsDataUri' ); } - $resourcePath = '/template/files_as_data_uri/{template_id}'; $formParams = []; $queryParams = []; @@ -2109,20 +2033,17 @@ public function templateFilesAsDataUriRequest($template_id, string $contentType $httpBody = ''; $multipart = false; - - // path params if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', + '{template_id}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -2136,7 +2057,7 @@ public function templateFilesAsDataUriRequest($template_id, string $contentType foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -2150,9 +2071,8 @@ public function templateFilesAsDataUriRequest($template_id, string $contentType } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2195,14 +2115,14 @@ public function templateFilesAsDataUriRequest($template_id, string $contentType * * Get Template Files as File Url * - * @param string $template_id The id of the template files to retrieve. (required) - * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $template_id The id of the template files to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\FileResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function templateFilesAsFileUrl($template_id, $force_download = 1) + public function templateFilesAsFileUrl(string $template_id, ?int $force_download = 1) { list($response) = $this->templateFilesAsFileUrlWithHttpInfo($template_id, $force_download); return $response; @@ -2213,16 +2133,16 @@ public function templateFilesAsFileUrl($template_id, $force_download = 1) * * Get Template Files as File Url * - * @param string $template_id The id of the template files to retrieve. (required) - * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\FileResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateFilesAsFileUrl. This method will eventually become unavailable */ - public function templateFilesAsFileUrlWithHttpInfo($template_id, $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) + public function templateFilesAsFileUrlWithHttpInfo(string $template_id, ?int $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) { $request = $this->templateFilesAsFileUrlRequest($template_id, $force_download, $contentType); @@ -2234,14 +2154,14 @@ public function templateFilesAsFileUrlWithHttpInfo($template_id, $force_download } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -2249,7 +2169,6 @@ public function templateFilesAsFileUrlWithHttpInfo($template_id, $force_download $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -2259,17 +2178,16 @@ public function templateFilesAsFileUrlWithHttpInfo($template_id, $force_download return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\FileResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\FileResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2286,9 +2204,8 @@ public function templateFilesAsFileUrlWithHttpInfo($template_id, $force_download return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FileResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -2296,23 +2213,23 @@ public function templateFilesAsFileUrlWithHttpInfo($template_id, $force_download sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\FileResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2329,11 +2246,9 @@ public function templateFilesAsFileUrlWithHttpInfo($template_id, $force_download return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2346,7 +2261,6 @@ public function templateFilesAsFileUrlWithHttpInfo($template_id, $force_download ); $e->setResponseObject($data); break; - } throw $e; } @@ -2357,15 +2271,15 @@ public function templateFilesAsFileUrlWithHttpInfo($template_id, $force_download * * Get Template Files as File Url * - * @param string $template_id The id of the template files to retrieve. (required) - * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateFilesAsFileUrl. This method will eventually become unavailable */ - public function templateFilesAsFileUrlAsync($template_id, $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) + public function templateFilesAsFileUrlAsync(string $template_id, ?int $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) { return $this->templateFilesAsFileUrlAsyncWithHttpInfo($template_id, $force_download, $contentType) ->then( @@ -2380,15 +2294,15 @@ function ($response) { * * Get Template Files as File Url * - * @param string $template_id The id of the template files to retrieve. (required) - * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateFilesAsFileUrl. This method will eventually become unavailable */ - public function templateFilesAsFileUrlAsyncWithHttpInfo($template_id, $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) + public function templateFilesAsFileUrlAsyncWithHttpInfo(string $template_id, ?int $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) { $returnType = '\Dropbox\Sign\Model\FileResponse'; $request = $this->templateFilesAsFileUrlRequest($template_id, $force_download, $contentType); @@ -2398,9 +2312,9 @@ public function templateFilesAsFileUrlAsyncWithHttpInfo($template_id, $force_dow ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2409,7 +2323,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -2423,7 +2337,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2432,26 +2346,23 @@ function ($exception) { /** * Create request for operation 'templateFilesAsFileUrl' * - * @param string $template_id The id of the template files to retrieve. (required) - * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation + * @param string $template_id The id of the template files to retrieve. (required) + * @param int|null $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateFilesAsFileUrl. This method will eventually become unavailable */ - public function templateFilesAsFileUrlRequest($template_id, $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) + public function templateFilesAsFileUrlRequest(string $template_id, ?int $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) { - // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $template_id when calling templateFilesAsFileUrl' ); } - - $resourcePath = '/template/files_as_file_url/{template_id}'; $formParams = []; $queryParams = []; @@ -2469,19 +2380,17 @@ public function templateFilesAsFileUrlRequest($template_id, $force_download = 1, false // required ) ?? []); - // path params if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', + '{template_id}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -2495,7 +2404,7 @@ public function templateFilesAsFileUrlRequest($template_id, $force_download = 1, foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -2509,9 +2418,8 @@ public function templateFilesAsFileUrlRequest($template_id, $force_download = 1, } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2554,13 +2462,13 @@ public function templateFilesAsFileUrlRequest($template_id, $force_download = 1, * * Get Template * - * @param string $template_id The id of the Template to retrieve. (required) + * @param string $template_id The id of the Template to retrieve. (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\TemplateGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function templateGet($template_id) + public function templateGet(string $template_id) { list($response) = $this->templateGetWithHttpInfo($template_id); return $response; @@ -2571,15 +2479,15 @@ public function templateGet($template_id) * * Get Template * - * @param string $template_id The id of the Template to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation + * @param string $template_id The id of the Template to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\TemplateGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateGet. This method will eventually become unavailable */ - public function templateGetWithHttpInfo($template_id, string $contentType = self::contentTypes['templateGet'][0]) + public function templateGetWithHttpInfo(string $template_id, string $contentType = self::contentTypes['templateGet'][0]) { $request = $this->templateGetRequest($template_id, $contentType); @@ -2591,14 +2499,14 @@ public function templateGetWithHttpInfo($template_id, string $contentType = self } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -2606,7 +2514,6 @@ public function templateGetWithHttpInfo($template_id, string $contentType = self $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -2616,17 +2523,16 @@ public function templateGetWithHttpInfo($template_id, string $contentType = self return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TemplateGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\TemplateGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2643,9 +2549,8 @@ public function templateGetWithHttpInfo($template_id, string $contentType = self return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -2653,23 +2558,23 @@ public function templateGetWithHttpInfo($template_id, string $contentType = self sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2686,11 +2591,9 @@ public function templateGetWithHttpInfo($template_id, string $contentType = self return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -2703,7 +2606,6 @@ public function templateGetWithHttpInfo($template_id, string $contentType = self ); $e->setResponseObject($data); break; - } throw $e; } @@ -2714,14 +2616,14 @@ public function templateGetWithHttpInfo($template_id, string $contentType = self * * Get Template * - * @param string $template_id The id of the Template to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation + * @param string $template_id The id of the Template to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateGet. This method will eventually become unavailable */ - public function templateGetAsync($template_id, string $contentType = self::contentTypes['templateGet'][0]) + public function templateGetAsync(string $template_id, string $contentType = self::contentTypes['templateGet'][0]) { return $this->templateGetAsyncWithHttpInfo($template_id, $contentType) ->then( @@ -2736,14 +2638,14 @@ function ($response) { * * Get Template * - * @param string $template_id The id of the Template to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation + * @param string $template_id The id of the Template to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateGet. This method will eventually become unavailable */ - public function templateGetAsyncWithHttpInfo($template_id, string $contentType = self::contentTypes['templateGet'][0]) + public function templateGetAsyncWithHttpInfo(string $template_id, string $contentType = self::contentTypes['templateGet'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; $request = $this->templateGetRequest($template_id, $contentType); @@ -2753,9 +2655,9 @@ public function templateGetAsyncWithHttpInfo($template_id, string $contentType = ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -2764,7 +2666,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -2778,7 +2680,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2787,24 +2689,22 @@ function ($exception) { /** * Create request for operation 'templateGet' * - * @param string $template_id The id of the Template to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation + * @param string $template_id The id of the Template to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateGet. This method will eventually become unavailable */ - public function templateGetRequest($template_id, string $contentType = self::contentTypes['templateGet'][0]) + public function templateGetRequest(string $template_id, string $contentType = self::contentTypes['templateGet'][0]) { - // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $template_id when calling templateGet' ); } - $resourcePath = '/template/{template_id}'; $formParams = []; $queryParams = []; @@ -2812,20 +2712,17 @@ public function templateGetRequest($template_id, string $contentType = self::con $httpBody = ''; $multipart = false; - - // path params if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', + '{template_id}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -2839,7 +2736,7 @@ public function templateGetRequest($template_id, string $contentType = self::con foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -2853,9 +2750,8 @@ public function templateGetRequest($template_id, string $contentType = self::con } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -2898,16 +2794,16 @@ public function templateGetRequest($template_id, string $contentType = self::con * * List Templates * - * @param string|null $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int|null $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string|null $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param string|null $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\TemplateListResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function templateList($account_id = null, $page = 1, $page_size = 20, $query = null) + public function templateList(?string $account_id = null, ?int $page = 1, ?int $page_size = 20, ?string $query = null) { list($response) = $this->templateListWithHttpInfo($account_id, $page, $page_size, $query); return $response; @@ -2918,18 +2814,18 @@ public function templateList($account_id = null, $page = 1, $page_size = 20, $qu * * List Templates * - * @param string|null $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int|null $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string|null $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation + * @param string|null $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\TemplateListResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateList. This method will eventually become unavailable */ - public function templateListWithHttpInfo($account_id = null, $page = 1, $page_size = 20, $query = null, string $contentType = self::contentTypes['templateList'][0]) + public function templateListWithHttpInfo(?string $account_id = null, ?int $page = 1, ?int $page_size = 20, ?string $query = null, string $contentType = self::contentTypes['templateList'][0]) { $request = $this->templateListRequest($account_id, $page, $page_size, $query, $contentType); @@ -2941,14 +2837,14 @@ public function templateListWithHttpInfo($account_id = null, $page = 1, $page_si } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -2956,7 +2852,6 @@ public function templateListWithHttpInfo($account_id = null, $page = 1, $page_si $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -2966,17 +2861,16 @@ public function templateListWithHttpInfo($account_id = null, $page = 1, $page_si return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TemplateListResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\TemplateListResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -2993,9 +2887,8 @@ public function templateListWithHttpInfo($account_id = null, $page = 1, $page_si return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateListResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -3003,23 +2896,23 @@ public function templateListWithHttpInfo($account_id = null, $page = 1, $page_si sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\TemplateListResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3036,11 +2929,9 @@ public function templateListWithHttpInfo($account_id = null, $page = 1, $page_si return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -3053,7 +2944,6 @@ public function templateListWithHttpInfo($account_id = null, $page = 1, $page_si ); $e->setResponseObject($data); break; - } throw $e; } @@ -3064,17 +2954,17 @@ public function templateListWithHttpInfo($account_id = null, $page = 1, $page_si * * List Templates * - * @param string|null $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int|null $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string|null $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation + * @param string|null $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateList. This method will eventually become unavailable */ - public function templateListAsync($account_id = null, $page = 1, $page_size = 20, $query = null, string $contentType = self::contentTypes['templateList'][0]) + public function templateListAsync(?string $account_id = null, ?int $page = 1, ?int $page_size = 20, ?string $query = null, string $contentType = self::contentTypes['templateList'][0]) { return $this->templateListAsyncWithHttpInfo($account_id, $page, $page_size, $query, $contentType) ->then( @@ -3089,17 +2979,17 @@ function ($response) { * * List Templates * - * @param string|null $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int|null $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string|null $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation + * @param string|null $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateList. This method will eventually become unavailable */ - public function templateListAsyncWithHttpInfo($account_id = null, $page = 1, $page_size = 20, $query = null, string $contentType = self::contentTypes['templateList'][0]) + public function templateListAsyncWithHttpInfo(?string $account_id = null, ?int $page = 1, ?int $page_size = 20, ?string $query = null, string $contentType = self::contentTypes['templateList'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateListResponse'; $request = $this->templateListRequest($account_id, $page, $page_size, $query, $contentType); @@ -3109,9 +2999,9 @@ public function templateListAsyncWithHttpInfo($account_id = null, $page = 1, $pa ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -3120,7 +3010,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -3134,7 +3024,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -3143,30 +3033,25 @@ function ($exception) { /** * Create request for operation 'templateList' * - * @param string|null $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int|null $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) - * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string|null $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation + * @param string|null $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int|null $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) + * @param int|null $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string|null $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateList. This method will eventually become unavailable */ - public function templateListRequest($account_id = null, $page = 1, $page_size = 20, $query = null, string $contentType = self::contentTypes['templateList'][0]) + public function templateListRequest(?string $account_id = null, ?int $page = 1, ?int $page_size = 20, ?string $query = null, string $contentType = self::contentTypes['templateList'][0]) { - - - if ($page_size !== null && $page_size > 100) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling TemplateApi.templateList, must be smaller than or equal to 100.'); + throw new InvalidArgumentException('invalid value for "$page_size" when calling TemplateApi.templateList, must be smaller than or equal to 100.'); } if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling TemplateApi.templateList, must be bigger than or equal to 1.'); + throw new InvalidArgumentException('invalid value for "$page_size" when calling TemplateApi.templateList, must be bigger than or equal to 1.'); } - - $resourcePath = '/template/list'; $formParams = []; $queryParams = []; @@ -3211,11 +3096,8 @@ public function templateListRequest($account_id = null, $page = 1, $page_size = false // required ) ?? []); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -3229,7 +3111,7 @@ public function templateListRequest($account_id = null, $page = 1, $page_size = foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -3243,9 +3125,8 @@ public function templateListRequest($account_id = null, $page = 1, $page_size = } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -3288,14 +3169,14 @@ public function templateListRequest($account_id = null, $page = 1, $page_size = * * Remove User from Template * - * @param string $template_id The id of the Template to remove the Account's access to. (required) - * @param Model\TemplateRemoveUserRequest $template_remove_user_request template_remove_user_request (required) + * @param string $template_id The id of the Template to remove the Account's access to. (required) + * @param Model\TemplateRemoveUserRequest $template_remove_user_request template_remove_user_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\TemplateGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function templateRemoveUser($template_id, $template_remove_user_request) + public function templateRemoveUser(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request) { list($response) = $this->templateRemoveUserWithHttpInfo($template_id, $template_remove_user_request); return $response; @@ -3306,16 +3187,16 @@ public function templateRemoveUser($template_id, $template_remove_user_request) * * Remove User from Template * - * @param string $template_id The id of the Template to remove the Account's access to. (required) - * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation + * @param string $template_id The id of the Template to remove the Account's access to. (required) + * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\TemplateGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateRemoveUser. This method will eventually become unavailable */ - public function templateRemoveUserWithHttpInfo($template_id, $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) + public function templateRemoveUserWithHttpInfo(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) { $request = $this->templateRemoveUserRequest($template_id, $template_remove_user_request, $contentType); @@ -3327,14 +3208,14 @@ public function templateRemoveUserWithHttpInfo($template_id, $template_remove_us } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -3342,7 +3223,6 @@ public function templateRemoveUserWithHttpInfo($template_id, $template_remove_us $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -3352,17 +3232,16 @@ public function templateRemoveUserWithHttpInfo($template_id, $template_remove_us return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TemplateGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\TemplateGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3379,9 +3258,8 @@ public function templateRemoveUserWithHttpInfo($template_id, $template_remove_us return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateGetResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -3389,23 +3267,23 @@ public function templateRemoveUserWithHttpInfo($template_id, $template_remove_us sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3422,11 +3300,9 @@ public function templateRemoveUserWithHttpInfo($template_id, $template_remove_us return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -3439,7 +3315,6 @@ public function templateRemoveUserWithHttpInfo($template_id, $template_remove_us ); $e->setResponseObject($data); break; - } throw $e; } @@ -3450,15 +3325,15 @@ public function templateRemoveUserWithHttpInfo($template_id, $template_remove_us * * Remove User from Template * - * @param string $template_id The id of the Template to remove the Account's access to. (required) - * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation + * @param string $template_id The id of the Template to remove the Account's access to. (required) + * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateRemoveUser. This method will eventually become unavailable */ - public function templateRemoveUserAsync($template_id, $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) + public function templateRemoveUserAsync(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) { return $this->templateRemoveUserAsyncWithHttpInfo($template_id, $template_remove_user_request, $contentType) ->then( @@ -3473,15 +3348,15 @@ function ($response) { * * Remove User from Template * - * @param string $template_id The id of the Template to remove the Account's access to. (required) - * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation + * @param string $template_id The id of the Template to remove the Account's access to. (required) + * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateRemoveUser. This method will eventually become unavailable */ - public function templateRemoveUserAsyncWithHttpInfo($template_id, $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) + public function templateRemoveUserAsyncWithHttpInfo(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; $request = $this->templateRemoveUserRequest($template_id, $template_remove_user_request, $contentType); @@ -3491,9 +3366,9 @@ public function templateRemoveUserAsyncWithHttpInfo($template_id, $template_remo ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -3502,7 +3377,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -3516,7 +3391,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -3525,32 +3400,30 @@ function ($exception) { /** * Create request for operation 'templateRemoveUser' * - * @param string $template_id The id of the Template to remove the Account's access to. (required) - * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation + * @param string $template_id The id of the Template to remove the Account's access to. (required) + * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateRemoveUser. This method will eventually become unavailable */ - public function templateRemoveUserRequest($template_id, $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) + public function templateRemoveUserRequest(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) { - // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $template_id when calling templateRemoveUser' ); } // verify the required parameter 'template_remove_user_request' is set if ($template_remove_user_request === null || (is_array($template_remove_user_request) && count($template_remove_user_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $template_remove_user_request when calling templateRemoveUser' ); } - $resourcePath = '/template/remove_user/{template_id}'; $formParams = []; $queryParams = []; @@ -3564,19 +3437,17 @@ public function templateRemoveUserRequest($template_id, $template_remove_user_re $multipart = !empty($formParams); - // path params if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', + '{template_id}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -3584,7 +3455,7 @@ public function templateRemoveUserRequest($template_id, $template_remove_user_re // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_remove_user_request)); } else { $httpBody = $template_remove_user_request; @@ -3597,7 +3468,7 @@ public function templateRemoveUserRequest($template_id, $template_remove_user_re foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -3614,9 +3485,8 @@ public function templateRemoveUserRequest($template_id, $template_remove_user_re $payloadHook('multipart', $multipartContents, $template_remove_user_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -3659,14 +3529,14 @@ public function templateRemoveUserRequest($template_id, $template_remove_user_re * * Update Template Files * - * @param string $template_id The ID of the template whose files to update. (required) - * @param Model\TemplateUpdateFilesRequest $template_update_files_request template_update_files_request (required) + * @param string $template_id The ID of the template whose files to update. (required) + * @param Model\TemplateUpdateFilesRequest $template_update_files_request template_update_files_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\TemplateUpdateFilesResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function templateUpdateFiles($template_id, $template_update_files_request) + public function templateUpdateFiles(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request) { list($response) = $this->templateUpdateFilesWithHttpInfo($template_id, $template_update_files_request); return $response; @@ -3677,16 +3547,16 @@ public function templateUpdateFiles($template_id, $template_update_files_request * * Update Template Files * - * @param string $template_id The ID of the template whose files to update. (required) - * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation + * @param string $template_id The ID of the template whose files to update. (required) + * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\TemplateUpdateFilesResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateUpdateFiles. This method will eventually become unavailable */ - public function templateUpdateFilesWithHttpInfo($template_id, $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) + public function templateUpdateFilesWithHttpInfo(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) { $request = $this->templateUpdateFilesRequest($template_id, $template_update_files_request, $contentType); @@ -3698,14 +3568,14 @@ public function templateUpdateFilesWithHttpInfo($template_id, $template_update_f } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -3713,7 +3583,6 @@ public function templateUpdateFilesWithHttpInfo($template_id, $template_update_f $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -3723,17 +3592,16 @@ public function templateUpdateFilesWithHttpInfo($template_id, $template_update_f return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\TemplateUpdateFilesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\TemplateUpdateFilesResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3750,9 +3618,8 @@ public function templateUpdateFilesWithHttpInfo($template_id, $template_update_f return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateUpdateFilesResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -3760,23 +3627,23 @@ public function templateUpdateFilesWithHttpInfo($template_id, $template_update_f sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\TemplateUpdateFilesResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -3793,11 +3660,9 @@ public function templateUpdateFilesWithHttpInfo($template_id, $template_update_f return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -3810,7 +3675,6 @@ public function templateUpdateFilesWithHttpInfo($template_id, $template_update_f ); $e->setResponseObject($data); break; - } throw $e; } @@ -3821,15 +3685,15 @@ public function templateUpdateFilesWithHttpInfo($template_id, $template_update_f * * Update Template Files * - * @param string $template_id The ID of the template whose files to update. (required) - * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation + * @param string $template_id The ID of the template whose files to update. (required) + * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateUpdateFiles. This method will eventually become unavailable */ - public function templateUpdateFilesAsync($template_id, $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) + public function templateUpdateFilesAsync(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) { return $this->templateUpdateFilesAsyncWithHttpInfo($template_id, $template_update_files_request, $contentType) ->then( @@ -3844,15 +3708,15 @@ function ($response) { * * Update Template Files * - * @param string $template_id The ID of the template whose files to update. (required) - * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation + * @param string $template_id The ID of the template whose files to update. (required) + * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateUpdateFiles. This method will eventually become unavailable */ - public function templateUpdateFilesAsyncWithHttpInfo($template_id, $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) + public function templateUpdateFilesAsyncWithHttpInfo(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateUpdateFilesResponse'; $request = $this->templateUpdateFilesRequest($template_id, $template_update_files_request, $contentType); @@ -3862,9 +3726,9 @@ public function templateUpdateFilesAsyncWithHttpInfo($template_id, $template_upd ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -3873,7 +3737,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -3887,7 +3751,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -3896,32 +3760,30 @@ function ($exception) { /** * Create request for operation 'templateUpdateFiles' * - * @param string $template_id The ID of the template whose files to update. (required) - * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation + * @param string $template_id The ID of the template whose files to update. (required) + * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::templateUpdateFiles. This method will eventually become unavailable */ - public function templateUpdateFilesRequest($template_id, $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) + public function templateUpdateFilesRequest(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) { - // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $template_id when calling templateUpdateFiles' ); } // verify the required parameter 'template_update_files_request' is set if ($template_update_files_request === null || (is_array($template_update_files_request) && count($template_update_files_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $template_update_files_request when calling templateUpdateFiles' ); } - $resourcePath = '/template/update_files/{template_id}'; $formParams = []; $queryParams = []; @@ -3935,19 +3797,17 @@ public function templateUpdateFilesRequest($template_id, $template_update_files_ $multipart = !empty($formParams); - // path params if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', + '{template_id}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -3955,7 +3815,7 @@ public function templateUpdateFilesRequest($template_id, $template_update_files_ // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_update_files_request)); } else { $httpBody = $template_update_files_request; @@ -3968,7 +3828,7 @@ public function templateUpdateFilesRequest($template_id, $template_update_files_ foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -3985,9 +3845,8 @@ public function templateUpdateFilesRequest($template_id, $template_update_files_ $payloadHook('multipart', $multipartContents, $template_update_files_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -4028,8 +3887,8 @@ public function templateUpdateFilesRequest($template_id, $template_update_files_ /** * Create http client option * - * @throws \RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -4037,7 +3896,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -4053,8 +3912,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -4064,9 +3923,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); } return [ @@ -4085,8 +3944,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/Api/UnclaimedDraftApi.php b/sdks/php/src/Api/UnclaimedDraftApi.php index eb41b67a3..bb24fb1d9 100644 --- a/sdks/php/src/Api/UnclaimedDraftApi.php +++ b/sdks/php/src/Api/UnclaimedDraftApi.php @@ -1,13 +1,10 @@ [ 'application/json', @@ -96,10 +88,7 @@ class UnclaimedDraftApi protected $response; /** - * @param Configuration $config - * @param ClientInterface $client - * @param HeaderSelector $selector - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( ?Configuration $config = null, @@ -119,7 +108,7 @@ public function __construct( * @param int $hostIndex Host index (required) * @deprecated To be made private in the future */ - public function setHostIndex($hostIndex): void + public function setHostIndex(int $hostIndex): void { $this->hostIndex = $hostIndex; } @@ -156,13 +145,13 @@ public function getResponse() * * Create Unclaimed Draft * - * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request unclaimed_draft_create_request (required) + * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request unclaimed_draft_create_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\UnclaimedDraftCreateResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function unclaimedDraftCreate($unclaimed_draft_create_request) + public function unclaimedDraftCreate(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request) { list($response) = $this->unclaimedDraftCreateWithHttpInfo($unclaimed_draft_create_request); return $response; @@ -173,15 +162,15 @@ public function unclaimedDraftCreate($unclaimed_draft_create_request) * * Create Unclaimed Draft * - * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\UnclaimedDraftCreateResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftCreate. This method will eventually become unavailable */ - public function unclaimedDraftCreateWithHttpInfo($unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) + public function unclaimedDraftCreateWithHttpInfo(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) { $request = $this->unclaimedDraftCreateRequest($unclaimed_draft_create_request, $contentType); @@ -193,14 +182,14 @@ public function unclaimedDraftCreateWithHttpInfo($unclaimed_draft_create_request } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -208,7 +197,6 @@ public function unclaimedDraftCreateWithHttpInfo($unclaimed_draft_create_request $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -218,17 +206,16 @@ public function unclaimedDraftCreateWithHttpInfo($unclaimed_draft_create_request return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -245,9 +232,8 @@ public function unclaimedDraftCreateWithHttpInfo($unclaimed_draft_create_request return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -255,23 +241,23 @@ public function unclaimedDraftCreateWithHttpInfo($unclaimed_draft_create_request sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -288,11 +274,9 @@ public function unclaimedDraftCreateWithHttpInfo($unclaimed_draft_create_request return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -305,7 +289,6 @@ public function unclaimedDraftCreateWithHttpInfo($unclaimed_draft_create_request ); $e->setResponseObject($data); break; - } throw $e; } @@ -316,14 +299,14 @@ public function unclaimedDraftCreateWithHttpInfo($unclaimed_draft_create_request * * Create Unclaimed Draft * - * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftCreate. This method will eventually become unavailable */ - public function unclaimedDraftCreateAsync($unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) + public function unclaimedDraftCreateAsync(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) { return $this->unclaimedDraftCreateAsyncWithHttpInfo($unclaimed_draft_create_request, $contentType) ->then( @@ -338,14 +321,14 @@ function ($response) { * * Create Unclaimed Draft * - * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftCreate. This method will eventually become unavailable */ - public function unclaimedDraftCreateAsyncWithHttpInfo($unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) + public function unclaimedDraftCreateAsyncWithHttpInfo(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) { $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; $request = $this->unclaimedDraftCreateRequest($unclaimed_draft_create_request, $contentType); @@ -355,9 +338,9 @@ public function unclaimedDraftCreateAsyncWithHttpInfo($unclaimed_draft_create_re ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -366,7 +349,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -380,7 +363,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -389,24 +372,22 @@ function ($exception) { /** * Create request for operation 'unclaimedDraftCreate' * - * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftCreate. This method will eventually become unavailable */ - public function unclaimedDraftCreateRequest($unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) + public function unclaimedDraftCreateRequest(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) { - // verify the required parameter 'unclaimed_draft_create_request' is set if ($unclaimed_draft_create_request === null || (is_array($unclaimed_draft_create_request) && count($unclaimed_draft_create_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $unclaimed_draft_create_request when calling unclaimedDraftCreate' ); } - $resourcePath = '/unclaimed_draft/create'; $formParams = []; $queryParams = []; @@ -420,11 +401,8 @@ public function unclaimedDraftCreateRequest($unclaimed_draft_create_request, str $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -432,7 +410,7 @@ public function unclaimedDraftCreateRequest($unclaimed_draft_create_request, str // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($unclaimed_draft_create_request)); } else { $httpBody = $unclaimed_draft_create_request; @@ -445,7 +423,7 @@ public function unclaimedDraftCreateRequest($unclaimed_draft_create_request, str foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -462,9 +440,8 @@ public function unclaimedDraftCreateRequest($unclaimed_draft_create_request, str $payloadHook('multipart', $multipartContents, $unclaimed_draft_create_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -507,13 +484,13 @@ public function unclaimedDraftCreateRequest($unclaimed_draft_create_request, str * * Create Embedded Unclaimed Draft * - * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request unclaimed_draft_create_embedded_request (required) + * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request unclaimed_draft_create_embedded_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\UnclaimedDraftCreateResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function unclaimedDraftCreateEmbedded($unclaimed_draft_create_embedded_request) + public function unclaimedDraftCreateEmbedded(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request) { list($response) = $this->unclaimedDraftCreateEmbeddedWithHttpInfo($unclaimed_draft_create_embedded_request); return $response; @@ -524,15 +501,15 @@ public function unclaimedDraftCreateEmbedded($unclaimed_draft_create_embedded_re * * Create Embedded Unclaimed Draft * - * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\UnclaimedDraftCreateResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftCreateEmbedded. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedWithHttpInfo($unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) + public function unclaimedDraftCreateEmbeddedWithHttpInfo(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) { $request = $this->unclaimedDraftCreateEmbeddedRequest($unclaimed_draft_create_embedded_request, $contentType); @@ -544,14 +521,14 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo($unclaimed_draft_create } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -559,7 +536,6 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo($unclaimed_draft_create $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -569,17 +545,16 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo($unclaimed_draft_create return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -596,9 +571,8 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo($unclaimed_draft_create return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -606,23 +580,23 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo($unclaimed_draft_create sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -639,11 +613,9 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo($unclaimed_draft_create return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -656,7 +628,6 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo($unclaimed_draft_create ); $e->setResponseObject($data); break; - } throw $e; } @@ -667,14 +638,14 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo($unclaimed_draft_create * * Create Embedded Unclaimed Draft * - * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftCreateEmbedded. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedAsync($unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) + public function unclaimedDraftCreateEmbeddedAsync(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) { return $this->unclaimedDraftCreateEmbeddedAsyncWithHttpInfo($unclaimed_draft_create_embedded_request, $contentType) ->then( @@ -689,14 +660,14 @@ function ($response) { * * Create Embedded Unclaimed Draft * - * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftCreateEmbedded. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedAsyncWithHttpInfo($unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) + public function unclaimedDraftCreateEmbeddedAsyncWithHttpInfo(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) { $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; $request = $this->unclaimedDraftCreateEmbeddedRequest($unclaimed_draft_create_embedded_request, $contentType); @@ -706,9 +677,9 @@ public function unclaimedDraftCreateEmbeddedAsyncWithHttpInfo($unclaimed_draft_c ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -717,7 +688,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -731,7 +702,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -740,24 +711,22 @@ function ($exception) { /** * Create request for operation 'unclaimedDraftCreateEmbedded' * - * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftCreateEmbedded. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedRequest($unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) + public function unclaimedDraftCreateEmbeddedRequest(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) { - // verify the required parameter 'unclaimed_draft_create_embedded_request' is set if ($unclaimed_draft_create_embedded_request === null || (is_array($unclaimed_draft_create_embedded_request) && count($unclaimed_draft_create_embedded_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $unclaimed_draft_create_embedded_request when calling unclaimedDraftCreateEmbedded' ); } - $resourcePath = '/unclaimed_draft/create_embedded'; $formParams = []; $queryParams = []; @@ -771,11 +740,8 @@ public function unclaimedDraftCreateEmbeddedRequest($unclaimed_draft_create_embe $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -783,7 +749,7 @@ public function unclaimedDraftCreateEmbeddedRequest($unclaimed_draft_create_embe // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($unclaimed_draft_create_embedded_request)); } else { $httpBody = $unclaimed_draft_create_embedded_request; @@ -796,7 +762,7 @@ public function unclaimedDraftCreateEmbeddedRequest($unclaimed_draft_create_embe foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -813,9 +779,8 @@ public function unclaimedDraftCreateEmbeddedRequest($unclaimed_draft_create_embe $payloadHook('multipart', $multipartContents, $unclaimed_draft_create_embedded_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -858,13 +823,13 @@ public function unclaimedDraftCreateEmbeddedRequest($unclaimed_draft_create_embe * * Create Embedded Unclaimed Draft with Template * - * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request unclaimed_draft_create_embedded_with_template_request (required) + * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request unclaimed_draft_create_embedded_with_template_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\UnclaimedDraftCreateResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function unclaimedDraftCreateEmbeddedWithTemplate($unclaimed_draft_create_embedded_with_template_request) + public function unclaimedDraftCreateEmbeddedWithTemplate(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request) { list($response) = $this->unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo($unclaimed_draft_create_embedded_with_template_request); return $response; @@ -875,15 +840,15 @@ public function unclaimedDraftCreateEmbeddedWithTemplate($unclaimed_draft_create * * Create Embedded Unclaimed Draft with Template * - * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\UnclaimedDraftCreateResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo($unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) + public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) { $request = $this->unclaimedDraftCreateEmbeddedWithTemplateRequest($unclaimed_draft_create_embedded_with_template_request, $contentType); @@ -895,14 +860,14 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo($unclaimed_ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -910,7 +875,6 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo($unclaimed_ $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -920,17 +884,16 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo($unclaimed_ return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -947,9 +910,8 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo($unclaimed_ return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -957,23 +919,23 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo($unclaimed_ sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -990,11 +952,9 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo($unclaimed_ return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1007,7 +967,6 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo($unclaimed_ ); $e->setResponseObject($data); break; - } throw $e; } @@ -1018,14 +977,14 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo($unclaimed_ * * Create Embedded Unclaimed Draft with Template * - * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedWithTemplateAsync($unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) + public function unclaimedDraftCreateEmbeddedWithTemplateAsync(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) { return $this->unclaimedDraftCreateEmbeddedWithTemplateAsyncWithHttpInfo($unclaimed_draft_create_embedded_with_template_request, $contentType) ->then( @@ -1040,14 +999,14 @@ function ($response) { * * Create Embedded Unclaimed Draft with Template * - * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedWithTemplateAsyncWithHttpInfo($unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) + public function unclaimedDraftCreateEmbeddedWithTemplateAsyncWithHttpInfo(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; $request = $this->unclaimedDraftCreateEmbeddedWithTemplateRequest($unclaimed_draft_create_embedded_with_template_request, $contentType); @@ -1057,9 +1016,9 @@ public function unclaimedDraftCreateEmbeddedWithTemplateAsyncWithHttpInfo($uncla ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1068,7 +1027,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -1082,7 +1041,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1091,24 +1050,22 @@ function ($exception) { /** * Create request for operation 'unclaimedDraftCreateEmbeddedWithTemplate' * - * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation + * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedWithTemplateRequest($unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) + public function unclaimedDraftCreateEmbeddedWithTemplateRequest(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) { - // verify the required parameter 'unclaimed_draft_create_embedded_with_template_request' is set if ($unclaimed_draft_create_embedded_with_template_request === null || (is_array($unclaimed_draft_create_embedded_with_template_request) && count($unclaimed_draft_create_embedded_with_template_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $unclaimed_draft_create_embedded_with_template_request when calling unclaimedDraftCreateEmbeddedWithTemplate' ); } - $resourcePath = '/unclaimed_draft/create_embedded_with_template'; $formParams = []; $queryParams = []; @@ -1122,11 +1079,8 @@ public function unclaimedDraftCreateEmbeddedWithTemplateRequest($unclaimed_draft $multipart = !empty($formParams); - - - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1134,7 +1088,7 @@ public function unclaimedDraftCreateEmbeddedWithTemplateRequest($unclaimed_draft // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($unclaimed_draft_create_embedded_with_template_request)); } else { $httpBody = $unclaimed_draft_create_embedded_with_template_request; @@ -1147,7 +1101,7 @@ public function unclaimedDraftCreateEmbeddedWithTemplateRequest($unclaimed_draft foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1164,9 +1118,8 @@ public function unclaimedDraftCreateEmbeddedWithTemplateRequest($unclaimed_draft $payloadHook('multipart', $multipartContents, $unclaimed_draft_create_embedded_with_template_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1209,14 +1162,14 @@ public function unclaimedDraftCreateEmbeddedWithTemplateRequest($unclaimed_draft * * Edit and Resend Unclaimed Draft * - * @param string $signature_request_id The ID of the signature request to edit and resend. (required) - * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request unclaimed_draft_edit_and_resend_request (required) + * @param string $signature_request_id The ID of the signature request to edit and resend. (required) + * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request unclaimed_draft_edit_and_resend_request (required) * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return Model\UnclaimedDraftCreateResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ - public function unclaimedDraftEditAndResend($signature_request_id, $unclaimed_draft_edit_and_resend_request) + public function unclaimedDraftEditAndResend(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request) { list($response) = $this->unclaimedDraftEditAndResendWithHttpInfo($signature_request_id, $unclaimed_draft_edit_and_resend_request); return $response; @@ -1227,16 +1180,16 @@ public function unclaimedDraftEditAndResend($signature_request_id, $unclaimed_dr * * Edit and Resend Unclaimed Draft * - * @param string $signature_request_id The ID of the signature request to edit and resend. (required) - * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation + * @param string $signature_request_id The ID of the signature request to edit and resend. (required) + * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation * - * @throws ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException * @return array of Model\UnclaimedDraftCreateResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftEditAndResend. This method will eventually become unavailable */ - public function unclaimedDraftEditAndResendWithHttpInfo($signature_request_id, $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) + public function unclaimedDraftEditAndResendWithHttpInfo(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) { $request = $this->unclaimedDraftEditAndResendRequest($signature_request_id, $unclaimed_draft_edit_and_resend_request, $contentType); @@ -1248,14 +1201,14 @@ public function unclaimedDraftEditAndResendWithHttpInfo($signature_request_id, $ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1263,7 +1216,6 @@ public function unclaimedDraftEditAndResendWithHttpInfo($signature_request_id, $ $statusCode = $response->getStatusCode(); - $result = $this->handleRangeCodeResponse( $response, '4XX', @@ -1273,17 +1225,16 @@ public function unclaimedDraftEditAndResendWithHttpInfo($signature_request_id, $ return $result; } - switch ($statusCode) { case 200: if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1300,9 +1251,8 @@ public function unclaimedDraftEditAndResendWithHttpInfo($signature_request_id, $ return [ ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } if ($statusCode < 200 || $statusCode > 299) { @@ -1310,23 +1260,23 @@ public function unclaimedDraftEditAndResendWithHttpInfo($signature_request_id, $ sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { + } catch (JsonException $exception) { throw new ApiException( sprintf( 'Error JSON decoding server response (%s)', @@ -1343,11 +1293,9 @@ public function unclaimedDraftEditAndResendWithHttpInfo($signature_request_id, $ return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { - if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { throw $e; } @@ -1360,7 +1308,6 @@ public function unclaimedDraftEditAndResendWithHttpInfo($signature_request_id, $ ); $e->setResponseObject($data); break; - } throw $e; } @@ -1371,15 +1318,15 @@ public function unclaimedDraftEditAndResendWithHttpInfo($signature_request_id, $ * * Edit and Resend Unclaimed Draft * - * @param string $signature_request_id The ID of the signature request to edit and resend. (required) - * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation + * @param string $signature_request_id The ID of the signature request to edit and resend. (required) + * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftEditAndResend. This method will eventually become unavailable */ - public function unclaimedDraftEditAndResendAsync($signature_request_id, $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) + public function unclaimedDraftEditAndResendAsync(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) { return $this->unclaimedDraftEditAndResendAsyncWithHttpInfo($signature_request_id, $unclaimed_draft_edit_and_resend_request, $contentType) ->then( @@ -1394,15 +1341,15 @@ function ($response) { * * Edit and Resend Unclaimed Draft * - * @param string $signature_request_id The ID of the signature request to edit and resend. (required) - * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation + * @param string $signature_request_id The ID of the signature request to edit and resend. (required) + * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation * - * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftEditAndResend. This method will eventually become unavailable */ - public function unclaimedDraftEditAndResendAsyncWithHttpInfo($signature_request_id, $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) + public function unclaimedDraftEditAndResendAsyncWithHttpInfo(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) { $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; $request = $this->unclaimedDraftEditAndResendRequest($signature_request_id, $unclaimed_draft_edit_and_resend_request, $contentType); @@ -1412,9 +1359,9 @@ public function unclaimedDraftEditAndResendAsyncWithHttpInfo($signature_request_ ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } @@ -1423,7 +1370,7 @@ function ($response) use ($returnType) { return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; }, function ($exception) { @@ -1437,7 +1384,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1446,32 +1393,30 @@ function ($exception) { /** * Create request for operation 'unclaimedDraftEditAndResend' * - * @param string $signature_request_id The ID of the signature request to edit and resend. (required) - * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation + * @param string $signature_request_id The ID of the signature request to edit and resend. (required) + * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @return Request + * @throws InvalidArgumentException * @deprecated Prefer to use ::unclaimedDraftEditAndResend. This method will eventually become unavailable */ - public function unclaimedDraftEditAndResendRequest($signature_request_id, $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) + public function unclaimedDraftEditAndResendRequest(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) { - // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $signature_request_id when calling unclaimedDraftEditAndResend' ); } // verify the required parameter 'unclaimed_draft_edit_and_resend_request' is set if ($unclaimed_draft_edit_and_resend_request === null || (is_array($unclaimed_draft_edit_and_resend_request) && count($unclaimed_draft_edit_and_resend_request) === 0)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Missing the required parameter $unclaimed_draft_edit_and_resend_request when calling unclaimedDraftEditAndResend' ); } - $resourcePath = '/unclaimed_draft/edit_and_resend/{signature_request_id}'; $formParams = []; $queryParams = []; @@ -1485,19 +1430,17 @@ public function unclaimedDraftEditAndResendRequest($signature_request_id, $uncla $multipart = !empty($formParams); - // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json', ], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1505,7 +1448,7 @@ public function unclaimedDraftEditAndResendRequest($signature_request_id, $uncla // for model (json/xml) if (count($formParams) === 0) { if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body + // if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($unclaimed_draft_edit_and_resend_request)); } else { $httpBody = $unclaimed_draft_edit_and_resend_request; @@ -1518,7 +1461,7 @@ public function unclaimedDraftEditAndResendRequest($signature_request_id, $uncla foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, - 'contents' => $formParamValueItem + 'contents' => $formParamValueItem, ]; } } @@ -1535,9 +1478,8 @@ public function unclaimedDraftEditAndResendRequest($signature_request_id, $uncla $payloadHook('multipart', $multipartContents, $unclaimed_draft_edit_and_resend_request); } $httpBody = new MultipartStream($multipartContents); - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters + // if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) @@ -1578,8 +1520,8 @@ public function unclaimedDraftEditAndResendRequest($signature_request_id, $uncla /** * Create http client option * - * @throws \RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -1587,7 +1529,7 @@ protected function createHttpClientOption() if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } @@ -1603,8 +1545,8 @@ private function handleRangeCodeResponse( string $returnDataType ) { $statusCode = $response->getStatusCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft @@ -1614,9 +1556,9 @@ private function handleRangeCodeResponse( } if ($returnDataType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); } return [ @@ -1635,8 +1577,8 @@ private function handleRangeCodeException( string $exceptionDataType ): bool { $statusCode = $e->getCode(); - $rangeCodeLeft = (int) (substr($rangeCode, 0, 1) . '00'); - $rangeCodeRight = (int) (substr($rangeCode, 0, 1) . '99'); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); if ( $statusCode < $rangeCodeLeft diff --git a/sdks/php/src/ApiException.php b/sdks/php/src/ApiException.php index a71729e27..88738d79b 100644 --- a/sdks/php/src/ApiException.php +++ b/sdks/php/src/ApiException.php @@ -1,13 +1,10 @@ responseHeaders = $responseHeaders; @@ -90,7 +86,7 @@ public function getResponseHeaders() /** * Gets the HTTP body of the server response either as Json or string * - * @return \stdClass|string|null HTTP body of the server response either as \stdClass or string + * @return stdClass|string|null HTTP body of the server response either as \stdClass or string */ public function getResponseBody() { @@ -101,8 +97,6 @@ public function getResponseBody() * Sets the deserialized response object (during deserialization) * * @param string|int|object|array|mixed $obj Deserialized response object - * - * @return void */ public function setResponseObject($obj) { diff --git a/sdks/php/src/Configuration.php b/sdks/php/src/Configuration.php index ae0b48497..b5ee14abd 100644 --- a/sdks/php/src/Configuration.php +++ b/sdks/php/src/Configuration.php @@ -1,13 +1,10 @@ apiKeys[$apiKeyIdentifier] = $key; return $this; @@ -162,9 +157,9 @@ protected function setApiKey($apiKeyIdentifier, $key) * * @param string $apiKeyIdentifier API key identifier (authentication scheme) * - * @return null|string API key or token + * @return string|null API key or token */ - protected function getApiKey($apiKeyIdentifier) + protected function getApiKey(string $apiKeyIdentifier) { return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; } @@ -177,7 +172,7 @@ protected function getApiKey($apiKeyIdentifier) * * @return $this */ - protected function setApiKeyPrefix($apiKeyIdentifier, $prefix) + protected function setApiKeyPrefix(string $apiKeyIdentifier, string $prefix) { $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; return $this; @@ -188,9 +183,9 @@ protected function setApiKeyPrefix($apiKeyIdentifier, $prefix) * * @param string $apiKeyIdentifier API key identifier (authentication scheme) * - * @return null|string + * @return string|null */ - protected function getApiKeyPrefix($apiKeyIdentifier) + protected function getApiKeyPrefix(string $apiKeyIdentifier) { return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; } @@ -202,7 +197,7 @@ protected function getApiKeyPrefix($apiKeyIdentifier) * * @return $this */ - public function setAccessToken($accessToken) + public function setAccessToken(string $accessToken) { $this->accessToken = $accessToken; return $this; @@ -249,7 +244,7 @@ public function getBooleanFormatForQueryString(): string * * @return $this */ - public function setUsername($username) + public function setUsername(string $username) { $this->username = $username; return $this; @@ -272,7 +267,7 @@ public function getUsername() * * @return $this */ - protected function setPassword($password) + protected function setPassword(string $password) { $this->password = $password; return $this; @@ -295,7 +290,7 @@ protected function getPassword() * * @return $this */ - public function setHost($host) + public function setHost(string $host) { $this->host = $host; return $this; @@ -316,13 +311,13 @@ public function getHost() * * @param string $userAgent the user agent of the api client * - * @throws \InvalidArgumentException * @return $this + * @throws InvalidArgumentException */ - public function setUserAgent($userAgent) + public function setUserAgent(string $userAgent) { if (!is_string($userAgent)) { - throw new \InvalidArgumentException('User-agent must be a string.'); + throw new InvalidArgumentException('User-agent must be a string.'); } $this->userAgent = $userAgent; @@ -346,7 +341,7 @@ public function getUserAgent() * * @return $this */ - public function setDebug($debug) + public function setDebug(bool $debug) { $this->debug = $debug; return $this; @@ -369,7 +364,7 @@ public function getDebug() * * @return $this */ - public function setDebugFile($debugFile) + public function setDebugFile(string $debugFile) { $this->debugFile = $debugFile; return $this; @@ -392,7 +387,7 @@ public function getDebugFile() * * @return $this */ - public function setTempFolderPath($tempFolderPath) + public function setTempFolderPath(string $tempFolderPath) { $this->tempFolderPath = $tempFolderPath; return $this; @@ -426,8 +421,6 @@ public static function getDefaultConfiguration() * Sets the default configuration instance * * @param Configuration $config An instance of the Configuration Object - * - * @return void */ public static function setDefaultConfiguration(Configuration $config) { @@ -441,7 +434,7 @@ public static function setDefaultConfiguration(Configuration $config) */ public static function toDebugReport() { - $report = 'PHP SDK (Dropbox\Sign) Debug Report:' . PHP_EOL; + $report = 'PHP SDK (Dropbox\Sign) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' The version of the OpenAPI document: 3.0.0' . PHP_EOL; @@ -454,11 +447,11 @@ public static function toDebugReport() /** * Get API key (with prefix if set) * - * @param string $apiKeyIdentifier name of apikey + * @param string $apiKeyIdentifier name of apikey * - * @return null|string API key with the prefix + * @return string|null API key with the prefix */ - protected function getApiKeyWithPrefix($apiKeyIdentifier) + protected function getApiKeyWithPrefix(string $apiKeyIdentifier) { $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); $apiKey = $this->getApiKey($apiKeyIdentifier); @@ -485,21 +478,21 @@ public function getHostSettings() { return [ [ - "url" => "https://api.hellosign.com/v3", - "description" => "No description provided", - ] + 'url' => 'https://api.hellosign.com/v3', + '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 $hostSettings, $hostIndex, ?array $variables = null) + * 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 $hostSettings, int $hostIndex, ?array $variables = null) { if (null === $variables) { $variables = []; @@ -507,23 +500,23 @@ public static function getHostString(array $hostSettings, $hostIndex, ?array $va // check array index out of bound if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { - throw new \InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostSettings)); + throw new InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than " . count($hostSettings)); } $host = $hostSettings[$hostIndex]; - $url = $host["url"]; + $url = $host['url']; // go through variable and assign a value - foreach ($host["variables"] ?? [] as $name => $variable) { + 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); + 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"])."."); + 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); + $url = str_replace('{' . $name . '}', $variable['default_value'], $url); } } @@ -533,11 +526,11 @@ public static function getHostString(array $hostSettings, $hostIndex, ?array $va /** * 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 + * @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) + public function getHostFromSettings(int $index, ?array $variables = null) { return self::getHostString($this->getHostSettings(), $index, $variables); } @@ -551,8 +544,6 @@ public function setOptions(array $options): self /** * Get extra request options - * - * @return array */ public function getOptions(): array { diff --git a/sdks/php/src/EventCallbackHelper.php b/sdks/php/src/EventCallbackHelper.php index 8d8c4a20b..f15373332 100644 --- a/sdks/php/src/EventCallbackHelper.php +++ b/sdks/php/src/EventCallbackHelper.php @@ -1,14 +1,11 @@ selectJsonMimeList($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 + // 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); } /** - * Detects whether a string contains a valid JSON mime type - * - * @param string $searchString - * @return bool - */ + * Detects whether a string contains a valid JSON mime type + */ public function isJsonMime(string $searchString): bool { return preg_match('~^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)~', $searchString) === 1; } /** - * Select all items from a list containing a JSON mime type - * - * @param array $mimeList - * @return array - */ + * Select all items from a list containing a JSON mime type + */ private function selectJsonMimeList(array $mimeList): array { $jsonMimeList = []; @@ -125,15 +112,14 @@ private function selectJsonMimeList(array $mimeList): array return $jsonMimeList; } - /** - * 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") - */ + * 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 = [ @@ -143,7 +129,6 @@ private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headers ]; foreach ($accept as $header) { - $headerData = $this->getHeaderAndWeight($header); if (stripos($headerData['header'], 'application/json') === 0) { @@ -180,7 +165,7 @@ private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headers */ private function getHeaderAndWeight(string $header): array { - # matches headers with weight, splitting the header and the weight in $outputArray + // 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], @@ -197,9 +182,7 @@ private function getHeaderAndWeight(string $header): array } /** - * @param array[] $headers - * @param float $currentWeight - * @param bool $hasMoreThan28Headers + * @param array[] $headers * @return string[] array of adjusted "Accept" headers */ private function adjustWeight(array $headers, float &$currentWeight, bool $hasMoreThan28Headers): array @@ -224,11 +207,6 @@ private function adjustWeight(array $headers, float &$currentWeight, bool $hasMo return $acceptHeaders; } - /** - * @param string $header - * @param int $weight - * @return string - */ private function buildAcceptHeader(string $header, int $weight): string { if ($weight === 1000) { @@ -256,9 +234,7 @@ private function buildAcceptHeader(string $header, int $weight): string * 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 + * @param int $currentWeight varying from 1 to 1000 (will be divided by 1000 to build the quality value) */ public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): int { diff --git a/sdks/php/src/Model/AccountCreateRequest.php b/sdks/php/src/Model/AccountCreateRequest.php index 2fc6df0bf..7a4841477 100644 --- a/sdks/php/src/Model/AccountCreateRequest.php +++ b/sdks/php/src/Model/AccountCreateRequest.php @@ -1,14 +1,11 @@ */ -class AccountCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class AccountCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountCreateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'email_address' => 'string', 'client_id' => 'string', 'client_secret' => 'string', - 'locale' => 'string' + 'locale' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'email_address' => 'email', 'client_id' => null, 'client_secret' => null, - 'locale' => null + 'locale' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'email_address' => false, 'client_id' => false, 'client_secret' => false, - 'locale' => false + 'locale' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -120,8 +118,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -131,7 +127,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -141,7 +137,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -150,9 +146,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -161,9 +154,6 @@ 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 { @@ -180,7 +170,7 @@ public function isNullableSetToNull(string $property): bool 'email_address' => 'email_address', 'client_id' => 'client_id', 'client_secret' => 'client_secret', - 'locale' => 'locale' + 'locale' => 'locale', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool 'email_address' => 'setEmailAddress', 'client_id' => 'setClientId', 'client_secret' => 'setClientSecret', - 'locale' => 'setLocale' + 'locale' => 'setLocale', ]; /** @@ -204,7 +194,7 @@ public function isNullableSetToNull(string $property): bool 'email_address' => 'getEmailAddress', 'client_id' => 'getClientId', 'client_secret' => 'getClientSecret', - 'locale' => 'getLocale' + 'locale' => 'getLocale', ]; /** @@ -248,7 +238,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -260,7 +249,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -270,34 +259,33 @@ public function __construct(?array $data = null) $this->setIfExists('locale', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountCreateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountCreateRequest { /** @var AccountCreateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, AccountCreateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -333,7 +321,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets email_address * @@ -347,14 +334,14 @@ public function getEmailAddress() /** * Sets email_address * - * @param string $email_address The email address which will be associated with the new Account. + * @param string $email_address the email address which will be associated with the new Account * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -378,10 +365,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(?string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -405,10 +392,10 @@ public function getClientSecret() * * @return self */ - public function setClientSecret($client_secret) + public function setClientSecret(?string $client_secret) { if (is_null($client_secret)) { - throw new \InvalidArgumentException('non-nullable client_secret cannot be null'); + throw new InvalidArgumentException('non-nullable client_secret cannot be null'); } $this->container['client_secret'] = $client_secret; @@ -432,23 +419,22 @@ public function getLocale() * * @return self */ - public function setLocale($locale) + public function setLocale(?string $locale) { if (is_null($locale)) { - throw new \InvalidArgumentException('non-nullable locale cannot be null'); + throw new InvalidArgumentException('non-nullable locale cannot be null'); } $this->container['locale'] = $locale; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -457,11 +443,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -472,10 +458,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -488,11 +472,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -500,12 +482,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -534,5 +516,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/AccountCreateResponse.php b/sdks/php/src/Model/AccountCreateResponse.php index fc6f5752a..619bf49a3 100644 --- a/sdks/php/src/Model/AccountCreateResponse.php +++ b/sdks/php/src/Model/AccountCreateResponse.php @@ -1,14 +1,11 @@ */ -class AccountCreateResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class AccountCreateResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountCreateResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account' => '\Dropbox\Sign\Model\AccountResponse', 'oauth_data' => '\Dropbox\Sign\Model\OAuthTokenResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account' => null, 'oauth_data' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'account' => false, 'oauth_data' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'account' => 'account', 'oauth_data' => 'oauth_data', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'account' => 'setAccount', 'oauth_data' => 'setOauthData', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'account' => 'getAccount', 'oauth_data' => 'getOauthData', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -242,7 +232,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -254,7 +243,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -263,34 +252,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountCreateResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountCreateResponse { /** @var AccountCreateResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, AccountCreateResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -326,7 +314,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets account * @@ -344,10 +331,10 @@ public function getAccount() * * @return self */ - public function setAccount($account) + public function setAccount(AccountResponse $account) { if (is_null($account)) { - throw new \InvalidArgumentException('non-nullable account cannot be null'); + throw new InvalidArgumentException('non-nullable account cannot be null'); } $this->container['account'] = $account; @@ -371,10 +358,10 @@ public function getOauthData() * * @return self */ - public function setOauthData($oauth_data) + public function setOauthData(?OAuthTokenResponse $oauth_data) { if (is_null($oauth_data)) { - throw new \InvalidArgumentException('non-nullable oauth_data cannot be null'); + throw new InvalidArgumentException('non-nullable oauth_data cannot be null'); } $this->container['oauth_data'] = $oauth_data; @@ -394,27 +381,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -423,11 +409,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -438,10 +424,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -454,11 +438,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -466,12 +448,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -500,5 +482,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/AccountGetResponse.php b/sdks/php/src/Model/AccountGetResponse.php index 2b93cfbfe..5005bc421 100644 --- a/sdks/php/src/Model/AccountGetResponse.php +++ b/sdks/php/src/Model/AccountGetResponse.php @@ -1,14 +1,11 @@ */ -class AccountGetResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class AccountGetResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountGetResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account' => '\Dropbox\Sign\Model\AccountResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'account' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'account' => 'account', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'account' => 'setAccount', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'account' => 'getAccount', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountGetResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountGetResponse { /** @var AccountGetResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, AccountGetResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,7 +307,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets account * @@ -337,10 +324,10 @@ public function getAccount() * * @return self */ - public function setAccount($account) + public function setAccount(AccountResponse $account) { if (is_null($account)) { - throw new \InvalidArgumentException('non-nullable account cannot be null'); + throw new InvalidArgumentException('non-nullable account cannot be null'); } $this->container['account'] = $account; @@ -360,27 +347,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -389,11 +375,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -404,10 +390,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -420,11 +404,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -432,12 +414,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -466,5 +448,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/AccountResponse.php b/sdks/php/src/Model/AccountResponse.php index e92d69cb7..6c3370ef1 100644 --- a/sdks/php/src/Model/AccountResponse.php +++ b/sdks/php/src/Model/AccountResponse.php @@ -1,14 +1,11 @@ */ -class AccountResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class AccountResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account_id' => 'string', 'email_address' => 'string', @@ -69,16 +67,16 @@ class AccountResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'role_code' => 'string', 'team_id' => 'string', 'locale' => 'string', - 'usage' => '\Dropbox\Sign\Model\AccountResponseUsage' + 'usage' => '\Dropbox\Sign\Model\AccountResponseUsage', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account_id' => null, 'email_address' => null, @@ -90,14 +88,14 @@ class AccountResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'role_code' => null, 'team_id' => null, 'locale' => null, - 'usage' => null + 'usage' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'account_id' => false, 'email_address' => false, @@ -109,14 +107,14 @@ class AccountResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'role_code' => true, 'team_id' => true, 'locale' => true, - 'usage' => false + 'usage' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -141,8 +139,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -152,7 +148,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -162,7 +158,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -171,9 +167,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -182,9 +175,6 @@ 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 { @@ -208,7 +198,7 @@ public function isNullableSetToNull(string $property): bool 'role_code' => 'role_code', 'team_id' => 'team_id', 'locale' => 'locale', - 'usage' => 'usage' + 'usage' => 'usage', ]; /** @@ -227,7 +217,7 @@ public function isNullableSetToNull(string $property): bool 'role_code' => 'setRoleCode', 'team_id' => 'setTeamId', 'locale' => 'setLocale', - 'usage' => 'setUsage' + 'usage' => 'setUsage', ]; /** @@ -246,7 +236,7 @@ public function isNullableSetToNull(string $property): bool 'role_code' => 'getRoleCode', 'team_id' => 'getTeamId', 'locale' => 'getLocale', - 'usage' => 'getUsage' + 'usage' => 'getUsage', ]; /** @@ -290,7 +280,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -302,7 +291,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -319,34 +308,33 @@ public function __construct(?array $data = null) $this->setIfExists('usage', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountResponse { /** @var AccountResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, AccountResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -363,9 +351,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -379,7 +365,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets account_id * @@ -397,10 +382,10 @@ public function getAccountId() * * @return self */ - public function setAccountId($account_id) + public function setAccountId(?string $account_id) { if (is_null($account_id)) { - throw new \InvalidArgumentException('non-nullable account_id cannot be null'); + throw new InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -420,14 +405,14 @@ public function getEmailAddress() /** * Sets email_address * - * @param string|null $email_address The email address associated with the Account. + * @param string|null $email_address the email address associated with the Account * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(?string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -447,14 +432,14 @@ public function getIsLocked() /** * Sets is_locked * - * @param bool|null $is_locked Returns `true` if the user has been locked out of their account by a team admin. + * @param bool|null $is_locked returns `true` if the user has been locked out of their account by a team admin * * @return self */ - public function setIsLocked($is_locked) + public function setIsLocked(?bool $is_locked) { if (is_null($is_locked)) { - throw new \InvalidArgumentException('non-nullable is_locked cannot be null'); + throw new InvalidArgumentException('non-nullable is_locked cannot be null'); } $this->container['is_locked'] = $is_locked; @@ -474,14 +459,14 @@ public function getIsPaidHs() /** * Sets is_paid_hs * - * @param bool|null $is_paid_hs Returns `true` if the user has a paid Dropbox Sign account. + * @param bool|null $is_paid_hs returns `true` if the user has a paid Dropbox Sign account * * @return self */ - public function setIsPaidHs($is_paid_hs) + public function setIsPaidHs(?bool $is_paid_hs) { if (is_null($is_paid_hs)) { - throw new \InvalidArgumentException('non-nullable is_paid_hs cannot be null'); + throw new InvalidArgumentException('non-nullable is_paid_hs cannot be null'); } $this->container['is_paid_hs'] = $is_paid_hs; @@ -501,14 +486,14 @@ public function getIsPaidHf() /** * Sets is_paid_hf * - * @param bool|null $is_paid_hf Returns `true` if the user has a paid HelloFax account. + * @param bool|null $is_paid_hf returns `true` if the user has a paid HelloFax account * * @return self */ - public function setIsPaidHf($is_paid_hf) + public function setIsPaidHf(?bool $is_paid_hf) { if (is_null($is_paid_hf)) { - throw new \InvalidArgumentException('non-nullable is_paid_hf cannot be null'); + throw new InvalidArgumentException('non-nullable is_paid_hf cannot be null'); } $this->container['is_paid_hf'] = $is_paid_hf; @@ -532,10 +517,10 @@ public function getQuotas() * * @return self */ - public function setQuotas($quotas) + public function setQuotas(?AccountResponseQuotas $quotas) { if (is_null($quotas)) { - throw new \InvalidArgumentException('non-nullable quotas cannot be null'); + throw new InvalidArgumentException('non-nullable quotas cannot be null'); } $this->container['quotas'] = $quotas; @@ -555,17 +540,17 @@ public function getCallbackUrl() /** * Sets callback_url * - * @param string|null $callback_url The URL that Dropbox Sign events will `POST` to. + * @param string|null $callback_url the URL that Dropbox Sign events will `POST` to * * @return self */ - public function setCallbackUrl($callback_url) + public function setCallbackUrl(?string $callback_url) { if (is_null($callback_url)) { array_push($this->openAPINullablesSetToNull, 'callback_url'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('callback_url', $nullablesSetToNull, true); + $index = array_search('callback_url', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -589,17 +574,17 @@ public function getRoleCode() /** * Sets role_code * - * @param string|null $role_code The membership role for the team. + * @param string|null $role_code the membership role for the team * * @return self */ - public function setRoleCode($role_code) + public function setRoleCode(?string $role_code) { if (is_null($role_code)) { array_push($this->openAPINullablesSetToNull, 'role_code'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('role_code', $nullablesSetToNull, true); + $index = array_search('role_code', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -623,17 +608,17 @@ public function getTeamId() /** * Sets team_id * - * @param string|null $team_id The id of the team account belongs to. + * @param string|null $team_id the id of the team account belongs to * * @return self */ - public function setTeamId($team_id) + public function setTeamId(?string $team_id) { if (is_null($team_id)) { array_push($this->openAPINullablesSetToNull, 'team_id'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('team_id', $nullablesSetToNull, true); + $index = array_search('team_id', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -661,13 +646,13 @@ public function getLocale() * * @return self */ - public function setLocale($locale) + public function setLocale(?string $locale) { if (is_null($locale)) { array_push($this->openAPINullablesSetToNull, 'locale'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('locale', $nullablesSetToNull, true); + $index = array_search('locale', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -695,23 +680,22 @@ public function getUsage() * * @return self */ - public function setUsage($usage) + public function setUsage(?AccountResponseUsage $usage) { if (is_null($usage)) { - throw new \InvalidArgumentException('non-nullable usage cannot be null'); + throw new InvalidArgumentException('non-nullable usage cannot be null'); } $this->container['usage'] = $usage; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -720,11 +704,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -735,10 +719,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -751,11 +733,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -763,12 +743,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -797,5 +777,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/AccountResponseQuotas.php b/sdks/php/src/Model/AccountResponseQuotas.php index 1c752db2f..119733b99 100644 --- a/sdks/php/src/Model/AccountResponseQuotas.php +++ b/sdks/php/src/Model/AccountResponseQuotas.php @@ -1,14 +1,11 @@ */ -class AccountResponseQuotas implements ModelInterface, ArrayAccess, \JsonSerializable +class AccountResponseQuotas implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountResponseQuotas'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'api_signature_requests_left' => 'int', 'documents_left' => 'int', 'templates_total' => 'int', 'templates_left' => 'int', 'sms_verifications_left' => 'int', - 'num_fax_pages_left' => 'int' + 'num_fax_pages_left' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'api_signature_requests_left' => null, 'documents_left' => null, 'templates_total' => null, 'templates_left' => null, 'sms_verifications_left' => null, - 'num_fax_pages_left' => null + 'num_fax_pages_left' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'api_signature_requests_left' => true, 'documents_left' => true, 'templates_total' => true, 'templates_left' => true, 'sms_verifications_left' => true, - 'num_fax_pages_left' => true + 'num_fax_pages_left' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -127,8 +124,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -138,7 +133,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -148,7 +143,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -157,9 +152,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -168,9 +160,6 @@ 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 { @@ -189,7 +178,7 @@ public function isNullableSetToNull(string $property): bool 'templates_total' => 'templates_total', 'templates_left' => 'templates_left', 'sms_verifications_left' => 'sms_verifications_left', - 'num_fax_pages_left' => 'num_fax_pages_left' + 'num_fax_pages_left' => 'num_fax_pages_left', ]; /** @@ -203,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'templates_total' => 'setTemplatesTotal', 'templates_left' => 'setTemplatesLeft', 'sms_verifications_left' => 'setSmsVerificationsLeft', - 'num_fax_pages_left' => 'setNumFaxPagesLeft' + 'num_fax_pages_left' => 'setNumFaxPagesLeft', ]; /** @@ -217,7 +206,7 @@ public function isNullableSetToNull(string $property): bool 'templates_total' => 'getTemplatesTotal', 'templates_left' => 'getTemplatesLeft', 'sms_verifications_left' => 'getSmsVerificationsLeft', - 'num_fax_pages_left' => 'getNumFaxPagesLeft' + 'num_fax_pages_left' => 'getNumFaxPagesLeft', ]; /** @@ -261,7 +250,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -273,7 +261,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -285,34 +273,33 @@ public function __construct(?array $data = null) $this->setIfExists('num_fax_pages_left', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountResponseQuotas { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountResponseQuotas { /** @var AccountResponseQuotas */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, AccountResponseQuotas::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -329,9 +316,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -345,7 +330,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets api_signature_requests_left * @@ -359,17 +343,17 @@ public function getApiSignatureRequestsLeft() /** * Sets api_signature_requests_left * - * @param int|null $api_signature_requests_left API signature requests remaining. + * @param int|null $api_signature_requests_left API signature requests remaining * * @return self */ - public function setApiSignatureRequestsLeft($api_signature_requests_left) + public function setApiSignatureRequestsLeft(?int $api_signature_requests_left) { if (is_null($api_signature_requests_left)) { array_push($this->openAPINullablesSetToNull, 'api_signature_requests_left'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('api_signature_requests_left', $nullablesSetToNull, true); + $index = array_search('api_signature_requests_left', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -393,17 +377,17 @@ public function getDocumentsLeft() /** * Sets documents_left * - * @param int|null $documents_left Signature requests remaining. + * @param int|null $documents_left signature requests remaining * * @return self */ - public function setDocumentsLeft($documents_left) + public function setDocumentsLeft(?int $documents_left) { if (is_null($documents_left)) { array_push($this->openAPINullablesSetToNull, 'documents_left'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('documents_left', $nullablesSetToNull, true); + $index = array_search('documents_left', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -427,17 +411,17 @@ public function getTemplatesTotal() /** * Sets templates_total * - * @param int|null $templates_total Total API templates allowed. + * @param int|null $templates_total total API templates allowed * * @return self */ - public function setTemplatesTotal($templates_total) + public function setTemplatesTotal(?int $templates_total) { if (is_null($templates_total)) { array_push($this->openAPINullablesSetToNull, 'templates_total'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('templates_total', $nullablesSetToNull, true); + $index = array_search('templates_total', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -461,17 +445,17 @@ public function getTemplatesLeft() /** * Sets templates_left * - * @param int|null $templates_left API templates remaining. + * @param int|null $templates_left API templates remaining * * @return self */ - public function setTemplatesLeft($templates_left) + public function setTemplatesLeft(?int $templates_left) { if (is_null($templates_left)) { array_push($this->openAPINullablesSetToNull, 'templates_left'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('templates_left', $nullablesSetToNull, true); + $index = array_search('templates_left', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -495,17 +479,17 @@ public function getSmsVerificationsLeft() /** * Sets sms_verifications_left * - * @param int|null $sms_verifications_left SMS verifications remaining. + * @param int|null $sms_verifications_left SMS verifications remaining * * @return self */ - public function setSmsVerificationsLeft($sms_verifications_left) + public function setSmsVerificationsLeft(?int $sms_verifications_left) { if (is_null($sms_verifications_left)) { array_push($this->openAPINullablesSetToNull, 'sms_verifications_left'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('sms_verifications_left', $nullablesSetToNull, true); + $index = array_search('sms_verifications_left', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -533,13 +517,13 @@ public function getNumFaxPagesLeft() * * @return self */ - public function setNumFaxPagesLeft($num_fax_pages_left) + public function setNumFaxPagesLeft(?int $num_fax_pages_left) { if (is_null($num_fax_pages_left)) { array_push($this->openAPINullablesSetToNull, 'num_fax_pages_left'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('num_fax_pages_left', $nullablesSetToNull, true); + $index = array_search('num_fax_pages_left', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -549,14 +533,13 @@ public function setNumFaxPagesLeft($num_fax_pages_left) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -565,11 +548,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -580,10 +563,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -596,11 +577,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -608,12 +587,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -642,5 +621,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/AccountResponseUsage.php b/sdks/php/src/Model/AccountResponseUsage.php index 896b69a0f..90cb9bb1c 100644 --- a/sdks/php/src/Model/AccountResponseUsage.php +++ b/sdks/php/src/Model/AccountResponseUsage.php @@ -1,14 +1,11 @@ */ -class AccountResponseUsage implements ModelInterface, ArrayAccess, \JsonSerializable +class AccountResponseUsage implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountResponseUsage'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'fax_pages_sent' => 'int' + 'fax_pages_sent' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'fax_pages_sent' => null + 'fax_pages_sent' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'fax_pages_sent' => true + 'fax_pages_sent' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,8 +109,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -123,7 +118,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -133,7 +128,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -142,9 +137,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -153,9 +145,6 @@ 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 { @@ -169,7 +158,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'fax_pages_sent' => 'fax_pages_sent' + 'fax_pages_sent' => 'fax_pages_sent', ]; /** @@ -178,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'fax_pages_sent' => 'setFaxPagesSent' + 'fax_pages_sent' => 'setFaxPagesSent', ]; /** @@ -187,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'fax_pages_sent' => 'getFaxPagesSent' + 'fax_pages_sent' => 'getFaxPagesSent', ]; /** @@ -231,7 +220,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -243,41 +231,40 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { $this->setIfExists('fax_pages_sent', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountResponseUsage { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountResponseUsage { /** @var AccountResponseUsage */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, AccountResponseUsage::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,9 +281,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -310,7 +295,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets fax_pages_sent * @@ -328,13 +312,13 @@ public function getFaxPagesSent() * * @return self */ - public function setFaxPagesSent($fax_pages_sent) + public function setFaxPagesSent(?int $fax_pages_sent) { if (is_null($fax_pages_sent)) { array_push($this->openAPINullablesSetToNull, 'fax_pages_sent'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('fax_pages_sent', $nullablesSetToNull, true); + $index = array_search('fax_pages_sent', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -344,14 +328,13 @@ public function setFaxPagesSent($fax_pages_sent) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -360,11 +343,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -375,10 +358,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -391,11 +372,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -403,12 +382,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -437,5 +416,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/AccountUpdateRequest.php b/sdks/php/src/Model/AccountUpdateRequest.php index dbc433b2e..cc7e7df52 100644 --- a/sdks/php/src/Model/AccountUpdateRequest.php +++ b/sdks/php/src/Model/AccountUpdateRequest.php @@ -1,14 +1,11 @@ */ -class AccountUpdateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class AccountUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountUpdateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account_id' => 'string', 'callback_url' => 'string', - 'locale' => 'string' + 'locale' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account_id' => null, 'callback_url' => null, - 'locale' => null + 'locale' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'account_id' => true, 'callback_url' => false, - 'locale' => false + 'locale' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'account_id' => 'account_id', 'callback_url' => 'callback_url', - 'locale' => 'locale' + 'locale' => 'locale', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'account_id' => 'setAccountId', 'callback_url' => 'setCallbackUrl', - 'locale' => 'setLocale' + 'locale' => 'setLocale', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'account_id' => 'getAccountId', 'callback_url' => 'getCallbackUrl', - 'locale' => 'getLocale' + 'locale' => 'getLocale', ]; /** @@ -242,7 +232,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -254,7 +243,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -263,34 +252,33 @@ public function __construct(?array $data = null) $this->setIfExists('locale', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountUpdateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountUpdateRequest { /** @var AccountUpdateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, AccountUpdateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,9 +295,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -323,7 +309,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets account_id * @@ -341,13 +326,13 @@ public function getAccountId() * * @return self */ - public function setAccountId($account_id) + public function setAccountId(?string $account_id) { if (is_null($account_id)) { array_push($this->openAPINullablesSetToNull, 'account_id'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('account_id', $nullablesSetToNull, true); + $index = array_search('account_id', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -371,14 +356,14 @@ public function getCallbackUrl() /** * Sets callback_url * - * @param string|null $callback_url The URL that Dropbox Sign should POST events to. + * @param string|null $callback_url the URL that Dropbox Sign should POST events to * * @return self */ - public function setCallbackUrl($callback_url) + public function setCallbackUrl(?string $callback_url) { if (is_null($callback_url)) { - throw new \InvalidArgumentException('non-nullable callback_url cannot be null'); + throw new InvalidArgumentException('non-nullable callback_url cannot be null'); } $this->container['callback_url'] = $callback_url; @@ -402,23 +387,22 @@ public function getLocale() * * @return self */ - public function setLocale($locale) + public function setLocale(?string $locale) { if (is_null($locale)) { - throw new \InvalidArgumentException('non-nullable locale cannot be null'); + throw new InvalidArgumentException('non-nullable locale cannot be null'); } $this->container['locale'] = $locale; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -427,11 +411,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -442,10 +426,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -458,11 +440,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -470,12 +450,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -504,5 +484,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/AccountVerifyRequest.php b/sdks/php/src/Model/AccountVerifyRequest.php index 5451b6068..8383f6599 100644 --- a/sdks/php/src/Model/AccountVerifyRequest.php +++ b/sdks/php/src/Model/AccountVerifyRequest.php @@ -1,14 +1,11 @@ */ -class AccountVerifyRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class AccountVerifyRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountVerifyRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'email_address' => 'string' + 'email_address' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'email_address' => 'email' + 'email_address' => 'email', ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'email_address' => false + 'email_address' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,8 +109,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -122,7 +118,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +128,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,9 +137,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -152,9 +145,6 @@ 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 { @@ -168,7 +158,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'email_address' => 'email_address' + 'email_address' => 'email_address', ]; /** @@ -177,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'email_address' => 'setEmailAddress' + 'email_address' => 'setEmailAddress', ]; /** @@ -186,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'email_address' => 'getEmailAddress' + 'email_address' => 'getEmailAddress', ]; /** @@ -230,7 +220,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -242,41 +231,40 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { $this->setIfExists('email_address', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountVerifyRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountVerifyRequest { /** @var AccountVerifyRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, AccountVerifyRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -312,7 +300,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets email_address * @@ -326,27 +313,26 @@ public function getEmailAddress() /** * Sets email_address * - * @param string $email_address Email address to run the verification for. + * @param string $email_address email address to run the verification for * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -355,11 +341,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -370,10 +356,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -386,11 +370,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -398,12 +380,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -432,5 +414,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/AccountVerifyResponse.php b/sdks/php/src/Model/AccountVerifyResponse.php index 351b0dfcd..359be63d7 100644 --- a/sdks/php/src/Model/AccountVerifyResponse.php +++ b/sdks/php/src/Model/AccountVerifyResponse.php @@ -1,14 +1,11 @@ */ -class AccountVerifyResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class AccountVerifyResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountVerifyResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account' => '\Dropbox\Sign\Model\AccountVerifyResponseAccount', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'account' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'account' => 'account', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'account' => 'setAccount', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'account' => 'getAccount', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountVerifyResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountVerifyResponse { /** @var AccountVerifyResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, AccountVerifyResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -300,9 +288,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -316,7 +302,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets account * @@ -334,10 +319,10 @@ public function getAccount() * * @return self */ - public function setAccount($account) + public function setAccount(?AccountVerifyResponseAccount $account) { if (is_null($account)) { - throw new \InvalidArgumentException('non-nullable account cannot be null'); + throw new InvalidArgumentException('non-nullable account cannot be null'); } $this->container['account'] = $account; @@ -357,27 +342,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -386,11 +370,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -401,10 +385,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -417,11 +399,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -429,12 +409,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -463,5 +443,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/AccountVerifyResponseAccount.php b/sdks/php/src/Model/AccountVerifyResponseAccount.php index c03652637..2c4bf22b3 100644 --- a/sdks/php/src/Model/AccountVerifyResponseAccount.php +++ b/sdks/php/src/Model/AccountVerifyResponseAccount.php @@ -1,14 +1,11 @@ */ -class AccountVerifyResponseAccount implements ModelInterface, ArrayAccess, \JsonSerializable +class AccountVerifyResponseAccount implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountVerifyResponseAccount'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'email_address' => 'string' + 'email_address' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'email_address' => null + 'email_address' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'email_address' => false + 'email_address' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,8 +109,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -122,7 +118,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +128,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,9 +137,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -152,9 +145,6 @@ 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 { @@ -168,7 +158,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'email_address' => 'email_address' + 'email_address' => 'email_address', ]; /** @@ -177,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'email_address' => 'setEmailAddress' + 'email_address' => 'setEmailAddress', ]; /** @@ -186,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'email_address' => 'getEmailAddress' + 'email_address' => 'getEmailAddress', ]; /** @@ -230,7 +220,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -242,41 +231,40 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { $this->setIfExists('email_address', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountVerifyResponseAccount { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountVerifyResponseAccount { /** @var AccountVerifyResponseAccount */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, AccountVerifyResponseAccount::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -293,9 +281,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -309,7 +295,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets email_address * @@ -323,27 +308,26 @@ public function getEmailAddress() /** * Sets email_address * - * @param string|null $email_address The email address associated with the Account. + * @param string|null $email_address the email address associated with the Account * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(?string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -352,11 +336,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -367,10 +351,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -383,11 +365,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -395,12 +375,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -429,5 +409,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/ApiAppCreateRequest.php b/sdks/php/src/Model/ApiAppCreateRequest.php index 66d1ae727..c6d0cc9a9 100644 --- a/sdks/php/src/Model/ApiAppCreateRequest.php +++ b/sdks/php/src/Model/ApiAppCreateRequest.php @@ -1,14 +1,11 @@ */ -class ApiAppCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class ApiAppCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiAppCreateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'domains' => 'string[]', 'name' => 'string', @@ -65,16 +64,16 @@ class ApiAppCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializa 'custom_logo_file' => '\SplFileObject', 'oauth' => '\Dropbox\Sign\Model\SubOAuth', 'options' => '\Dropbox\Sign\Model\SubOptions', - 'white_labeling_options' => '\Dropbox\Sign\Model\SubWhiteLabelingOptions' + 'white_labeling_options' => '\Dropbox\Sign\Model\SubWhiteLabelingOptions', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'domains' => null, 'name' => null, @@ -82,14 +81,14 @@ class ApiAppCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializa 'custom_logo_file' => 'binary', 'oauth' => null, 'options' => null, - 'white_labeling_options' => null + 'white_labeling_options' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'domains' => false, 'name' => false, @@ -97,14 +96,14 @@ class ApiAppCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializa 'custom_logo_file' => false, 'oauth' => false, 'options' => false, - 'white_labeling_options' => false + 'white_labeling_options' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -129,8 +128,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -140,7 +137,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -150,7 +147,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -159,9 +156,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -170,9 +164,6 @@ 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 { @@ -192,7 +183,7 @@ public function isNullableSetToNull(string $property): bool 'custom_logo_file' => 'custom_logo_file', 'oauth' => 'oauth', 'options' => 'options', - 'white_labeling_options' => 'white_labeling_options' + 'white_labeling_options' => 'white_labeling_options', ]; /** @@ -207,7 +198,7 @@ public function isNullableSetToNull(string $property): bool 'custom_logo_file' => 'setCustomLogoFile', 'oauth' => 'setOauth', 'options' => 'setOptions', - 'white_labeling_options' => 'setWhiteLabelingOptions' + 'white_labeling_options' => 'setWhiteLabelingOptions', ]; /** @@ -222,7 +213,7 @@ public function isNullableSetToNull(string $property): bool 'custom_logo_file' => 'getCustomLogoFile', 'oauth' => 'getOauth', 'options' => 'getOptions', - 'white_labeling_options' => 'getWhiteLabelingOptions' + 'white_labeling_options' => 'getWhiteLabelingOptions', ]; /** @@ -266,7 +257,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -278,7 +268,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -291,34 +281,33 @@ public function __construct(?array $data = null) $this->setIfExists('white_labeling_options', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ApiAppCreateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ApiAppCreateRequest { /** @var ApiAppCreateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, ApiAppCreateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -340,11 +329,11 @@ public function listInvalidProperties() if ($this->container['domains'] === null) { $invalidProperties[] = "'domains' can't be null"; } - if ((count($this->container['domains']) > 2)) { + if (count($this->container['domains']) > 2) { $invalidProperties[] = "invalid value for 'domains', number of items must be less than or equal to 2."; } - if ((count($this->container['domains']) < 1)) { + if (count($this->container['domains']) < 1) { $invalidProperties[] = "invalid value for 'domains', number of items must be greater than or equal to 1."; } @@ -365,7 +354,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets domains * @@ -379,21 +367,21 @@ public function getDomains() /** * Sets domains * - * @param string[] $domains The domain names the ApiApp will be associated with. + * @param string[] $domains the domain names the ApiApp will be associated with * * @return self */ - public function setDomains($domains) + public function setDomains(array $domains) { if (is_null($domains)) { - throw new \InvalidArgumentException('non-nullable domains cannot be null'); + throw new InvalidArgumentException('non-nullable domains cannot be null'); } - if ((count($domains) > 2)) { - throw new \InvalidArgumentException('invalid value for $domains when calling ApiAppCreateRequest., number of items must be less than or equal to 2.'); + if (count($domains) > 2) { + throw new InvalidArgumentException('invalid value for $domains when calling ApiAppCreateRequest., number of items must be less than or equal to 2.'); } - if ((count($domains) < 1)) { - throw new \InvalidArgumentException('invalid length for $domains when calling ApiAppCreateRequest., number of items must be greater than or equal to 1.'); + if (count($domains) < 1) { + throw new InvalidArgumentException('invalid length for $domains when calling ApiAppCreateRequest., number of items must be greater than or equal to 1.'); } $this->container['domains'] = $domains; @@ -413,14 +401,14 @@ public function getName() /** * Sets name * - * @param string $name The name you want to assign to the ApiApp. + * @param string $name the name you want to assign to the ApiApp * * @return self */ - public function setName($name) + public function setName(string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -440,14 +428,14 @@ public function getCallbackUrl() /** * Sets callback_url * - * @param string|null $callback_url The URL at which the ApiApp should receive event callbacks. + * @param string|null $callback_url the URL at which the ApiApp should receive event callbacks * * @return self */ - public function setCallbackUrl($callback_url) + public function setCallbackUrl(?string $callback_url) { if (is_null($callback_url)) { - throw new \InvalidArgumentException('non-nullable callback_url cannot be null'); + throw new InvalidArgumentException('non-nullable callback_url cannot be null'); } $this->container['callback_url'] = $callback_url; @@ -457,7 +445,7 @@ public function setCallbackUrl($callback_url) /** * Gets custom_logo_file * - * @return \SplFileObject|null + * @return SplFileObject|null */ public function getCustomLogoFile() { @@ -467,14 +455,14 @@ public function getCustomLogoFile() /** * Sets custom_logo_file * - * @param \SplFileObject|null $custom_logo_file An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) + * @param SplFileObject|null $custom_logo_file An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) * * @return self */ - public function setCustomLogoFile($custom_logo_file) + public function setCustomLogoFile(?SplFileObject $custom_logo_file) { if (is_null($custom_logo_file)) { - throw new \InvalidArgumentException('non-nullable custom_logo_file cannot be null'); + throw new InvalidArgumentException('non-nullable custom_logo_file cannot be null'); } $this->container['custom_logo_file'] = $custom_logo_file; @@ -498,10 +486,10 @@ public function getOauth() * * @return self */ - public function setOauth($oauth) + public function setOauth(?SubOAuth $oauth) { if (is_null($oauth)) { - throw new \InvalidArgumentException('non-nullable oauth cannot be null'); + throw new InvalidArgumentException('non-nullable oauth cannot be null'); } $this->container['oauth'] = $oauth; @@ -525,10 +513,10 @@ public function getOptions() * * @return self */ - public function setOptions($options) + public function setOptions(?SubOptions $options) { if (is_null($options)) { - throw new \InvalidArgumentException('non-nullable options cannot be null'); + throw new InvalidArgumentException('non-nullable options cannot be null'); } $this->container['options'] = $options; @@ -552,23 +540,22 @@ public function getWhiteLabelingOptions() * * @return self */ - public function setWhiteLabelingOptions($white_labeling_options) + public function setWhiteLabelingOptions(?SubWhiteLabelingOptions $white_labeling_options) { if (is_null($white_labeling_options)) { - throw new \InvalidArgumentException('non-nullable white_labeling_options cannot be null'); + throw new InvalidArgumentException('non-nullable white_labeling_options cannot be null'); } $this->container['white_labeling_options'] = $white_labeling_options; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -577,11 +564,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -592,10 +579,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -608,11 +593,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -620,12 +603,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -654,5 +637,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/ApiAppGetResponse.php b/sdks/php/src/Model/ApiAppGetResponse.php index 8e8320af8..3d9dc5d0a 100644 --- a/sdks/php/src/Model/ApiAppGetResponse.php +++ b/sdks/php/src/Model/ApiAppGetResponse.php @@ -1,14 +1,11 @@ */ -class ApiAppGetResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class ApiAppGetResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiAppGetResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'api_app' => '\Dropbox\Sign\Model\ApiAppResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'api_app' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'api_app' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'api_app' => 'api_app', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'api_app' => 'setApiApp', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'api_app' => 'getApiApp', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ApiAppGetResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ApiAppGetResponse { /** @var ApiAppGetResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, ApiAppGetResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,7 +307,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets api_app * @@ -337,10 +324,10 @@ public function getApiApp() * * @return self */ - public function setApiApp($api_app) + public function setApiApp(ApiAppResponse $api_app) { if (is_null($api_app)) { - throw new \InvalidArgumentException('non-nullable api_app cannot be null'); + throw new InvalidArgumentException('non-nullable api_app cannot be null'); } $this->container['api_app'] = $api_app; @@ -360,27 +347,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -389,11 +375,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -404,10 +390,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -420,11 +404,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -432,12 +414,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -466,5 +448,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/ApiAppListResponse.php b/sdks/php/src/Model/ApiAppListResponse.php index b062e12d7..02e2483e9 100644 --- a/sdks/php/src/Model/ApiAppListResponse.php +++ b/sdks/php/src/Model/ApiAppListResponse.php @@ -1,14 +1,11 @@ */ -class ApiAppListResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class ApiAppListResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiAppListResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'api_apps' => '\Dropbox\Sign\Model\ApiAppResponse[]', 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'api_apps' => null, 'list_info' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'api_apps' => false, 'list_info' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'api_apps' => 'api_apps', 'list_info' => 'list_info', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'api_apps' => 'setApiApps', 'list_info' => 'setListInfo', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'api_apps' => 'getApiApps', 'list_info' => 'getListInfo', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -242,7 +232,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -254,7 +243,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -263,34 +252,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ApiAppListResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ApiAppListResponse { /** @var ApiAppListResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, ApiAppListResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -329,7 +317,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets api_apps * @@ -343,14 +330,14 @@ public function getApiApps() /** * Sets api_apps * - * @param ApiAppResponse[] $api_apps Contains information about API Apps. + * @param ApiAppResponse[] $api_apps contains information about API Apps * * @return self */ - public function setApiApps($api_apps) + public function setApiApps(array $api_apps) { if (is_null($api_apps)) { - throw new \InvalidArgumentException('non-nullable api_apps cannot be null'); + throw new InvalidArgumentException('non-nullable api_apps cannot be null'); } $this->container['api_apps'] = $api_apps; @@ -374,10 +361,10 @@ public function getListInfo() * * @return self */ - public function setListInfo($list_info) + public function setListInfo(ListInfoResponse $list_info) { if (is_null($list_info)) { - throw new \InvalidArgumentException('non-nullable list_info cannot be null'); + throw new InvalidArgumentException('non-nullable list_info cannot be null'); } $this->container['list_info'] = $list_info; @@ -397,27 +384,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -426,11 +412,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -441,10 +427,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -457,11 +441,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -469,12 +451,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -503,5 +485,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/ApiAppResponse.php b/sdks/php/src/Model/ApiAppResponse.php index e43961965..c283d86fb 100644 --- a/sdks/php/src/Model/ApiAppResponse.php +++ b/sdks/php/src/Model/ApiAppResponse.php @@ -1,14 +1,11 @@ */ -class ApiAppResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class ApiAppResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiAppResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'callback_url' => 'string', 'client_id' => 'string', @@ -69,16 +67,16 @@ class ApiAppResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'oauth' => '\Dropbox\Sign\Model\ApiAppResponseOAuth', 'options' => '\Dropbox\Sign\Model\ApiAppResponseOptions', 'owner_account' => '\Dropbox\Sign\Model\ApiAppResponseOwnerAccount', - 'white_labeling_options' => '\Dropbox\Sign\Model\ApiAppResponseWhiteLabelingOptions' + 'white_labeling_options' => '\Dropbox\Sign\Model\ApiAppResponseWhiteLabelingOptions', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'callback_url' => null, 'client_id' => null, @@ -89,14 +87,14 @@ class ApiAppResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'oauth' => null, 'options' => null, 'owner_account' => null, - 'white_labeling_options' => null + 'white_labeling_options' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'callback_url' => true, 'client_id' => false, @@ -107,14 +105,14 @@ class ApiAppResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'oauth' => true, 'options' => true, 'owner_account' => false, - 'white_labeling_options' => true + 'white_labeling_options' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -139,8 +137,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -150,7 +146,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -160,7 +156,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -169,9 +165,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -180,9 +173,6 @@ 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 { @@ -205,7 +195,7 @@ public function isNullableSetToNull(string $property): bool 'oauth' => 'oauth', 'options' => 'options', 'owner_account' => 'owner_account', - 'white_labeling_options' => 'white_labeling_options' + 'white_labeling_options' => 'white_labeling_options', ]; /** @@ -223,7 +213,7 @@ public function isNullableSetToNull(string $property): bool 'oauth' => 'setOauth', 'options' => 'setOptions', 'owner_account' => 'setOwnerAccount', - 'white_labeling_options' => 'setWhiteLabelingOptions' + 'white_labeling_options' => 'setWhiteLabelingOptions', ]; /** @@ -241,7 +231,7 @@ public function isNullableSetToNull(string $property): bool 'oauth' => 'getOauth', 'options' => 'getOptions', 'owner_account' => 'getOwnerAccount', - 'white_labeling_options' => 'getWhiteLabelingOptions' + 'white_labeling_options' => 'getWhiteLabelingOptions', ]; /** @@ -285,7 +275,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -297,7 +286,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -313,34 +302,33 @@ public function __construct(?array $data = null) $this->setIfExists('white_labeling_options', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ApiAppResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ApiAppResponse { /** @var ApiAppResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, ApiAppResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -357,9 +345,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -373,7 +359,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets callback_url * @@ -391,13 +376,13 @@ public function getCallbackUrl() * * @return self */ - public function setCallbackUrl($callback_url) + public function setCallbackUrl(?string $callback_url) { if (is_null($callback_url)) { array_push($this->openAPINullablesSetToNull, 'callback_url'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('callback_url', $nullablesSetToNull, true); + $index = array_search('callback_url', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -425,10 +410,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(?string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -452,10 +437,10 @@ public function getCreatedAt() * * @return self */ - public function setCreatedAt($created_at) + public function setCreatedAt(?int $created_at) { if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + throw new InvalidArgumentException('non-nullable created_at cannot be null'); } $this->container['created_at'] = $created_at; @@ -479,10 +464,10 @@ public function getDomains() * * @return self */ - public function setDomains($domains) + public function setDomains(?array $domains) { if (is_null($domains)) { - throw new \InvalidArgumentException('non-nullable domains cannot be null'); + throw new InvalidArgumentException('non-nullable domains cannot be null'); } $this->container['domains'] = $domains; @@ -506,10 +491,10 @@ public function getName() * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -533,10 +518,10 @@ public function getIsApproved() * * @return self */ - public function setIsApproved($is_approved) + public function setIsApproved(?bool $is_approved) { if (is_null($is_approved)) { - throw new \InvalidArgumentException('non-nullable is_approved cannot be null'); + throw new InvalidArgumentException('non-nullable is_approved cannot be null'); } $this->container['is_approved'] = $is_approved; @@ -560,13 +545,13 @@ public function getOauth() * * @return self */ - public function setOauth($oauth) + public function setOauth(?ApiAppResponseOAuth $oauth) { if (is_null($oauth)) { array_push($this->openAPINullablesSetToNull, 'oauth'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('oauth', $nullablesSetToNull, true); + $index = array_search('oauth', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -594,13 +579,13 @@ public function getOptions() * * @return self */ - public function setOptions($options) + public function setOptions(?ApiAppResponseOptions $options) { if (is_null($options)) { array_push($this->openAPINullablesSetToNull, 'options'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('options', $nullablesSetToNull, true); + $index = array_search('options', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -628,10 +613,10 @@ public function getOwnerAccount() * * @return self */ - public function setOwnerAccount($owner_account) + public function setOwnerAccount(?ApiAppResponseOwnerAccount $owner_account) { if (is_null($owner_account)) { - throw new \InvalidArgumentException('non-nullable owner_account cannot be null'); + throw new InvalidArgumentException('non-nullable owner_account cannot be null'); } $this->container['owner_account'] = $owner_account; @@ -655,13 +640,13 @@ public function getWhiteLabelingOptions() * * @return self */ - public function setWhiteLabelingOptions($white_labeling_options) + public function setWhiteLabelingOptions(?ApiAppResponseWhiteLabelingOptions $white_labeling_options) { if (is_null($white_labeling_options)) { array_push($this->openAPINullablesSetToNull, 'white_labeling_options'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('white_labeling_options', $nullablesSetToNull, true); + $index = array_search('white_labeling_options', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -671,14 +656,13 @@ public function setWhiteLabelingOptions($white_labeling_options) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -687,11 +671,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -702,10 +686,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -718,11 +700,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -730,12 +710,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -764,5 +744,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/ApiAppResponseOAuth.php b/sdks/php/src/Model/ApiAppResponseOAuth.php index 2e654a1ea..6c84b43c6 100644 --- a/sdks/php/src/Model/ApiAppResponseOAuth.php +++ b/sdks/php/src/Model/ApiAppResponseOAuth.php @@ -1,14 +1,11 @@ */ -class ApiAppResponseOAuth implements ModelInterface, ArrayAccess, \JsonSerializable +class ApiAppResponseOAuth implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiAppResponseOAuth'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'callback_url' => 'string', 'secret' => 'string', 'scopes' => 'string[]', - 'charges_users' => 'bool' + 'charges_users' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'callback_url' => null, 'secret' => null, 'scopes' => null, - 'charges_users' => null + 'charges_users' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'callback_url' => false, 'secret' => true, 'scopes' => false, - 'charges_users' => false + 'charges_users' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -121,8 +119,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -132,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -142,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -151,9 +147,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -162,9 +155,6 @@ 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 { @@ -181,7 +171,7 @@ public function isNullableSetToNull(string $property): bool 'callback_url' => 'callback_url', 'secret' => 'secret', 'scopes' => 'scopes', - 'charges_users' => 'charges_users' + 'charges_users' => 'charges_users', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool 'callback_url' => 'setCallbackUrl', 'secret' => 'setSecret', 'scopes' => 'setScopes', - 'charges_users' => 'setChargesUsers' + 'charges_users' => 'setChargesUsers', ]; /** @@ -205,7 +195,7 @@ public function isNullableSetToNull(string $property): bool 'callback_url' => 'getCallbackUrl', 'secret' => 'getSecret', 'scopes' => 'getScopes', - 'charges_users' => 'getChargesUsers' + 'charges_users' => 'getChargesUsers', ]; /** @@ -249,7 +239,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -261,7 +250,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -271,34 +260,33 @@ public function __construct(?array $data = null) $this->setIfExists('charges_users', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ApiAppResponseOAuth { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ApiAppResponseOAuth { /** @var ApiAppResponseOAuth */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, ApiAppResponseOAuth::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -315,9 +303,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -331,7 +317,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets callback_url * @@ -345,14 +330,14 @@ public function getCallbackUrl() /** * Sets callback_url * - * @param string|null $callback_url The app's OAuth callback URL. + * @param string|null $callback_url the app's OAuth callback URL * * @return self */ - public function setCallbackUrl($callback_url) + public function setCallbackUrl(?string $callback_url) { if (is_null($callback_url)) { - throw new \InvalidArgumentException('non-nullable callback_url cannot be null'); + throw new InvalidArgumentException('non-nullable callback_url cannot be null'); } $this->container['callback_url'] = $callback_url; @@ -372,17 +357,17 @@ public function getSecret() /** * Sets secret * - * @param string|null $secret The app's OAuth secret, or null if the app does not belong to user. + * @param string|null $secret the app's OAuth secret, or null if the app does not belong to user * * @return self */ - public function setSecret($secret) + public function setSecret(?string $secret) { if (is_null($secret)) { array_push($this->openAPINullablesSetToNull, 'secret'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('secret', $nullablesSetToNull, true); + $index = array_search('secret', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -406,14 +391,14 @@ public function getScopes() /** * Sets scopes * - * @param string[]|null $scopes Array of OAuth scopes used by the app. + * @param string[]|null $scopes array of OAuth scopes used by the app * * @return self */ - public function setScopes($scopes) + public function setScopes(?array $scopes) { if (is_null($scopes)) { - throw new \InvalidArgumentException('non-nullable scopes cannot be null'); + throw new InvalidArgumentException('non-nullable scopes cannot be null'); } $this->container['scopes'] = $scopes; @@ -433,27 +418,26 @@ public function getChargesUsers() /** * Sets charges_users * - * @param bool|null $charges_users Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests. + * @param bool|null $charges_users boolean indicating whether the app owner or the account granting permission is billed for OAuth requests * * @return self */ - public function setChargesUsers($charges_users) + public function setChargesUsers(?bool $charges_users) { if (is_null($charges_users)) { - throw new \InvalidArgumentException('non-nullable charges_users cannot be null'); + throw new InvalidArgumentException('non-nullable charges_users cannot be null'); } $this->container['charges_users'] = $charges_users; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -462,11 +446,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -477,10 +461,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -493,11 +475,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -505,12 +485,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -539,5 +519,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/ApiAppResponseOptions.php b/sdks/php/src/Model/ApiAppResponseOptions.php index df731ad3e..46466cb77 100644 --- a/sdks/php/src/Model/ApiAppResponseOptions.php +++ b/sdks/php/src/Model/ApiAppResponseOptions.php @@ -1,14 +1,11 @@ */ -class ApiAppResponseOptions implements ModelInterface, ArrayAccess, \JsonSerializable +class ApiAppResponseOptions implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiAppResponseOptions'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'can_insert_everywhere' => 'bool' + 'can_insert_everywhere' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'can_insert_everywhere' => null + 'can_insert_everywhere' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'can_insert_everywhere' => false + 'can_insert_everywhere' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,8 +110,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -123,7 +119,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -133,7 +129,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -142,9 +138,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -153,9 +146,6 @@ 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 { @@ -169,7 +159,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'can_insert_everywhere' => 'can_insert_everywhere' + 'can_insert_everywhere' => 'can_insert_everywhere', ]; /** @@ -178,7 +168,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'can_insert_everywhere' => 'setCanInsertEverywhere' + 'can_insert_everywhere' => 'setCanInsertEverywhere', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'can_insert_everywhere' => 'getCanInsertEverywhere' + 'can_insert_everywhere' => 'getCanInsertEverywhere', ]; /** @@ -231,7 +221,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -243,41 +232,40 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { $this->setIfExists('can_insert_everywhere', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ApiAppResponseOptions { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ApiAppResponseOptions { /** @var ApiAppResponseOptions */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, ApiAppResponseOptions::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,9 +282,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -310,7 +296,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets can_insert_everywhere * @@ -328,23 +313,22 @@ public function getCanInsertEverywhere() * * @return self */ - public function setCanInsertEverywhere($can_insert_everywhere) + public function setCanInsertEverywhere(?bool $can_insert_everywhere) { if (is_null($can_insert_everywhere)) { - throw new \InvalidArgumentException('non-nullable can_insert_everywhere cannot be null'); + throw new InvalidArgumentException('non-nullable can_insert_everywhere cannot be null'); } $this->container['can_insert_everywhere'] = $can_insert_everywhere; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -353,11 +337,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -368,10 +352,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -384,11 +366,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -396,12 +376,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -430,5 +410,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/ApiAppResponseOwnerAccount.php b/sdks/php/src/Model/ApiAppResponseOwnerAccount.php index b46a76248..db9e8e0a0 100644 --- a/sdks/php/src/Model/ApiAppResponseOwnerAccount.php +++ b/sdks/php/src/Model/ApiAppResponseOwnerAccount.php @@ -1,14 +1,11 @@ */ -class ApiAppResponseOwnerAccount implements ModelInterface, ArrayAccess, \JsonSerializable +class ApiAppResponseOwnerAccount implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiAppResponseOwnerAccount'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account_id' => 'string', - 'email_address' => 'string' + 'email_address' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account_id' => null, - 'email_address' => null + 'email_address' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'account_id' => false, - 'email_address' => false + 'email_address' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,8 +113,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -126,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -136,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -145,9 +141,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -156,9 +149,6 @@ 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 { @@ -173,7 +163,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'account_id' => 'account_id', - 'email_address' => 'email_address' + 'email_address' => 'email_address', ]; /** @@ -183,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'account_id' => 'setAccountId', - 'email_address' => 'setEmailAddress' + 'email_address' => 'setEmailAddress', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'account_id' => 'getAccountId', - 'email_address' => 'getEmailAddress' + 'email_address' => 'getEmailAddress', ]; /** @@ -237,7 +227,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -249,7 +238,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -257,34 +246,33 @@ public function __construct(?array $data = null) $this->setIfExists('email_address', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ApiAppResponseOwnerAccount { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ApiAppResponseOwnerAccount { /** @var ApiAppResponseOwnerAccount */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, ApiAppResponseOwnerAccount::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -301,9 +289,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -317,7 +303,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets account_id * @@ -335,10 +320,10 @@ public function getAccountId() * * @return self */ - public function setAccountId($account_id) + public function setAccountId(?string $account_id) { if (is_null($account_id)) { - throw new \InvalidArgumentException('non-nullable account_id cannot be null'); + throw new InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -362,23 +347,22 @@ public function getEmailAddress() * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(?string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -387,11 +371,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -402,10 +386,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -418,11 +400,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -430,12 +410,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -464,5 +444,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/ApiAppResponseWhiteLabelingOptions.php b/sdks/php/src/Model/ApiAppResponseWhiteLabelingOptions.php index 39ee3623c..b010c59f0 100644 --- a/sdks/php/src/Model/ApiAppResponseWhiteLabelingOptions.php +++ b/sdks/php/src/Model/ApiAppResponseWhiteLabelingOptions.php @@ -1,14 +1,11 @@ */ -class ApiAppResponseWhiteLabelingOptions implements ModelInterface, ArrayAccess, \JsonSerializable +class ApiAppResponseWhiteLabelingOptions implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiAppResponseWhiteLabelingOptions'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'header_background_color' => 'string', 'legal_version' => 'string', @@ -73,16 +71,16 @@ class ApiAppResponseWhiteLabelingOptions implements ModelInterface, ArrayAccess, 'secondary_button_text_color' => 'string', 'secondary_button_text_color_hover' => 'string', 'text_color1' => 'string', - 'text_color2' => 'string' + 'text_color2' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'header_background_color' => null, 'legal_version' => null, @@ -97,14 +95,14 @@ class ApiAppResponseWhiteLabelingOptions implements ModelInterface, ArrayAccess, 'secondary_button_text_color' => null, 'secondary_button_text_color_hover' => null, 'text_color1' => null, - 'text_color2' => null + 'text_color2' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'header_background_color' => false, 'legal_version' => false, @@ -119,14 +117,14 @@ class ApiAppResponseWhiteLabelingOptions implements ModelInterface, ArrayAccess, 'secondary_button_text_color' => false, 'secondary_button_text_color_hover' => false, 'text_color1' => false, - 'text_color2' => false + 'text_color2' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -151,8 +149,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -162,7 +158,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -172,7 +168,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -181,9 +177,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -192,9 +185,6 @@ 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 { @@ -221,7 +211,7 @@ public function isNullableSetToNull(string $property): bool 'secondary_button_text_color' => 'secondary_button_text_color', 'secondary_button_text_color_hover' => 'secondary_button_text_color_hover', 'text_color1' => 'text_color1', - 'text_color2' => 'text_color2' + 'text_color2' => 'text_color2', ]; /** @@ -243,7 +233,7 @@ public function isNullableSetToNull(string $property): bool 'secondary_button_text_color' => 'setSecondaryButtonTextColor', 'secondary_button_text_color_hover' => 'setSecondaryButtonTextColorHover', 'text_color1' => 'setTextColor1', - 'text_color2' => 'setTextColor2' + 'text_color2' => 'setTextColor2', ]; /** @@ -265,7 +255,7 @@ public function isNullableSetToNull(string $property): bool 'secondary_button_text_color' => 'getSecondaryButtonTextColor', 'secondary_button_text_color_hover' => 'getSecondaryButtonTextColorHover', 'text_color1' => 'getTextColor1', - 'text_color2' => 'getTextColor2' + 'text_color2' => 'getTextColor2', ]; /** @@ -309,7 +299,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -321,7 +310,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -341,34 +330,33 @@ public function __construct(?array $data = null) $this->setIfExists('text_color2', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ApiAppResponseWhiteLabelingOptions { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ApiAppResponseWhiteLabelingOptions { /** @var ApiAppResponseWhiteLabelingOptions */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, ApiAppResponseWhiteLabelingOptions::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -385,9 +373,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -401,7 +387,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets header_background_color * @@ -419,10 +404,10 @@ public function getHeaderBackgroundColor() * * @return self */ - public function setHeaderBackgroundColor($header_background_color) + public function setHeaderBackgroundColor(?string $header_background_color) { if (is_null($header_background_color)) { - throw new \InvalidArgumentException('non-nullable header_background_color cannot be null'); + throw new InvalidArgumentException('non-nullable header_background_color cannot be null'); } $this->container['header_background_color'] = $header_background_color; @@ -446,10 +431,10 @@ public function getLegalVersion() * * @return self */ - public function setLegalVersion($legal_version) + public function setLegalVersion(?string $legal_version) { if (is_null($legal_version)) { - throw new \InvalidArgumentException('non-nullable legal_version cannot be null'); + throw new InvalidArgumentException('non-nullable legal_version cannot be null'); } $this->container['legal_version'] = $legal_version; @@ -473,10 +458,10 @@ public function getLinkColor() * * @return self */ - public function setLinkColor($link_color) + public function setLinkColor(?string $link_color) { if (is_null($link_color)) { - throw new \InvalidArgumentException('non-nullable link_color cannot be null'); + throw new InvalidArgumentException('non-nullable link_color cannot be null'); } $this->container['link_color'] = $link_color; @@ -500,10 +485,10 @@ public function getPageBackgroundColor() * * @return self */ - public function setPageBackgroundColor($page_background_color) + public function setPageBackgroundColor(?string $page_background_color) { if (is_null($page_background_color)) { - throw new \InvalidArgumentException('non-nullable page_background_color cannot be null'); + throw new InvalidArgumentException('non-nullable page_background_color cannot be null'); } $this->container['page_background_color'] = $page_background_color; @@ -527,10 +512,10 @@ public function getPrimaryButtonColor() * * @return self */ - public function setPrimaryButtonColor($primary_button_color) + public function setPrimaryButtonColor(?string $primary_button_color) { if (is_null($primary_button_color)) { - throw new \InvalidArgumentException('non-nullable primary_button_color cannot be null'); + throw new InvalidArgumentException('non-nullable primary_button_color cannot be null'); } $this->container['primary_button_color'] = $primary_button_color; @@ -554,10 +539,10 @@ public function getPrimaryButtonColorHover() * * @return self */ - public function setPrimaryButtonColorHover($primary_button_color_hover) + public function setPrimaryButtonColorHover(?string $primary_button_color_hover) { if (is_null($primary_button_color_hover)) { - throw new \InvalidArgumentException('non-nullable primary_button_color_hover cannot be null'); + throw new InvalidArgumentException('non-nullable primary_button_color_hover cannot be null'); } $this->container['primary_button_color_hover'] = $primary_button_color_hover; @@ -581,10 +566,10 @@ public function getPrimaryButtonTextColor() * * @return self */ - public function setPrimaryButtonTextColor($primary_button_text_color) + public function setPrimaryButtonTextColor(?string $primary_button_text_color) { if (is_null($primary_button_text_color)) { - throw new \InvalidArgumentException('non-nullable primary_button_text_color cannot be null'); + throw new InvalidArgumentException('non-nullable primary_button_text_color cannot be null'); } $this->container['primary_button_text_color'] = $primary_button_text_color; @@ -608,10 +593,10 @@ public function getPrimaryButtonTextColorHover() * * @return self */ - public function setPrimaryButtonTextColorHover($primary_button_text_color_hover) + public function setPrimaryButtonTextColorHover(?string $primary_button_text_color_hover) { if (is_null($primary_button_text_color_hover)) { - throw new \InvalidArgumentException('non-nullable primary_button_text_color_hover cannot be null'); + throw new InvalidArgumentException('non-nullable primary_button_text_color_hover cannot be null'); } $this->container['primary_button_text_color_hover'] = $primary_button_text_color_hover; @@ -635,10 +620,10 @@ public function getSecondaryButtonColor() * * @return self */ - public function setSecondaryButtonColor($secondary_button_color) + public function setSecondaryButtonColor(?string $secondary_button_color) { if (is_null($secondary_button_color)) { - throw new \InvalidArgumentException('non-nullable secondary_button_color cannot be null'); + throw new InvalidArgumentException('non-nullable secondary_button_color cannot be null'); } $this->container['secondary_button_color'] = $secondary_button_color; @@ -662,10 +647,10 @@ public function getSecondaryButtonColorHover() * * @return self */ - public function setSecondaryButtonColorHover($secondary_button_color_hover) + public function setSecondaryButtonColorHover(?string $secondary_button_color_hover) { if (is_null($secondary_button_color_hover)) { - throw new \InvalidArgumentException('non-nullable secondary_button_color_hover cannot be null'); + throw new InvalidArgumentException('non-nullable secondary_button_color_hover cannot be null'); } $this->container['secondary_button_color_hover'] = $secondary_button_color_hover; @@ -689,10 +674,10 @@ public function getSecondaryButtonTextColor() * * @return self */ - public function setSecondaryButtonTextColor($secondary_button_text_color) + public function setSecondaryButtonTextColor(?string $secondary_button_text_color) { if (is_null($secondary_button_text_color)) { - throw new \InvalidArgumentException('non-nullable secondary_button_text_color cannot be null'); + throw new InvalidArgumentException('non-nullable secondary_button_text_color cannot be null'); } $this->container['secondary_button_text_color'] = $secondary_button_text_color; @@ -716,10 +701,10 @@ public function getSecondaryButtonTextColorHover() * * @return self */ - public function setSecondaryButtonTextColorHover($secondary_button_text_color_hover) + public function setSecondaryButtonTextColorHover(?string $secondary_button_text_color_hover) { if (is_null($secondary_button_text_color_hover)) { - throw new \InvalidArgumentException('non-nullable secondary_button_text_color_hover cannot be null'); + throw new InvalidArgumentException('non-nullable secondary_button_text_color_hover cannot be null'); } $this->container['secondary_button_text_color_hover'] = $secondary_button_text_color_hover; @@ -743,10 +728,10 @@ public function getTextColor1() * * @return self */ - public function setTextColor1($text_color1) + public function setTextColor1(?string $text_color1) { if (is_null($text_color1)) { - throw new \InvalidArgumentException('non-nullable text_color1 cannot be null'); + throw new InvalidArgumentException('non-nullable text_color1 cannot be null'); } $this->container['text_color1'] = $text_color1; @@ -770,23 +755,22 @@ public function getTextColor2() * * @return self */ - public function setTextColor2($text_color2) + public function setTextColor2(?string $text_color2) { if (is_null($text_color2)) { - throw new \InvalidArgumentException('non-nullable text_color2 cannot be null'); + throw new InvalidArgumentException('non-nullable text_color2 cannot be null'); } $this->container['text_color2'] = $text_color2; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -795,11 +779,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -810,10 +794,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -826,11 +808,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -838,12 +818,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -872,5 +852,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/ApiAppUpdateRequest.php b/sdks/php/src/Model/ApiAppUpdateRequest.php index 0b391b802..323f28d52 100644 --- a/sdks/php/src/Model/ApiAppUpdateRequest.php +++ b/sdks/php/src/Model/ApiAppUpdateRequest.php @@ -1,14 +1,11 @@ */ -class ApiAppUpdateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class ApiAppUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiAppUpdateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'callback_url' => 'string', 'custom_logo_file' => '\SplFileObject', @@ -65,16 +64,16 @@ class ApiAppUpdateRequest implements ModelInterface, ArrayAccess, \JsonSerializa 'name' => 'string', 'oauth' => '\Dropbox\Sign\Model\SubOAuth', 'options' => '\Dropbox\Sign\Model\SubOptions', - 'white_labeling_options' => '\Dropbox\Sign\Model\SubWhiteLabelingOptions' + 'white_labeling_options' => '\Dropbox\Sign\Model\SubWhiteLabelingOptions', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'callback_url' => null, 'custom_logo_file' => 'binary', @@ -82,14 +81,14 @@ class ApiAppUpdateRequest implements ModelInterface, ArrayAccess, \JsonSerializa 'name' => null, 'oauth' => null, 'options' => null, - 'white_labeling_options' => null + 'white_labeling_options' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'callback_url' => false, 'custom_logo_file' => false, @@ -97,14 +96,14 @@ class ApiAppUpdateRequest implements ModelInterface, ArrayAccess, \JsonSerializa 'name' => false, 'oauth' => false, 'options' => false, - 'white_labeling_options' => false + 'white_labeling_options' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -129,8 +128,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -140,7 +137,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -150,7 +147,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -159,9 +156,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -170,9 +164,6 @@ 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 { @@ -192,7 +183,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'name', 'oauth' => 'oauth', 'options' => 'options', - 'white_labeling_options' => 'white_labeling_options' + 'white_labeling_options' => 'white_labeling_options', ]; /** @@ -207,7 +198,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'setName', 'oauth' => 'setOauth', 'options' => 'setOptions', - 'white_labeling_options' => 'setWhiteLabelingOptions' + 'white_labeling_options' => 'setWhiteLabelingOptions', ]; /** @@ -222,7 +213,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'getName', 'oauth' => 'getOauth', 'options' => 'getOptions', - 'white_labeling_options' => 'getWhiteLabelingOptions' + 'white_labeling_options' => 'getWhiteLabelingOptions', ]; /** @@ -266,7 +257,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -278,7 +268,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -291,34 +281,33 @@ public function __construct(?array $data = null) $this->setIfExists('white_labeling_options', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ApiAppUpdateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ApiAppUpdateRequest { /** @var ApiAppUpdateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, ApiAppUpdateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -355,7 +344,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets callback_url * @@ -369,14 +357,14 @@ public function getCallbackUrl() /** * Sets callback_url * - * @param string|null $callback_url The URL at which the API App should receive event callbacks. + * @param string|null $callback_url the URL at which the API App should receive event callbacks * * @return self */ - public function setCallbackUrl($callback_url) + public function setCallbackUrl(?string $callback_url) { if (is_null($callback_url)) { - throw new \InvalidArgumentException('non-nullable callback_url cannot be null'); + throw new InvalidArgumentException('non-nullable callback_url cannot be null'); } $this->container['callback_url'] = $callback_url; @@ -386,7 +374,7 @@ public function setCallbackUrl($callback_url) /** * Gets custom_logo_file * - * @return \SplFileObject|null + * @return SplFileObject|null */ public function getCustomLogoFile() { @@ -396,14 +384,14 @@ public function getCustomLogoFile() /** * Sets custom_logo_file * - * @param \SplFileObject|null $custom_logo_file An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) + * @param SplFileObject|null $custom_logo_file An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) * * @return self */ - public function setCustomLogoFile($custom_logo_file) + public function setCustomLogoFile(?SplFileObject $custom_logo_file) { if (is_null($custom_logo_file)) { - throw new \InvalidArgumentException('non-nullable custom_logo_file cannot be null'); + throw new InvalidArgumentException('non-nullable custom_logo_file cannot be null'); } $this->container['custom_logo_file'] = $custom_logo_file; @@ -423,18 +411,18 @@ public function getDomains() /** * Sets domains * - * @param string[]|null $domains The domain names the ApiApp will be associated with. + * @param string[]|null $domains the domain names the ApiApp will be associated with * * @return self */ - public function setDomains($domains) + public function setDomains(?array $domains) { if (is_null($domains)) { - throw new \InvalidArgumentException('non-nullable domains cannot be null'); + throw new InvalidArgumentException('non-nullable domains cannot be null'); } - if ((count($domains) > 2)) { - throw new \InvalidArgumentException('invalid value for $domains when calling ApiAppUpdateRequest., number of items must be less than or equal to 2.'); + if (count($domains) > 2) { + throw new InvalidArgumentException('invalid value for $domains when calling ApiAppUpdateRequest., number of items must be less than or equal to 2.'); } $this->container['domains'] = $domains; @@ -454,14 +442,14 @@ public function getName() /** * Sets name * - * @param string|null $name The name you want to assign to the ApiApp. + * @param string|null $name the name you want to assign to the ApiApp * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -485,10 +473,10 @@ public function getOauth() * * @return self */ - public function setOauth($oauth) + public function setOauth(?SubOAuth $oauth) { if (is_null($oauth)) { - throw new \InvalidArgumentException('non-nullable oauth cannot be null'); + throw new InvalidArgumentException('non-nullable oauth cannot be null'); } $this->container['oauth'] = $oauth; @@ -512,10 +500,10 @@ public function getOptions() * * @return self */ - public function setOptions($options) + public function setOptions(?SubOptions $options) { if (is_null($options)) { - throw new \InvalidArgumentException('non-nullable options cannot be null'); + throw new InvalidArgumentException('non-nullable options cannot be null'); } $this->container['options'] = $options; @@ -539,23 +527,22 @@ public function getWhiteLabelingOptions() * * @return self */ - public function setWhiteLabelingOptions($white_labeling_options) + public function setWhiteLabelingOptions(?SubWhiteLabelingOptions $white_labeling_options) { if (is_null($white_labeling_options)) { - throw new \InvalidArgumentException('non-nullable white_labeling_options cannot be null'); + throw new InvalidArgumentException('non-nullable white_labeling_options cannot be null'); } $this->container['white_labeling_options'] = $white_labeling_options; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -564,11 +551,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -579,10 +566,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -595,11 +580,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -607,12 +590,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -641,5 +624,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/BulkSendJobGetResponse.php b/sdks/php/src/Model/BulkSendJobGetResponse.php index e2b51d3dc..a0699b46f 100644 --- a/sdks/php/src/Model/BulkSendJobGetResponse.php +++ b/sdks/php/src/Model/BulkSendJobGetResponse.php @@ -1,14 +1,11 @@ */ -class BulkSendJobGetResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class BulkSendJobGetResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'BulkSendJobGetResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'bulk_send_job' => '\Dropbox\Sign\Model\BulkSendJobResponse', 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', 'signature_requests' => '\Dropbox\Sign\Model\BulkSendJobGetResponseSignatureRequests[]', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'bulk_send_job' => null, 'list_info' => null, 'signature_requests' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'bulk_send_job' => false, 'list_info' => false, 'signature_requests' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -120,8 +118,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -131,7 +127,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -141,7 +137,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -150,9 +146,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -161,9 +154,6 @@ 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 { @@ -180,7 +170,7 @@ public function isNullableSetToNull(string $property): bool 'bulk_send_job' => 'bulk_send_job', 'list_info' => 'list_info', 'signature_requests' => 'signature_requests', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool 'bulk_send_job' => 'setBulkSendJob', 'list_info' => 'setListInfo', 'signature_requests' => 'setSignatureRequests', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -204,7 +194,7 @@ public function isNullableSetToNull(string $property): bool 'bulk_send_job' => 'getBulkSendJob', 'list_info' => 'getListInfo', 'signature_requests' => 'getSignatureRequests', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -248,7 +238,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -260,7 +249,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -270,34 +259,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): BulkSendJobGetResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): BulkSendJobGetResponse { /** @var BulkSendJobGetResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, BulkSendJobGetResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -339,7 +327,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets bulk_send_job * @@ -357,10 +344,10 @@ public function getBulkSendJob() * * @return self */ - public function setBulkSendJob($bulk_send_job) + public function setBulkSendJob(BulkSendJobResponse $bulk_send_job) { if (is_null($bulk_send_job)) { - throw new \InvalidArgumentException('non-nullable bulk_send_job cannot be null'); + throw new InvalidArgumentException('non-nullable bulk_send_job cannot be null'); } $this->container['bulk_send_job'] = $bulk_send_job; @@ -384,10 +371,10 @@ public function getListInfo() * * @return self */ - public function setListInfo($list_info) + public function setListInfo(ListInfoResponse $list_info) { if (is_null($list_info)) { - throw new \InvalidArgumentException('non-nullable list_info cannot be null'); + throw new InvalidArgumentException('non-nullable list_info cannot be null'); } $this->container['list_info'] = $list_info; @@ -407,14 +394,14 @@ public function getSignatureRequests() /** * Sets signature_requests * - * @param BulkSendJobGetResponseSignatureRequests[] $signature_requests Contains information about the Signature Requests sent in bulk. + * @param BulkSendJobGetResponseSignatureRequests[] $signature_requests contains information about the Signature Requests sent in bulk * * @return self */ - public function setSignatureRequests($signature_requests) + public function setSignatureRequests(array $signature_requests) { if (is_null($signature_requests)) { - throw new \InvalidArgumentException('non-nullable signature_requests cannot be null'); + throw new InvalidArgumentException('non-nullable signature_requests cannot be null'); } $this->container['signature_requests'] = $signature_requests; @@ -434,27 +421,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -463,11 +449,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -478,10 +464,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -494,11 +478,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -506,12 +488,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -540,5 +522,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/BulkSendJobGetResponseSignatureRequests.php b/sdks/php/src/Model/BulkSendJobGetResponseSignatureRequests.php index d0e45b31b..a68be1c16 100644 --- a/sdks/php/src/Model/BulkSendJobGetResponseSignatureRequests.php +++ b/sdks/php/src/Model/BulkSendJobGetResponseSignatureRequests.php @@ -1,14 +1,11 @@ */ -class BulkSendJobGetResponseSignatureRequests implements ModelInterface, ArrayAccess, \JsonSerializable +class BulkSendJobGetResponseSignatureRequests implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'BulkSendJobGetResponseSignatureRequests'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'test_mode' => 'bool', 'signature_request_id' => 'string', @@ -83,16 +81,16 @@ class BulkSendJobGetResponseSignatureRequests implements ModelInterface, ArrayAc 'attachments' => '\Dropbox\Sign\Model\SignatureRequestResponseAttachment[]', 'response_data' => '\Dropbox\Sign\Model\SignatureRequestResponseDataBase[]', 'signatures' => '\Dropbox\Sign\Model\SignatureRequestResponseSignatures[]', - 'bulk_send_job_id' => 'string' + 'bulk_send_job_id' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'test_mode' => null, 'signature_request_id' => null, @@ -118,14 +116,14 @@ class BulkSendJobGetResponseSignatureRequests implements ModelInterface, ArrayAc 'attachments' => null, 'response_data' => null, 'signatures' => null, - 'bulk_send_job_id' => null + 'bulk_send_job_id' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'test_mode' => false, 'signature_request_id' => false, @@ -151,14 +149,14 @@ class BulkSendJobGetResponseSignatureRequests implements ModelInterface, ArrayAc 'attachments' => true, 'response_data' => true, 'signatures' => false, - 'bulk_send_job_id' => false + 'bulk_send_job_id' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -183,8 +181,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -194,7 +190,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -204,7 +200,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -213,9 +209,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -224,9 +217,6 @@ 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 { @@ -264,7 +254,7 @@ public function isNullableSetToNull(string $property): bool 'attachments' => 'attachments', 'response_data' => 'response_data', 'signatures' => 'signatures', - 'bulk_send_job_id' => 'bulk_send_job_id' + 'bulk_send_job_id' => 'bulk_send_job_id', ]; /** @@ -297,7 +287,7 @@ public function isNullableSetToNull(string $property): bool 'attachments' => 'setAttachments', 'response_data' => 'setResponseData', 'signatures' => 'setSignatures', - 'bulk_send_job_id' => 'setBulkSendJobId' + 'bulk_send_job_id' => 'setBulkSendJobId', ]; /** @@ -330,7 +320,7 @@ public function isNullableSetToNull(string $property): bool 'attachments' => 'getAttachments', 'response_data' => 'getResponseData', 'signatures' => 'getSignatures', - 'bulk_send_job_id' => 'getBulkSendJobId' + 'bulk_send_job_id' => 'getBulkSendJobId', ]; /** @@ -374,7 +364,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -386,7 +375,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -417,34 +406,33 @@ public function __construct(?array $data = null) $this->setIfExists('bulk_send_job_id', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): BulkSendJobGetResponseSignatureRequests { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): BulkSendJobGetResponseSignatureRequests { /** @var BulkSendJobGetResponseSignatureRequests */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, BulkSendJobGetResponseSignatureRequests::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -461,9 +449,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -477,7 +463,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets test_mode * @@ -495,10 +480,10 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -518,14 +503,14 @@ public function getSignatureRequestId() /** * Sets signature_request_id * - * @param string|null $signature_request_id The id of the SignatureRequest. + * @param string|null $signature_request_id the id of the SignatureRequest * * @return self */ - public function setSignatureRequestId($signature_request_id) + public function setSignatureRequestId(?string $signature_request_id) { if (is_null($signature_request_id)) { - throw new \InvalidArgumentException('non-nullable signature_request_id cannot be null'); + throw new InvalidArgumentException('non-nullable signature_request_id cannot be null'); } $this->container['signature_request_id'] = $signature_request_id; @@ -545,17 +530,17 @@ public function getRequesterEmailAddress() /** * Sets requester_email_address * - * @param string|null $requester_email_address The email address of the initiator of the SignatureRequest. + * @param string|null $requester_email_address the email address of the initiator of the SignatureRequest * * @return self */ - public function setRequesterEmailAddress($requester_email_address) + public function setRequesterEmailAddress(?string $requester_email_address) { if (is_null($requester_email_address)) { array_push($this->openAPINullablesSetToNull, 'requester_email_address'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('requester_email_address', $nullablesSetToNull, true); + $index = array_search('requester_email_address', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -579,14 +564,14 @@ public function getTitle() /** * Sets title * - * @param string|null $title The title the specified Account uses for the SignatureRequest. + * @param string|null $title the title the specified Account uses for the SignatureRequest * * @return self */ - public function setTitle($title) + public function setTitle(?string $title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + throw new InvalidArgumentException('non-nullable title cannot be null'); } $this->container['title'] = $title; @@ -606,14 +591,14 @@ public function getOriginalTitle() /** * Sets original_title * - * @param string|null $original_title Default Label for account. + * @param string|null $original_title default Label for account * * @return self */ - public function setOriginalTitle($original_title) + public function setOriginalTitle(?string $original_title) { if (is_null($original_title)) { - throw new \InvalidArgumentException('non-nullable original_title cannot be null'); + throw new InvalidArgumentException('non-nullable original_title cannot be null'); } $this->container['original_title'] = $original_title; @@ -633,17 +618,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject The subject in the email that was initially sent to the signers. + * @param string|null $subject the subject in the email that was initially sent to the signers * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { array_push($this->openAPINullablesSetToNull, 'subject'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('subject', $nullablesSetToNull, true); + $index = array_search('subject', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -667,17 +652,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message The custom message in the email that was initially sent to the signers. + * @param string|null $message the custom message in the email that was initially sent to the signers * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { array_push($this->openAPINullablesSetToNull, 'message'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('message', $nullablesSetToNull, true); + $index = array_search('message', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -701,14 +686,14 @@ public function getMetadata() /** * Sets metadata * - * @param array|null $metadata The metadata attached to the signature request. + * @param array|null $metadata the metadata attached to the signature request * * @return self */ - public function setMetadata($metadata) + public function setMetadata(?array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } $this->container['metadata'] = $metadata; @@ -728,14 +713,14 @@ public function getCreatedAt() /** * Sets created_at * - * @param int|null $created_at Time the signature request was created. + * @param int|null $created_at time the signature request was created * * @return self */ - public function setCreatedAt($created_at) + public function setCreatedAt(?int $created_at) { if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + throw new InvalidArgumentException('non-nullable created_at cannot be null'); } $this->container['created_at'] = $created_at; @@ -759,13 +744,13 @@ public function getExpiresAt() * * @return self */ - public function setExpiresAt($expires_at) + public function setExpiresAt(?int $expires_at) { if (is_null($expires_at)) { array_push($this->openAPINullablesSetToNull, 'expires_at'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('expires_at', $nullablesSetToNull, true); + $index = array_search('expires_at', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -789,14 +774,14 @@ public function getIsComplete() /** * Sets is_complete * - * @param bool|null $is_complete Whether or not the SignatureRequest has been fully executed by all signers. + * @param bool|null $is_complete whether or not the SignatureRequest has been fully executed by all signers * * @return self */ - public function setIsComplete($is_complete) + public function setIsComplete(?bool $is_complete) { if (is_null($is_complete)) { - throw new \InvalidArgumentException('non-nullable is_complete cannot be null'); + throw new InvalidArgumentException('non-nullable is_complete cannot be null'); } $this->container['is_complete'] = $is_complete; @@ -816,14 +801,14 @@ public function getIsDeclined() /** * Sets is_declined * - * @param bool|null $is_declined Whether or not the SignatureRequest has been declined by a signer. + * @param bool|null $is_declined whether or not the SignatureRequest has been declined by a signer * * @return self */ - public function setIsDeclined($is_declined) + public function setIsDeclined(?bool $is_declined) { if (is_null($is_declined)) { - throw new \InvalidArgumentException('non-nullable is_declined cannot be null'); + throw new InvalidArgumentException('non-nullable is_declined cannot be null'); } $this->container['is_declined'] = $is_declined; @@ -843,14 +828,14 @@ public function getHasError() /** * Sets has_error * - * @param bool|null $has_error Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). + * @param bool|null $has_error whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings) * * @return self */ - public function setHasError($has_error) + public function setHasError(?bool $has_error) { if (is_null($has_error)) { - throw new \InvalidArgumentException('non-nullable has_error cannot be null'); + throw new InvalidArgumentException('non-nullable has_error cannot be null'); } $this->container['has_error'] = $has_error; @@ -870,14 +855,14 @@ public function getFilesUrl() /** * Sets files_url * - * @param string|null $files_url The URL where a copy of the request's documents can be downloaded. + * @param string|null $files_url the URL where a copy of the request's documents can be downloaded * * @return self */ - public function setFilesUrl($files_url) + public function setFilesUrl(?string $files_url) { if (is_null($files_url)) { - throw new \InvalidArgumentException('non-nullable files_url cannot be null'); + throw new InvalidArgumentException('non-nullable files_url cannot be null'); } $this->container['files_url'] = $files_url; @@ -901,13 +886,13 @@ public function getSigningUrl() * * @return self */ - public function setSigningUrl($signing_url) + public function setSigningUrl(?string $signing_url) { if (is_null($signing_url)) { array_push($this->openAPINullablesSetToNull, 'signing_url'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signing_url', $nullablesSetToNull, true); + $index = array_search('signing_url', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -931,14 +916,14 @@ public function getDetailsUrl() /** * Sets details_url * - * @param string|null $details_url The URL where the requester and the signers can view the current status of the SignatureRequest. + * @param string|null $details_url the URL where the requester and the signers can view the current status of the SignatureRequest * * @return self */ - public function setDetailsUrl($details_url) + public function setDetailsUrl(?string $details_url) { if (is_null($details_url)) { - throw new \InvalidArgumentException('non-nullable details_url cannot be null'); + throw new InvalidArgumentException('non-nullable details_url cannot be null'); } $this->container['details_url'] = $details_url; @@ -962,10 +947,10 @@ public function getCcEmailAddresses() * * @return self */ - public function setCcEmailAddresses($cc_email_addresses) + public function setCcEmailAddresses(?array $cc_email_addresses) { if (is_null($cc_email_addresses)) { - throw new \InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); } $this->container['cc_email_addresses'] = $cc_email_addresses; @@ -985,17 +970,17 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url The URL you want the signer redirected to after they successfully sign. + * @param string|null $signing_redirect_url the URL you want the signer redirected to after they successfully sign * * @return self */ - public function setSigningRedirectUrl($signing_redirect_url) + public function setSigningRedirectUrl(?string $signing_redirect_url) { if (is_null($signing_redirect_url)) { array_push($this->openAPINullablesSetToNull, 'signing_redirect_url'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signing_redirect_url', $nullablesSetToNull, true); + $index = array_search('signing_redirect_url', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1023,13 +1008,13 @@ public function getFinalCopyUri() * * @return self */ - public function setFinalCopyUri($final_copy_uri) + public function setFinalCopyUri(?string $final_copy_uri) { if (is_null($final_copy_uri)) { array_push($this->openAPINullablesSetToNull, 'final_copy_uri'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('final_copy_uri', $nullablesSetToNull, true); + $index = array_search('final_copy_uri', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1053,17 +1038,17 @@ public function getTemplateIds() /** * Sets template_ids * - * @param string[]|null $template_ids Templates IDs used in this SignatureRequest (if any). + * @param string[]|null $template_ids templates IDs used in this SignatureRequest (if any) * * @return self */ - public function setTemplateIds($template_ids) + public function setTemplateIds(?array $template_ids) { if (is_null($template_ids)) { array_push($this->openAPINullablesSetToNull, 'template_ids'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('template_ids', $nullablesSetToNull, true); + $index = array_search('template_ids', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1091,13 +1076,13 @@ public function getCustomFields() * * @return self */ - public function setCustomFields($custom_fields) + public function setCustomFields(?array $custom_fields) { if (is_null($custom_fields)) { array_push($this->openAPINullablesSetToNull, 'custom_fields'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('custom_fields', $nullablesSetToNull, true); + $index = array_search('custom_fields', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1121,17 +1106,17 @@ public function getAttachments() /** * Sets attachments * - * @param SignatureRequestResponseAttachment[]|null $attachments Signer attachments. + * @param SignatureRequestResponseAttachment[]|null $attachments signer attachments * * @return self */ - public function setAttachments($attachments) + public function setAttachments(?array $attachments) { if (is_null($attachments)) { array_push($this->openAPINullablesSetToNull, 'attachments'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('attachments', $nullablesSetToNull, true); + $index = array_search('attachments', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1155,17 +1140,17 @@ public function getResponseData() /** * Sets response_data * - * @param SignatureRequestResponseDataBase[]|null $response_data An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. + * @param SignatureRequestResponseDataBase[]|null $response_data an array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers * * @return self */ - public function setResponseData($response_data) + public function setResponseData(?array $response_data) { if (is_null($response_data)) { array_push($this->openAPINullablesSetToNull, 'response_data'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('response_data', $nullablesSetToNull, true); + $index = array_search('response_data', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1189,14 +1174,14 @@ public function getSignatures() /** * Sets signatures * - * @param SignatureRequestResponseSignatures[]|null $signatures An array of signature objects, 1 for each signer. + * @param SignatureRequestResponseSignatures[]|null $signatures an array of signature objects, 1 for each signer * * @return self */ - public function setSignatures($signatures) + public function setSignatures(?array $signatures) { if (is_null($signatures)) { - throw new \InvalidArgumentException('non-nullable signatures cannot be null'); + throw new InvalidArgumentException('non-nullable signatures cannot be null'); } $this->container['signatures'] = $signatures; @@ -1216,27 +1201,26 @@ public function getBulkSendJobId() /** * Sets bulk_send_job_id * - * @param string|null $bulk_send_job_id The id of the BulkSendJob. + * @param string|null $bulk_send_job_id the id of the BulkSendJob * * @return self */ - public function setBulkSendJobId($bulk_send_job_id) + public function setBulkSendJobId(?string $bulk_send_job_id) { if (is_null($bulk_send_job_id)) { - throw new \InvalidArgumentException('non-nullable bulk_send_job_id cannot be null'); + throw new InvalidArgumentException('non-nullable bulk_send_job_id cannot be null'); } $this->container['bulk_send_job_id'] = $bulk_send_job_id; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1245,11 +1229,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1260,10 +1244,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1276,11 +1258,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1288,12 +1268,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1322,5 +1302,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/BulkSendJobListResponse.php b/sdks/php/src/Model/BulkSendJobListResponse.php index e4a655b36..ee12f4f40 100644 --- a/sdks/php/src/Model/BulkSendJobListResponse.php +++ b/sdks/php/src/Model/BulkSendJobListResponse.php @@ -1,14 +1,11 @@ */ -class BulkSendJobListResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class BulkSendJobListResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'BulkSendJobListResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'bulk_send_jobs' => '\Dropbox\Sign\Model\BulkSendJobResponse[]', 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'bulk_send_jobs' => null, 'list_info' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'bulk_send_jobs' => false, 'list_info' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'bulk_send_jobs' => 'bulk_send_jobs', 'list_info' => 'list_info', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'bulk_send_jobs' => 'setBulkSendJobs', 'list_info' => 'setListInfo', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'bulk_send_jobs' => 'getBulkSendJobs', 'list_info' => 'getListInfo', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -242,7 +232,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -254,7 +243,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -263,34 +252,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): BulkSendJobListResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): BulkSendJobListResponse { /** @var BulkSendJobListResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, BulkSendJobListResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -329,7 +317,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets bulk_send_jobs * @@ -343,14 +330,14 @@ public function getBulkSendJobs() /** * Sets bulk_send_jobs * - * @param BulkSendJobResponse[] $bulk_send_jobs Contains a list of BulkSendJobs that the API caller has access to. + * @param BulkSendJobResponse[] $bulk_send_jobs contains a list of BulkSendJobs that the API caller has access to * * @return self */ - public function setBulkSendJobs($bulk_send_jobs) + public function setBulkSendJobs(array $bulk_send_jobs) { if (is_null($bulk_send_jobs)) { - throw new \InvalidArgumentException('non-nullable bulk_send_jobs cannot be null'); + throw new InvalidArgumentException('non-nullable bulk_send_jobs cannot be null'); } $this->container['bulk_send_jobs'] = $bulk_send_jobs; @@ -374,10 +361,10 @@ public function getListInfo() * * @return self */ - public function setListInfo($list_info) + public function setListInfo(ListInfoResponse $list_info) { if (is_null($list_info)) { - throw new \InvalidArgumentException('non-nullable list_info cannot be null'); + throw new InvalidArgumentException('non-nullable list_info cannot be null'); } $this->container['list_info'] = $list_info; @@ -397,27 +384,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -426,11 +412,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -441,10 +427,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -457,11 +441,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -469,12 +451,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -503,5 +485,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/BulkSendJobResponse.php b/sdks/php/src/Model/BulkSendJobResponse.php index 36e4ef304..987a9bd02 100644 --- a/sdks/php/src/Model/BulkSendJobResponse.php +++ b/sdks/php/src/Model/BulkSendJobResponse.php @@ -1,14 +1,11 @@ */ -class BulkSendJobResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class BulkSendJobResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'BulkSendJobResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'bulk_send_job_id' => 'string', 'total' => 'int', 'is_creator' => 'bool', - 'created_at' => 'int' + 'created_at' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'bulk_send_job_id' => null, 'total' => null, 'is_creator' => null, - 'created_at' => null + 'created_at' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'bulk_send_job_id' => true, 'total' => false, 'is_creator' => false, - 'created_at' => false + 'created_at' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -121,8 +119,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -132,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -142,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -151,9 +147,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -162,9 +155,6 @@ 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 { @@ -181,7 +171,7 @@ public function isNullableSetToNull(string $property): bool 'bulk_send_job_id' => 'bulk_send_job_id', 'total' => 'total', 'is_creator' => 'is_creator', - 'created_at' => 'created_at' + 'created_at' => 'created_at', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool 'bulk_send_job_id' => 'setBulkSendJobId', 'total' => 'setTotal', 'is_creator' => 'setIsCreator', - 'created_at' => 'setCreatedAt' + 'created_at' => 'setCreatedAt', ]; /** @@ -205,7 +195,7 @@ public function isNullableSetToNull(string $property): bool 'bulk_send_job_id' => 'getBulkSendJobId', 'total' => 'getTotal', 'is_creator' => 'getIsCreator', - 'created_at' => 'getCreatedAt' + 'created_at' => 'getCreatedAt', ]; /** @@ -249,7 +239,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -261,7 +250,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -271,34 +260,33 @@ public function __construct(?array $data = null) $this->setIfExists('created_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): BulkSendJobResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): BulkSendJobResponse { /** @var BulkSendJobResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, BulkSendJobResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -315,9 +303,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -331,7 +317,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets bulk_send_job_id * @@ -345,17 +330,17 @@ public function getBulkSendJobId() /** * Sets bulk_send_job_id * - * @param string|null $bulk_send_job_id The id of the BulkSendJob. + * @param string|null $bulk_send_job_id the id of the BulkSendJob * * @return self */ - public function setBulkSendJobId($bulk_send_job_id) + public function setBulkSendJobId(?string $bulk_send_job_id) { if (is_null($bulk_send_job_id)) { array_push($this->openAPINullablesSetToNull, 'bulk_send_job_id'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('bulk_send_job_id', $nullablesSetToNull, true); + $index = array_search('bulk_send_job_id', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -379,14 +364,14 @@ public function getTotal() /** * Sets total * - * @param int|null $total The total amount of Signature Requests queued for sending. + * @param int|null $total the total amount of Signature Requests queued for sending * * @return self */ - public function setTotal($total) + public function setTotal(?int $total) { if (is_null($total)) { - throw new \InvalidArgumentException('non-nullable total cannot be null'); + throw new InvalidArgumentException('non-nullable total cannot be null'); } $this->container['total'] = $total; @@ -406,14 +391,14 @@ public function getIsCreator() /** * Sets is_creator * - * @param bool|null $is_creator True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. + * @param bool|null $is_creator true if you are the owner of this BulkSendJob, false if it's been shared with you by a team member * * @return self */ - public function setIsCreator($is_creator) + public function setIsCreator(?bool $is_creator) { if (is_null($is_creator)) { - throw new \InvalidArgumentException('non-nullable is_creator cannot be null'); + throw new InvalidArgumentException('non-nullable is_creator cannot be null'); } $this->container['is_creator'] = $is_creator; @@ -433,27 +418,26 @@ public function getCreatedAt() /** * Sets created_at * - * @param int|null $created_at Time that the BulkSendJob was created. + * @param int|null $created_at time that the BulkSendJob was created * * @return self */ - public function setCreatedAt($created_at) + public function setCreatedAt(?int $created_at) { if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + throw new InvalidArgumentException('non-nullable created_at cannot be null'); } $this->container['created_at'] = $created_at; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -462,11 +446,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -477,10 +461,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -493,11 +475,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -505,12 +485,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -539,5 +519,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/BulkSendJobSendResponse.php b/sdks/php/src/Model/BulkSendJobSendResponse.php index a1a53f1e0..945a1a518 100644 --- a/sdks/php/src/Model/BulkSendJobSendResponse.php +++ b/sdks/php/src/Model/BulkSendJobSendResponse.php @@ -1,14 +1,11 @@ */ -class BulkSendJobSendResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class BulkSendJobSendResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'BulkSendJobSendResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'bulk_send_job' => '\Dropbox\Sign\Model\BulkSendJobResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'bulk_send_job' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'bulk_send_job' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'bulk_send_job' => 'bulk_send_job', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'bulk_send_job' => 'setBulkSendJob', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'bulk_send_job' => 'getBulkSendJob', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): BulkSendJobSendResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): BulkSendJobSendResponse { /** @var BulkSendJobSendResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, BulkSendJobSendResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,7 +307,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets bulk_send_job * @@ -337,10 +324,10 @@ public function getBulkSendJob() * * @return self */ - public function setBulkSendJob($bulk_send_job) + public function setBulkSendJob(BulkSendJobResponse $bulk_send_job) { if (is_null($bulk_send_job)) { - throw new \InvalidArgumentException('non-nullable bulk_send_job cannot be null'); + throw new InvalidArgumentException('non-nullable bulk_send_job cannot be null'); } $this->container['bulk_send_job'] = $bulk_send_job; @@ -360,27 +347,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -389,11 +375,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -404,10 +390,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -420,11 +404,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -432,12 +414,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -466,5 +448,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/EmbeddedEditUrlRequest.php b/sdks/php/src/Model/EmbeddedEditUrlRequest.php index bbb27b657..d5252f0e2 100644 --- a/sdks/php/src/Model/EmbeddedEditUrlRequest.php +++ b/sdks/php/src/Model/EmbeddedEditUrlRequest.php @@ -1,14 +1,11 @@ */ -class EmbeddedEditUrlRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class EmbeddedEditUrlRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EmbeddedEditUrlRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'allow_edit_ccs' => 'bool', 'cc_roles' => 'string[]', @@ -68,16 +66,16 @@ class EmbeddedEditUrlRequest implements ModelInterface, ArrayAccess, \JsonSerial 'preview_only' => 'bool', 'show_preview' => 'bool', 'show_progress_stepper' => 'bool', - 'test_mode' => 'bool' + 'test_mode' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'allow_edit_ccs' => null, 'cc_roles' => null, @@ -88,14 +86,14 @@ class EmbeddedEditUrlRequest implements ModelInterface, ArrayAccess, \JsonSerial 'preview_only' => null, 'show_preview' => null, 'show_progress_stepper' => null, - 'test_mode' => null + 'test_mode' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'allow_edit_ccs' => false, 'cc_roles' => false, @@ -106,14 +104,14 @@ class EmbeddedEditUrlRequest implements ModelInterface, ArrayAccess, \JsonSerial 'preview_only' => false, 'show_preview' => false, 'show_progress_stepper' => false, - 'test_mode' => false + 'test_mode' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -138,8 +136,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -149,7 +145,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -159,7 +155,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -168,9 +164,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -179,9 +172,6 @@ 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 { @@ -204,7 +194,7 @@ public function isNullableSetToNull(string $property): bool 'preview_only' => 'preview_only', 'show_preview' => 'show_preview', 'show_progress_stepper' => 'show_progress_stepper', - 'test_mode' => 'test_mode' + 'test_mode' => 'test_mode', ]; /** @@ -222,7 +212,7 @@ public function isNullableSetToNull(string $property): bool 'preview_only' => 'setPreviewOnly', 'show_preview' => 'setShowPreview', 'show_progress_stepper' => 'setShowProgressStepper', - 'test_mode' => 'setTestMode' + 'test_mode' => 'setTestMode', ]; /** @@ -240,7 +230,7 @@ public function isNullableSetToNull(string $property): bool 'preview_only' => 'getPreviewOnly', 'show_preview' => 'getShowPreview', 'show_progress_stepper' => 'getShowProgressStepper', - 'test_mode' => 'getTestMode' + 'test_mode' => 'getTestMode', ]; /** @@ -284,7 +274,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -296,7 +285,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -312,34 +301,33 @@ public function __construct(?array $data = null) $this->setIfExists('test_mode', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): EmbeddedEditUrlRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): EmbeddedEditUrlRequest { /** @var EmbeddedEditUrlRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, EmbeddedEditUrlRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -356,9 +344,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -372,7 +358,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets allow_edit_ccs * @@ -386,14 +371,14 @@ public function getAllowEditCcs() /** * Sets allow_edit_ccs * - * @param bool|null $allow_edit_ccs This allows the requester to enable/disable to add or change CC roles when editing the template. + * @param bool|null $allow_edit_ccs this allows the requester to enable/disable to add or change CC roles when editing the template * * @return self */ - public function setAllowEditCcs($allow_edit_ccs) + public function setAllowEditCcs(?bool $allow_edit_ccs) { if (is_null($allow_edit_ccs)) { - throw new \InvalidArgumentException('non-nullable allow_edit_ccs cannot be null'); + throw new InvalidArgumentException('non-nullable allow_edit_ccs cannot be null'); } $this->container['allow_edit_ccs'] = $allow_edit_ccs; @@ -417,10 +402,10 @@ public function getCcRoles() * * @return self */ - public function setCcRoles($cc_roles) + public function setCcRoles(?array $cc_roles) { if (is_null($cc_roles)) { - throw new \InvalidArgumentException('non-nullable cc_roles cannot be null'); + throw new InvalidArgumentException('non-nullable cc_roles cannot be null'); } $this->container['cc_roles'] = $cc_roles; @@ -444,10 +429,10 @@ public function getEditorOptions() * * @return self */ - public function setEditorOptions($editor_options) + public function setEditorOptions(?SubEditorOptions $editor_options) { if (is_null($editor_options)) { - throw new \InvalidArgumentException('non-nullable editor_options cannot be null'); + throw new InvalidArgumentException('non-nullable editor_options cannot be null'); } $this->container['editor_options'] = $editor_options; @@ -467,14 +452,14 @@ public function getForceSignerRoles() /** * Sets force_signer_roles * - * @param bool|null $force_signer_roles Provide users the ability to review/edit the template signer roles. + * @param bool|null $force_signer_roles provide users the ability to review/edit the template signer roles * * @return self */ - public function setForceSignerRoles($force_signer_roles) + public function setForceSignerRoles(?bool $force_signer_roles) { if (is_null($force_signer_roles)) { - throw new \InvalidArgumentException('non-nullable force_signer_roles cannot be null'); + throw new InvalidArgumentException('non-nullable force_signer_roles cannot be null'); } $this->container['force_signer_roles'] = $force_signer_roles; @@ -494,14 +479,14 @@ public function getForceSubjectMessage() /** * Sets force_subject_message * - * @param bool|null $force_subject_message Provide users the ability to review/edit the template subject and message. + * @param bool|null $force_subject_message provide users the ability to review/edit the template subject and message * * @return self */ - public function setForceSubjectMessage($force_subject_message) + public function setForceSubjectMessage(?bool $force_subject_message) { if (is_null($force_subject_message)) { - throw new \InvalidArgumentException('non-nullable force_subject_message cannot be null'); + throw new InvalidArgumentException('non-nullable force_subject_message cannot be null'); } $this->container['force_subject_message'] = $force_subject_message; @@ -525,10 +510,10 @@ public function getMergeFields() * * @return self */ - public function setMergeFields($merge_fields) + public function setMergeFields(?array $merge_fields) { if (is_null($merge_fields)) { - throw new \InvalidArgumentException('non-nullable merge_fields cannot be null'); + throw new InvalidArgumentException('non-nullable merge_fields cannot be null'); } $this->container['merge_fields'] = $merge_fields; @@ -552,10 +537,10 @@ public function getPreviewOnly() * * @return self */ - public function setPreviewOnly($preview_only) + public function setPreviewOnly(?bool $preview_only) { if (is_null($preview_only)) { - throw new \InvalidArgumentException('non-nullable preview_only cannot be null'); + throw new InvalidArgumentException('non-nullable preview_only cannot be null'); } $this->container['preview_only'] = $preview_only; @@ -575,14 +560,14 @@ public function getShowPreview() /** * Sets show_preview * - * @param bool|null $show_preview This allows the requester to enable the editor/preview experience. + * @param bool|null $show_preview this allows the requester to enable the editor/preview experience * * @return self */ - public function setShowPreview($show_preview) + public function setShowPreview(?bool $show_preview) { if (is_null($show_preview)) { - throw new \InvalidArgumentException('non-nullable show_preview cannot be null'); + throw new InvalidArgumentException('non-nullable show_preview cannot be null'); } $this->container['show_preview'] = $show_preview; @@ -602,14 +587,14 @@ public function getShowProgressStepper() /** * Sets show_progress_stepper * - * @param bool|null $show_progress_stepper When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. + * @param bool|null $show_progress_stepper when only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden * * @return self */ - public function setShowProgressStepper($show_progress_stepper) + public function setShowProgressStepper(?bool $show_progress_stepper) { if (is_null($show_progress_stepper)) { - throw new \InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); + throw new InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); } $this->container['show_progress_stepper'] = $show_progress_stepper; @@ -633,23 +618,22 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -658,11 +642,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -673,10 +657,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -689,11 +671,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -701,12 +681,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -735,5 +715,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/EmbeddedEditUrlResponse.php b/sdks/php/src/Model/EmbeddedEditUrlResponse.php index cba27fa36..865768dd7 100644 --- a/sdks/php/src/Model/EmbeddedEditUrlResponse.php +++ b/sdks/php/src/Model/EmbeddedEditUrlResponse.php @@ -1,14 +1,11 @@ */ -class EmbeddedEditUrlResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class EmbeddedEditUrlResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EmbeddedEditUrlResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'embedded' => '\Dropbox\Sign\Model\EmbeddedEditUrlResponseEmbedded', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'embedded' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'embedded' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'embedded' => 'embedded', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'embedded' => 'setEmbedded', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'embedded' => 'getEmbedded', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): EmbeddedEditUrlResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): EmbeddedEditUrlResponse { /** @var EmbeddedEditUrlResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, EmbeddedEditUrlResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,7 +307,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets embedded * @@ -337,10 +324,10 @@ public function getEmbedded() * * @return self */ - public function setEmbedded($embedded) + public function setEmbedded(EmbeddedEditUrlResponseEmbedded $embedded) { if (is_null($embedded)) { - throw new \InvalidArgumentException('non-nullable embedded cannot be null'); + throw new InvalidArgumentException('non-nullable embedded cannot be null'); } $this->container['embedded'] = $embedded; @@ -360,27 +347,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -389,11 +375,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -404,10 +390,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -420,11 +404,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -432,12 +414,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -466,5 +448,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/EmbeddedEditUrlResponseEmbedded.php b/sdks/php/src/Model/EmbeddedEditUrlResponseEmbedded.php index 036857d8e..bda80cfb8 100644 --- a/sdks/php/src/Model/EmbeddedEditUrlResponseEmbedded.php +++ b/sdks/php/src/Model/EmbeddedEditUrlResponseEmbedded.php @@ -1,14 +1,11 @@ */ -class EmbeddedEditUrlResponseEmbedded implements ModelInterface, ArrayAccess, \JsonSerializable +class EmbeddedEditUrlResponseEmbedded implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EmbeddedEditUrlResponseEmbedded'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'edit_url' => 'string', - 'expires_at' => 'int' + 'expires_at' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'edit_url' => null, - 'expires_at' => null + 'expires_at' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'edit_url' => false, - 'expires_at' => false + 'expires_at' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,8 +113,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -126,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -136,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -145,9 +141,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -156,9 +149,6 @@ 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 { @@ -173,7 +163,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'edit_url' => 'edit_url', - 'expires_at' => 'expires_at' + 'expires_at' => 'expires_at', ]; /** @@ -183,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'edit_url' => 'setEditUrl', - 'expires_at' => 'setExpiresAt' + 'expires_at' => 'setExpiresAt', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'edit_url' => 'getEditUrl', - 'expires_at' => 'getExpiresAt' + 'expires_at' => 'getExpiresAt', ]; /** @@ -237,7 +227,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -249,7 +238,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -257,34 +246,33 @@ public function __construct(?array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): EmbeddedEditUrlResponseEmbedded { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): EmbeddedEditUrlResponseEmbedded { /** @var EmbeddedEditUrlResponseEmbedded */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, EmbeddedEditUrlResponseEmbedded::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -301,9 +289,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -317,7 +303,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets edit_url * @@ -331,14 +316,14 @@ public function getEditUrl() /** * Sets edit_url * - * @param string|null $edit_url A template url that can be opened in an iFrame. + * @param string|null $edit_url a template url that can be opened in an iFrame * * @return self */ - public function setEditUrl($edit_url) + public function setEditUrl(?string $edit_url) { if (is_null($edit_url)) { - throw new \InvalidArgumentException('non-nullable edit_url cannot be null'); + throw new InvalidArgumentException('non-nullable edit_url cannot be null'); } $this->container['edit_url'] = $edit_url; @@ -358,27 +343,26 @@ public function getExpiresAt() /** * Sets expires_at * - * @param int|null $expires_at The specific time that the the `edit_url` link expires, in epoch. + * @param int|null $expires_at the specific time that the the `edit_url` link expires, in epoch * * @return self */ - public function setExpiresAt($expires_at) + public function setExpiresAt(?int $expires_at) { if (is_null($expires_at)) { - throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + throw new InvalidArgumentException('non-nullable expires_at cannot be null'); } $this->container['expires_at'] = $expires_at; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -387,11 +371,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -402,10 +386,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -418,11 +400,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -430,12 +410,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -464,5 +444,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/EmbeddedSignUrlResponse.php b/sdks/php/src/Model/EmbeddedSignUrlResponse.php index d9d552cc1..8b2c9af81 100644 --- a/sdks/php/src/Model/EmbeddedSignUrlResponse.php +++ b/sdks/php/src/Model/EmbeddedSignUrlResponse.php @@ -1,14 +1,11 @@ */ -class EmbeddedSignUrlResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class EmbeddedSignUrlResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EmbeddedSignUrlResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'embedded' => '\Dropbox\Sign\Model\EmbeddedSignUrlResponseEmbedded', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'embedded' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'embedded' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'embedded' => 'embedded', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'embedded' => 'setEmbedded', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'embedded' => 'getEmbedded', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): EmbeddedSignUrlResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): EmbeddedSignUrlResponse { /** @var EmbeddedSignUrlResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, EmbeddedSignUrlResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,7 +307,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets embedded * @@ -337,10 +324,10 @@ public function getEmbedded() * * @return self */ - public function setEmbedded($embedded) + public function setEmbedded(EmbeddedSignUrlResponseEmbedded $embedded) { if (is_null($embedded)) { - throw new \InvalidArgumentException('non-nullable embedded cannot be null'); + throw new InvalidArgumentException('non-nullable embedded cannot be null'); } $this->container['embedded'] = $embedded; @@ -360,27 +347,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -389,11 +375,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -404,10 +390,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -420,11 +404,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -432,12 +414,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -466,5 +448,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/EmbeddedSignUrlResponseEmbedded.php b/sdks/php/src/Model/EmbeddedSignUrlResponseEmbedded.php index 7e3514a84..54fffcbc2 100644 --- a/sdks/php/src/Model/EmbeddedSignUrlResponseEmbedded.php +++ b/sdks/php/src/Model/EmbeddedSignUrlResponseEmbedded.php @@ -1,14 +1,11 @@ */ -class EmbeddedSignUrlResponseEmbedded implements ModelInterface, ArrayAccess, \JsonSerializable +class EmbeddedSignUrlResponseEmbedded implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EmbeddedSignUrlResponseEmbedded'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'sign_url' => 'string', - 'expires_at' => 'int' + 'expires_at' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'sign_url' => null, - 'expires_at' => null + 'expires_at' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'sign_url' => false, - 'expires_at' => false + 'expires_at' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,8 +113,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -126,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -136,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -145,9 +141,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -156,9 +149,6 @@ 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 { @@ -173,7 +163,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'sign_url' => 'sign_url', - 'expires_at' => 'expires_at' + 'expires_at' => 'expires_at', ]; /** @@ -183,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'sign_url' => 'setSignUrl', - 'expires_at' => 'setExpiresAt' + 'expires_at' => 'setExpiresAt', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'sign_url' => 'getSignUrl', - 'expires_at' => 'getExpiresAt' + 'expires_at' => 'getExpiresAt', ]; /** @@ -237,7 +227,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -249,7 +238,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -257,34 +246,33 @@ public function __construct(?array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): EmbeddedSignUrlResponseEmbedded { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): EmbeddedSignUrlResponseEmbedded { /** @var EmbeddedSignUrlResponseEmbedded */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, EmbeddedSignUrlResponseEmbedded::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -301,9 +289,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -317,7 +303,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets sign_url * @@ -331,14 +316,14 @@ public function getSignUrl() /** * Sets sign_url * - * @param string|null $sign_url A signature url that can be opened in an iFrame. + * @param string|null $sign_url a signature url that can be opened in an iFrame * * @return self */ - public function setSignUrl($sign_url) + public function setSignUrl(?string $sign_url) { if (is_null($sign_url)) { - throw new \InvalidArgumentException('non-nullable sign_url cannot be null'); + throw new InvalidArgumentException('non-nullable sign_url cannot be null'); } $this->container['sign_url'] = $sign_url; @@ -358,27 +343,26 @@ public function getExpiresAt() /** * Sets expires_at * - * @param int|null $expires_at The specific time that the the `sign_url` link expires, in epoch. + * @param int|null $expires_at the specific time that the the `sign_url` link expires, in epoch * * @return self */ - public function setExpiresAt($expires_at) + public function setExpiresAt(?int $expires_at) { if (is_null($expires_at)) { - throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + throw new InvalidArgumentException('non-nullable expires_at cannot be null'); } $this->container['expires_at'] = $expires_at; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -387,11 +371,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -402,10 +386,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -418,11 +400,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -430,12 +410,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -464,5 +444,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/ErrorResponse.php b/sdks/php/src/Model/ErrorResponse.php index c6aaa9919..108b8e6c7 100644 --- a/sdks/php/src/Model/ErrorResponse.php +++ b/sdks/php/src/Model/ErrorResponse.php @@ -1,14 +1,11 @@ */ -class ErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ErrorResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'error' => '\Dropbox\Sign\Model\ErrorResponseError' + 'error' => '\Dropbox\Sign\Model\ErrorResponseError', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'error' => null + 'error' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'error' => false + 'error' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,8 +109,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -122,7 +118,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +128,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,9 +137,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -152,9 +145,6 @@ 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 { @@ -168,7 +158,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'error' => 'error' + 'error' => 'error', ]; /** @@ -177,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'error' => 'setError' + 'error' => 'setError', ]; /** @@ -186,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'error' => 'getError' + 'error' => 'getError', ]; /** @@ -230,7 +220,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -242,41 +231,40 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { $this->setIfExists('error', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ErrorResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ErrorResponse { /** @var ErrorResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, ErrorResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -312,7 +300,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets error * @@ -330,23 +317,22 @@ public function getError() * * @return self */ - public function setError($error) + public function setError(ErrorResponseError $error) { if (is_null($error)) { - throw new \InvalidArgumentException('non-nullable error cannot be null'); + throw new InvalidArgumentException('non-nullable error cannot be null'); } $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -355,11 +341,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -370,10 +356,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -386,11 +370,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -398,12 +380,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -432,5 +414,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/ErrorResponseError.php b/sdks/php/src/Model/ErrorResponseError.php index 3d9fbe577..6bb4b8620 100644 --- a/sdks/php/src/Model/ErrorResponseError.php +++ b/sdks/php/src/Model/ErrorResponseError.php @@ -1,14 +1,11 @@ */ -class ErrorResponseError implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorResponseError implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ErrorResponseError'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'error_msg' => 'string', 'error_name' => 'string', - 'error_path' => 'string' + 'error_path' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'error_msg' => null, 'error_name' => null, - 'error_path' => null + 'error_path' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'error_msg' => false, 'error_name' => false, - 'error_path' => false + 'error_path' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -118,8 +116,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -129,7 +125,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -139,7 +135,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -148,9 +144,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -159,9 +152,6 @@ 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 { @@ -177,7 +167,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'error_msg' => 'error_msg', 'error_name' => 'error_name', - 'error_path' => 'error_path' + 'error_path' => 'error_path', ]; /** @@ -188,7 +178,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'error_msg' => 'setErrorMsg', 'error_name' => 'setErrorName', - 'error_path' => 'setErrorPath' + 'error_path' => 'setErrorPath', ]; /** @@ -199,7 +189,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'error_msg' => 'getErrorMsg', 'error_name' => 'getErrorName', - 'error_path' => 'getErrorPath' + 'error_path' => 'getErrorPath', ]; /** @@ -243,7 +233,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -255,7 +244,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -264,34 +253,33 @@ public function __construct(?array $data = null) $this->setIfExists('error_path', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ErrorResponseError { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ErrorResponseError { /** @var ErrorResponseError */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, ErrorResponseError::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -330,7 +318,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets error_msg * @@ -344,14 +331,14 @@ public function getErrorMsg() /** * Sets error_msg * - * @param string $error_msg Message describing an error. + * @param string $error_msg message describing an error * * @return self */ - public function setErrorMsg($error_msg) + public function setErrorMsg(string $error_msg) { if (is_null($error_msg)) { - throw new \InvalidArgumentException('non-nullable error_msg cannot be null'); + throw new InvalidArgumentException('non-nullable error_msg cannot be null'); } $this->container['error_msg'] = $error_msg; @@ -371,14 +358,14 @@ public function getErrorName() /** * Sets error_name * - * @param string $error_name Name of the error. + * @param string $error_name name of the error * * @return self */ - public function setErrorName($error_name) + public function setErrorName(string $error_name) { if (is_null($error_name)) { - throw new \InvalidArgumentException('non-nullable error_name cannot be null'); + throw new InvalidArgumentException('non-nullable error_name cannot be null'); } $this->container['error_name'] = $error_name; @@ -398,27 +385,26 @@ public function getErrorPath() /** * Sets error_path * - * @param string|null $error_path Path at which an error occurred. + * @param string|null $error_path path at which an error occurred * * @return self */ - public function setErrorPath($error_path) + public function setErrorPath(?string $error_path) { if (is_null($error_path)) { - throw new \InvalidArgumentException('non-nullable error_path cannot be null'); + throw new InvalidArgumentException('non-nullable error_path cannot be null'); } $this->container['error_path'] = $error_path; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -427,11 +413,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -442,10 +428,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -458,11 +442,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -470,12 +452,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -504,5 +486,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/EventCallbackRequest.php b/sdks/php/src/Model/EventCallbackRequest.php index 1d572df2a..a3b4a183f 100644 --- a/sdks/php/src/Model/EventCallbackRequest.php +++ b/sdks/php/src/Model/EventCallbackRequest.php @@ -1,14 +1,11 @@ */ -class EventCallbackRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class EventCallbackRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EventCallbackRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'event' => '\Dropbox\Sign\Model\EventCallbackRequestEvent', 'account' => '\Dropbox\Sign\Model\AccountResponse', 'signature_request' => '\Dropbox\Sign\Model\SignatureRequestResponse', - 'template' => '\Dropbox\Sign\Model\TemplateResponse' + 'template' => '\Dropbox\Sign\Model\TemplateResponse', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'event' => null, 'account' => null, 'signature_request' => null, - 'template' => null + 'template' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'event' => false, 'account' => false, 'signature_request' => false, - 'template' => false + 'template' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -120,8 +118,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -131,7 +127,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -141,7 +137,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -150,9 +146,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -161,9 +154,6 @@ 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 { @@ -180,7 +170,7 @@ public function isNullableSetToNull(string $property): bool 'event' => 'event', 'account' => 'account', 'signature_request' => 'signature_request', - 'template' => 'template' + 'template' => 'template', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool 'event' => 'setEvent', 'account' => 'setAccount', 'signature_request' => 'setSignatureRequest', - 'template' => 'setTemplate' + 'template' => 'setTemplate', ]; /** @@ -204,7 +194,7 @@ public function isNullableSetToNull(string $property): bool 'event' => 'getEvent', 'account' => 'getAccount', 'signature_request' => 'getSignatureRequest', - 'template' => 'getTemplate' + 'template' => 'getTemplate', ]; /** @@ -248,7 +238,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -260,7 +249,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -270,34 +259,33 @@ public function __construct(?array $data = null) $this->setIfExists('template', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): EventCallbackRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): EventCallbackRequest { /** @var EventCallbackRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, EventCallbackRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -333,7 +321,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets event * @@ -351,10 +338,10 @@ public function getEvent() * * @return self */ - public function setEvent($event) + public function setEvent(EventCallbackRequestEvent $event) { if (is_null($event)) { - throw new \InvalidArgumentException('non-nullable event cannot be null'); + throw new InvalidArgumentException('non-nullable event cannot be null'); } $this->container['event'] = $event; @@ -378,10 +365,10 @@ public function getAccount() * * @return self */ - public function setAccount($account) + public function setAccount(?AccountResponse $account) { if (is_null($account)) { - throw new \InvalidArgumentException('non-nullable account cannot be null'); + throw new InvalidArgumentException('non-nullable account cannot be null'); } $this->container['account'] = $account; @@ -405,10 +392,10 @@ public function getSignatureRequest() * * @return self */ - public function setSignatureRequest($signature_request) + public function setSignatureRequest(?SignatureRequestResponse $signature_request) { if (is_null($signature_request)) { - throw new \InvalidArgumentException('non-nullable signature_request cannot be null'); + throw new InvalidArgumentException('non-nullable signature_request cannot be null'); } $this->container['signature_request'] = $signature_request; @@ -432,23 +419,22 @@ public function getTemplate() * * @return self */ - public function setTemplate($template) + public function setTemplate(?TemplateResponse $template) { if (is_null($template)) { - throw new \InvalidArgumentException('non-nullable template cannot be null'); + throw new InvalidArgumentException('non-nullable template cannot be null'); } $this->container['template'] = $template; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -457,11 +443,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -472,10 +458,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -488,11 +472,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -500,12 +482,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -534,5 +516,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/EventCallbackRequestEvent.php b/sdks/php/src/Model/EventCallbackRequestEvent.php index 7b896b7cf..2501307ce 100644 --- a/sdks/php/src/Model/EventCallbackRequestEvent.php +++ b/sdks/php/src/Model/EventCallbackRequestEvent.php @@ -1,14 +1,11 @@ */ -class EventCallbackRequestEvent implements ModelInterface, ArrayAccess, \JsonSerializable +class EventCallbackRequestEvent implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EventCallbackRequestEvent'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'event_time' => 'string', 'event_type' => 'string', 'event_hash' => 'string', - 'event_metadata' => '\Dropbox\Sign\Model\EventCallbackRequestEventMetadata' + 'event_metadata' => '\Dropbox\Sign\Model\EventCallbackRequestEventMetadata', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'event_time' => null, 'event_type' => null, 'event_hash' => null, - 'event_metadata' => null + 'event_metadata' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'event_time' => false, 'event_type' => false, 'event_hash' => false, - 'event_metadata' => false + 'event_metadata' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -121,8 +119,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -132,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -142,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -151,9 +147,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -162,9 +155,6 @@ 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 { @@ -181,7 +171,7 @@ public function isNullableSetToNull(string $property): bool 'event_time' => 'event_time', 'event_type' => 'event_type', 'event_hash' => 'event_hash', - 'event_metadata' => 'event_metadata' + 'event_metadata' => 'event_metadata', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool 'event_time' => 'setEventTime', 'event_type' => 'setEventType', 'event_hash' => 'setEventHash', - 'event_metadata' => 'setEventMetadata' + 'event_metadata' => 'setEventMetadata', ]; /** @@ -205,7 +195,7 @@ public function isNullableSetToNull(string $property): bool 'event_time' => 'getEventTime', 'event_type' => 'getEventType', 'event_hash' => 'getEventHash', - 'event_metadata' => 'getEventMetadata' + 'event_metadata' => 'getEventMetadata', ]; /** @@ -318,7 +308,7 @@ public function getEventTypeAllowableValues() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -328,34 +318,33 @@ public function __construct(?array $data = null) $this->setIfExists('event_metadata', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): EventCallbackRequestEvent { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): EventCallbackRequestEvent { /** @var EventCallbackRequestEvent */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, EventCallbackRequestEvent::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -406,7 +395,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets event_time * @@ -420,14 +408,14 @@ public function getEventTime() /** * Sets event_time * - * @param string $event_time Time the event was created (using Unix time). + * @param string $event_time time the event was created (using Unix time) * * @return self */ - public function setEventTime($event_time) + public function setEventTime(string $event_time) { if (is_null($event_time)) { - throw new \InvalidArgumentException('non-nullable event_time cannot be null'); + throw new InvalidArgumentException('non-nullable event_time cannot be null'); } $this->container['event_time'] = $event_time; @@ -447,18 +435,18 @@ public function getEventType() /** * Sets event_type * - * @param string $event_type Type of callback event that was triggered. + * @param string $event_type type of callback event that was triggered * * @return self */ - public function setEventType($event_type) + public function setEventType(string $event_type) { if (is_null($event_type)) { - throw new \InvalidArgumentException('non-nullable event_type cannot be null'); + throw new InvalidArgumentException('non-nullable event_type cannot be null'); } $allowedValues = $this->getEventTypeAllowableValues(); if (!in_array($event_type, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'event_type', must be one of '%s'", $event_type, @@ -484,14 +472,14 @@ public function getEventHash() /** * Sets event_hash * - * @param string $event_hash Generated hash used to verify source of event data. + * @param string $event_hash generated hash used to verify source of event data * * @return self */ - public function setEventHash($event_hash) + public function setEventHash(string $event_hash) { if (is_null($event_hash)) { - throw new \InvalidArgumentException('non-nullable event_hash cannot be null'); + throw new InvalidArgumentException('non-nullable event_hash cannot be null'); } $this->container['event_hash'] = $event_hash; @@ -515,23 +503,22 @@ public function getEventMetadata() * * @return self */ - public function setEventMetadata($event_metadata) + public function setEventMetadata(?EventCallbackRequestEventMetadata $event_metadata) { if (is_null($event_metadata)) { - throw new \InvalidArgumentException('non-nullable event_metadata cannot be null'); + throw new InvalidArgumentException('non-nullable event_metadata cannot be null'); } $this->container['event_metadata'] = $event_metadata; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -540,11 +527,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -555,10 +542,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -571,11 +556,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -583,12 +566,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -617,5 +600,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/EventCallbackRequestEventMetadata.php b/sdks/php/src/Model/EventCallbackRequestEventMetadata.php index 5ccd8ea85..9116a543c 100644 --- a/sdks/php/src/Model/EventCallbackRequestEventMetadata.php +++ b/sdks/php/src/Model/EventCallbackRequestEventMetadata.php @@ -1,14 +1,11 @@ */ -class EventCallbackRequestEventMetadata implements ModelInterface, ArrayAccess, \JsonSerializable +class EventCallbackRequestEventMetadata implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EventCallbackRequestEventMetadata'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'related_signature_id' => 'string', 'reported_for_account_id' => 'string', 'reported_for_app_id' => 'string', - 'event_message' => 'string' + 'event_message' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'related_signature_id' => null, 'reported_for_account_id' => null, 'reported_for_app_id' => null, - 'event_message' => null + 'event_message' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'related_signature_id' => true, 'reported_for_account_id' => true, 'reported_for_app_id' => true, - 'event_message' => true + 'event_message' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -121,8 +118,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -132,7 +127,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -142,7 +137,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -151,9 +146,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -162,9 +154,6 @@ 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 { @@ -181,7 +170,7 @@ public function isNullableSetToNull(string $property): bool 'related_signature_id' => 'related_signature_id', 'reported_for_account_id' => 'reported_for_account_id', 'reported_for_app_id' => 'reported_for_app_id', - 'event_message' => 'event_message' + 'event_message' => 'event_message', ]; /** @@ -193,7 +182,7 @@ public function isNullableSetToNull(string $property): bool 'related_signature_id' => 'setRelatedSignatureId', 'reported_for_account_id' => 'setReportedForAccountId', 'reported_for_app_id' => 'setReportedForAppId', - 'event_message' => 'setEventMessage' + 'event_message' => 'setEventMessage', ]; /** @@ -205,7 +194,7 @@ public function isNullableSetToNull(string $property): bool 'related_signature_id' => 'getRelatedSignatureId', 'reported_for_account_id' => 'getReportedForAccountId', 'reported_for_app_id' => 'getReportedForAppId', - 'event_message' => 'getEventMessage' + 'event_message' => 'getEventMessage', ]; /** @@ -249,7 +238,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -261,7 +249,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -271,34 +259,33 @@ public function __construct(?array $data = null) $this->setIfExists('event_message', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): EventCallbackRequestEventMetadata { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): EventCallbackRequestEventMetadata { /** @var EventCallbackRequestEventMetadata */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, EventCallbackRequestEventMetadata::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -315,9 +302,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -331,7 +316,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets related_signature_id * @@ -349,13 +333,13 @@ public function getRelatedSignatureId() * * @return self */ - public function setRelatedSignatureId($related_signature_id) + public function setRelatedSignatureId(?string $related_signature_id) { if (is_null($related_signature_id)) { array_push($this->openAPINullablesSetToNull, 'related_signature_id'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('related_signature_id', $nullablesSetToNull, true); + $index = array_search('related_signature_id', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -379,17 +363,17 @@ public function getReportedForAccountId() /** * Sets reported_for_account_id * - * @param string|null $reported_for_account_id Account ID the event was reported for. + * @param string|null $reported_for_account_id account ID the event was reported for * * @return self */ - public function setReportedForAccountId($reported_for_account_id) + public function setReportedForAccountId(?string $reported_for_account_id) { if (is_null($reported_for_account_id)) { array_push($this->openAPINullablesSetToNull, 'reported_for_account_id'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('reported_for_account_id', $nullablesSetToNull, true); + $index = array_search('reported_for_account_id', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -413,17 +397,17 @@ public function getReportedForAppId() /** * Sets reported_for_app_id * - * @param string|null $reported_for_app_id App ID the event was reported for. + * @param string|null $reported_for_app_id app ID the event was reported for * * @return self */ - public function setReportedForAppId($reported_for_app_id) + public function setReportedForAppId(?string $reported_for_app_id) { if (is_null($reported_for_app_id)) { array_push($this->openAPINullablesSetToNull, 'reported_for_app_id'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('reported_for_app_id', $nullablesSetToNull, true); + $index = array_search('reported_for_app_id', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -447,17 +431,17 @@ public function getEventMessage() /** * Sets event_message * - * @param string|null $event_message Message about a declined or failed (due to error) signature flow. + * @param string|null $event_message message about a declined or failed (due to error) signature flow * * @return self */ - public function setEventMessage($event_message) + public function setEventMessage(?string $event_message) { if (is_null($event_message)) { array_push($this->openAPINullablesSetToNull, 'event_message'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('event_message', $nullablesSetToNull, true); + $index = array_search('event_message', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -467,14 +451,13 @@ public function setEventMessage($event_message) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -483,11 +466,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -498,10 +481,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -514,11 +495,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -526,12 +505,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -560,5 +539,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/FaxGetResponse.php b/sdks/php/src/Model/FaxGetResponse.php index a763081cd..ee85f3d1d 100644 --- a/sdks/php/src/Model/FaxGetResponse.php +++ b/sdks/php/src/Model/FaxGetResponse.php @@ -1,14 +1,11 @@ */ -class FaxGetResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class FaxGetResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxGetResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'fax' => '\Dropbox\Sign\Model\FaxResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'fax' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'fax' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'fax' => 'fax', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'fax' => 'setFax', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'fax' => 'getFax', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): FaxGetResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): FaxGetResponse { /** @var FaxGetResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, FaxGetResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,7 +307,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets fax * @@ -337,10 +324,10 @@ public function getFax() * * @return self */ - public function setFax($fax) + public function setFax(FaxResponse $fax) { if (is_null($fax)) { - throw new \InvalidArgumentException('non-nullable fax cannot be null'); + throw new InvalidArgumentException('non-nullable fax cannot be null'); } $this->container['fax'] = $fax; @@ -360,27 +347,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -389,11 +375,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -404,10 +390,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -420,11 +404,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -432,12 +414,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -466,5 +448,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/FaxLineAddUserRequest.php b/sdks/php/src/Model/FaxLineAddUserRequest.php index cc238cbe2..4bada1b28 100644 --- a/sdks/php/src/Model/FaxLineAddUserRequest.php +++ b/sdks/php/src/Model/FaxLineAddUserRequest.php @@ -1,14 +1,11 @@ */ -class FaxLineAddUserRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class FaxLineAddUserRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxLineAddUserRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'number' => 'string', 'account_id' => 'string', - 'email_address' => 'string' + 'email_address' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'number' => null, 'account_id' => null, - 'email_address' => 'email' + 'email_address' => 'email', ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'number' => false, 'account_id' => false, - 'email_address' => false + 'email_address' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'number' => 'number', 'account_id' => 'account_id', - 'email_address' => 'email_address' + 'email_address' => 'email_address', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'number' => 'setNumber', 'account_id' => 'setAccountId', - 'email_address' => 'setEmailAddress' + 'email_address' => 'setEmailAddress', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'number' => 'getNumber', 'account_id' => 'getAccountId', - 'email_address' => 'getEmailAddress' + 'email_address' => 'getEmailAddress', ]; /** @@ -242,7 +232,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -254,7 +243,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -263,34 +252,33 @@ public function __construct(?array $data = null) $this->setIfExists('email_address', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): FaxLineAddUserRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): FaxLineAddUserRequest { /** @var FaxLineAddUserRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, FaxLineAddUserRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -326,7 +314,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets number * @@ -344,10 +331,10 @@ public function getNumber() * * @return self */ - public function setNumber($number) + public function setNumber(string $number) { if (is_null($number)) { - throw new \InvalidArgumentException('non-nullable number cannot be null'); + throw new InvalidArgumentException('non-nullable number cannot be null'); } $this->container['number'] = $number; @@ -371,10 +358,10 @@ public function getAccountId() * * @return self */ - public function setAccountId($account_id) + public function setAccountId(?string $account_id) { if (is_null($account_id)) { - throw new \InvalidArgumentException('non-nullable account_id cannot be null'); + throw new InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -398,23 +385,22 @@ public function getEmailAddress() * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(?string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -423,11 +409,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -438,10 +424,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -454,11 +438,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -466,12 +448,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -500,5 +482,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/FaxLineAreaCodeGetCountryEnum.php b/sdks/php/src/Model/FaxLineAreaCodeGetCountryEnum.php index e8ae6d6c2..68597df2e 100644 --- a/sdks/php/src/Model/FaxLineAreaCodeGetCountryEnum.php +++ b/sdks/php/src/Model/FaxLineAreaCodeGetCountryEnum.php @@ -1,14 +1,11 @@ */ -class FaxLineAreaCodeGetResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class FaxLineAreaCodeGetResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxLineAreaCodeGetResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'area_codes' => 'int[]' + 'area_codes' => 'int[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'area_codes' => null + 'area_codes' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'area_codes' => false + 'area_codes' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,8 +109,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -122,7 +118,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +128,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,9 +137,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -152,9 +145,6 @@ 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 { @@ -168,7 +158,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'area_codes' => 'area_codes' + 'area_codes' => 'area_codes', ]; /** @@ -177,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'area_codes' => 'setAreaCodes' + 'area_codes' => 'setAreaCodes', ]; /** @@ -186,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'area_codes' => 'getAreaCodes' + 'area_codes' => 'getAreaCodes', ]; /** @@ -230,7 +220,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -242,41 +231,40 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { $this->setIfExists('area_codes', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): FaxLineAreaCodeGetResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): FaxLineAreaCodeGetResponse { /** @var FaxLineAreaCodeGetResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, FaxLineAreaCodeGetResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -312,7 +300,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets area_codes * @@ -330,23 +317,22 @@ public function getAreaCodes() * * @return self */ - public function setAreaCodes($area_codes) + public function setAreaCodes(array $area_codes) { if (is_null($area_codes)) { - throw new \InvalidArgumentException('non-nullable area_codes cannot be null'); + throw new InvalidArgumentException('non-nullable area_codes cannot be null'); } $this->container['area_codes'] = $area_codes; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -355,11 +341,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -370,10 +356,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -386,11 +370,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -398,12 +380,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -432,5 +414,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/FaxLineAreaCodeGetStateEnum.php b/sdks/php/src/Model/FaxLineAreaCodeGetStateEnum.php index 88768271f..3ce60e6f5 100644 --- a/sdks/php/src/Model/FaxLineAreaCodeGetStateEnum.php +++ b/sdks/php/src/Model/FaxLineAreaCodeGetStateEnum.php @@ -1,14 +1,11 @@ */ -class FaxLineCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class FaxLineCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxLineCreateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'area_code' => 'int', 'country' => 'string', 'city' => 'string', - 'account_id' => 'string' + 'account_id' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'area_code' => null, 'country' => null, 'city' => null, - 'account_id' => null + 'account_id' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'area_code' => false, 'country' => false, 'city' => false, - 'account_id' => false + 'account_id' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -120,8 +118,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -131,7 +127,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -141,7 +137,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -150,9 +146,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -161,9 +154,6 @@ 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 { @@ -180,7 +170,7 @@ public function isNullableSetToNull(string $property): bool 'area_code' => 'area_code', 'country' => 'country', 'city' => 'city', - 'account_id' => 'account_id' + 'account_id' => 'account_id', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool 'area_code' => 'setAreaCode', 'country' => 'setCountry', 'city' => 'setCity', - 'account_id' => 'setAccountId' + 'account_id' => 'setAccountId', ]; /** @@ -204,7 +194,7 @@ public function isNullableSetToNull(string $property): bool 'area_code' => 'getAreaCode', 'country' => 'getCountry', 'city' => 'getCity', - 'account_id' => 'getAccountId' + 'account_id' => 'getAccountId', ]; /** @@ -277,7 +267,7 @@ public function getCountryAllowableValues() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -287,34 +277,33 @@ public function __construct(?array $data = null) $this->setIfExists('account_id', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): FaxLineCreateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): FaxLineCreateRequest { /** @var FaxLineCreateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, FaxLineCreateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -362,7 +351,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets area_code * @@ -380,10 +368,10 @@ public function getAreaCode() * * @return self */ - public function setAreaCode($area_code) + public function setAreaCode(int $area_code) { if (is_null($area_code)) { - throw new \InvalidArgumentException('non-nullable area_code cannot be null'); + throw new InvalidArgumentException('non-nullable area_code cannot be null'); } $this->container['area_code'] = $area_code; @@ -407,14 +395,14 @@ public function getCountry() * * @return self */ - public function setCountry($country) + public function setCountry(string $country) { if (is_null($country)) { - throw new \InvalidArgumentException('non-nullable country cannot be null'); + throw new InvalidArgumentException('non-nullable country cannot be null'); } $allowedValues = $this->getCountryAllowableValues(); if (!in_array($country, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'country', must be one of '%s'", $country, @@ -444,10 +432,10 @@ public function getCity() * * @return self */ - public function setCity($city) + public function setCity(?string $city) { if (is_null($city)) { - throw new \InvalidArgumentException('non-nullable city cannot be null'); + throw new InvalidArgumentException('non-nullable city cannot be null'); } $this->container['city'] = $city; @@ -471,23 +459,22 @@ public function getAccountId() * * @return self */ - public function setAccountId($account_id) + public function setAccountId(?string $account_id) { if (is_null($account_id)) { - throw new \InvalidArgumentException('non-nullable account_id cannot be null'); + throw new InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -496,11 +483,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -511,10 +498,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -527,11 +512,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -539,12 +522,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -573,5 +556,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/FaxLineDeleteRequest.php b/sdks/php/src/Model/FaxLineDeleteRequest.php index 8c44c1156..c3946e2cc 100644 --- a/sdks/php/src/Model/FaxLineDeleteRequest.php +++ b/sdks/php/src/Model/FaxLineDeleteRequest.php @@ -1,14 +1,11 @@ */ -class FaxLineDeleteRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class FaxLineDeleteRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxLineDeleteRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'number' => 'string' + 'number' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'number' => null + 'number' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'number' => false + 'number' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,8 +109,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -122,7 +118,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +128,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,9 +137,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -152,9 +145,6 @@ 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 { @@ -168,7 +158,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'number' => 'number' + 'number' => 'number', ]; /** @@ -177,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'number' => 'setNumber' + 'number' => 'setNumber', ]; /** @@ -186,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'number' => 'getNumber' + 'number' => 'getNumber', ]; /** @@ -230,7 +220,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -242,41 +231,40 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { $this->setIfExists('number', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): FaxLineDeleteRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): FaxLineDeleteRequest { /** @var FaxLineDeleteRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, FaxLineDeleteRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -312,7 +300,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets number * @@ -330,23 +317,22 @@ public function getNumber() * * @return self */ - public function setNumber($number) + public function setNumber(string $number) { if (is_null($number)) { - throw new \InvalidArgumentException('non-nullable number cannot be null'); + throw new InvalidArgumentException('non-nullable number cannot be null'); } $this->container['number'] = $number; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -355,11 +341,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -370,10 +356,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -386,11 +370,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -398,12 +380,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -432,5 +414,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/FaxLineListResponse.php b/sdks/php/src/Model/FaxLineListResponse.php index f8aaa4f89..904c477ae 100644 --- a/sdks/php/src/Model/FaxLineListResponse.php +++ b/sdks/php/src/Model/FaxLineListResponse.php @@ -1,14 +1,11 @@ */ -class FaxLineListResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class FaxLineListResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxLineListResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', 'fax_lines' => '\Dropbox\Sign\Model\FaxLineResponseFaxLine[]', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'list_info' => null, 'fax_lines' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'list_info' => false, 'fax_lines' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'list_info' => 'list_info', 'fax_lines' => 'fax_lines', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'list_info' => 'setListInfo', 'fax_lines' => 'setFaxLines', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'list_info' => 'getListInfo', 'fax_lines' => 'getFaxLines', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -242,7 +232,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -254,7 +243,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -263,34 +252,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): FaxLineListResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): FaxLineListResponse { /** @var FaxLineListResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, FaxLineListResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -329,7 +317,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets list_info * @@ -347,10 +334,10 @@ public function getListInfo() * * @return self */ - public function setListInfo($list_info) + public function setListInfo(ListInfoResponse $list_info) { if (is_null($list_info)) { - throw new \InvalidArgumentException('non-nullable list_info cannot be null'); + throw new InvalidArgumentException('non-nullable list_info cannot be null'); } $this->container['list_info'] = $list_info; @@ -374,10 +361,10 @@ public function getFaxLines() * * @return self */ - public function setFaxLines($fax_lines) + public function setFaxLines(array $fax_lines) { if (is_null($fax_lines)) { - throw new \InvalidArgumentException('non-nullable fax_lines cannot be null'); + throw new InvalidArgumentException('non-nullable fax_lines cannot be null'); } $this->container['fax_lines'] = $fax_lines; @@ -401,23 +388,22 @@ public function getWarnings() * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?WarningResponse $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -426,11 +412,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -441,10 +427,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -457,11 +441,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -469,12 +451,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -503,5 +485,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/FaxLineRemoveUserRequest.php b/sdks/php/src/Model/FaxLineRemoveUserRequest.php index 5e9a5fbb2..43bcce54d 100644 --- a/sdks/php/src/Model/FaxLineRemoveUserRequest.php +++ b/sdks/php/src/Model/FaxLineRemoveUserRequest.php @@ -1,14 +1,11 @@ */ -class FaxLineRemoveUserRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class FaxLineRemoveUserRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxLineRemoveUserRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'number' => 'string', 'account_id' => 'string', - 'email_address' => 'string' + 'email_address' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'number' => null, 'account_id' => null, - 'email_address' => 'email' + 'email_address' => 'email', ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'number' => false, 'account_id' => false, - 'email_address' => false + 'email_address' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'number' => 'number', 'account_id' => 'account_id', - 'email_address' => 'email_address' + 'email_address' => 'email_address', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'number' => 'setNumber', 'account_id' => 'setAccountId', - 'email_address' => 'setEmailAddress' + 'email_address' => 'setEmailAddress', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'number' => 'getNumber', 'account_id' => 'getAccountId', - 'email_address' => 'getEmailAddress' + 'email_address' => 'getEmailAddress', ]; /** @@ -242,7 +232,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -254,7 +243,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -263,34 +252,33 @@ public function __construct(?array $data = null) $this->setIfExists('email_address', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): FaxLineRemoveUserRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): FaxLineRemoveUserRequest { /** @var FaxLineRemoveUserRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, FaxLineRemoveUserRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -326,7 +314,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets number * @@ -344,10 +331,10 @@ public function getNumber() * * @return self */ - public function setNumber($number) + public function setNumber(string $number) { if (is_null($number)) { - throw new \InvalidArgumentException('non-nullable number cannot be null'); + throw new InvalidArgumentException('non-nullable number cannot be null'); } $this->container['number'] = $number; @@ -371,10 +358,10 @@ public function getAccountId() * * @return self */ - public function setAccountId($account_id) + public function setAccountId(?string $account_id) { if (is_null($account_id)) { - throw new \InvalidArgumentException('non-nullable account_id cannot be null'); + throw new InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -398,23 +385,22 @@ public function getEmailAddress() * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(?string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -423,11 +409,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -438,10 +424,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -454,11 +438,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -466,12 +448,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -500,5 +482,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/FaxLineResponse.php b/sdks/php/src/Model/FaxLineResponse.php index d2dce3560..7b84af2f9 100644 --- a/sdks/php/src/Model/FaxLineResponse.php +++ b/sdks/php/src/Model/FaxLineResponse.php @@ -1,14 +1,11 @@ */ -class FaxLineResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class FaxLineResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxLineResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'fax_line' => '\Dropbox\Sign\Model\FaxLineResponseFaxLine', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'fax_line' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'fax_line' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'fax_line' => 'fax_line', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'fax_line' => 'setFaxLine', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'fax_line' => 'getFaxLine', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): FaxLineResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): FaxLineResponse { /** @var FaxLineResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, FaxLineResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,7 +307,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets fax_line * @@ -337,10 +324,10 @@ public function getFaxLine() * * @return self */ - public function setFaxLine($fax_line) + public function setFaxLine(FaxLineResponseFaxLine $fax_line) { if (is_null($fax_line)) { - throw new \InvalidArgumentException('non-nullable fax_line cannot be null'); + throw new InvalidArgumentException('non-nullable fax_line cannot be null'); } $this->container['fax_line'] = $fax_line; @@ -364,23 +351,22 @@ public function getWarnings() * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?WarningResponse $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -389,11 +375,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -404,10 +390,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -420,11 +404,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -432,12 +414,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -466,5 +448,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/FaxLineResponseFaxLine.php b/sdks/php/src/Model/FaxLineResponseFaxLine.php index a83ccd74c..bde887583 100644 --- a/sdks/php/src/Model/FaxLineResponseFaxLine.php +++ b/sdks/php/src/Model/FaxLineResponseFaxLine.php @@ -1,14 +1,11 @@ */ -class FaxLineResponseFaxLine implements ModelInterface, ArrayAccess, \JsonSerializable +class FaxLineResponseFaxLine implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxLineResponseFaxLine'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'number' => 'string', 'created_at' => 'int', 'updated_at' => 'int', - 'accounts' => '\Dropbox\Sign\Model\AccountResponse[]' + 'accounts' => '\Dropbox\Sign\Model\AccountResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'number' => null, 'created_at' => null, 'updated_at' => null, - 'accounts' => null + 'accounts' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'number' => false, 'created_at' => false, 'updated_at' => false, - 'accounts' => false + 'accounts' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -120,8 +118,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -131,7 +127,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -141,7 +137,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -150,9 +146,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -161,9 +154,6 @@ 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 { @@ -180,7 +170,7 @@ public function isNullableSetToNull(string $property): bool 'number' => 'number', 'created_at' => 'created_at', 'updated_at' => 'updated_at', - 'accounts' => 'accounts' + 'accounts' => 'accounts', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool 'number' => 'setNumber', 'created_at' => 'setCreatedAt', 'updated_at' => 'setUpdatedAt', - 'accounts' => 'setAccounts' + 'accounts' => 'setAccounts', ]; /** @@ -204,7 +194,7 @@ public function isNullableSetToNull(string $property): bool 'number' => 'getNumber', 'created_at' => 'getCreatedAt', 'updated_at' => 'getUpdatedAt', - 'accounts' => 'getAccounts' + 'accounts' => 'getAccounts', ]; /** @@ -248,7 +238,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -260,7 +249,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -270,34 +259,33 @@ public function __construct(?array $data = null) $this->setIfExists('accounts', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): FaxLineResponseFaxLine { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): FaxLineResponseFaxLine { /** @var FaxLineResponseFaxLine */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, FaxLineResponseFaxLine::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -314,9 +302,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -330,7 +316,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets number * @@ -348,10 +333,10 @@ public function getNumber() * * @return self */ - public function setNumber($number) + public function setNumber(?string $number) { if (is_null($number)) { - throw new \InvalidArgumentException('non-nullable number cannot be null'); + throw new InvalidArgumentException('non-nullable number cannot be null'); } $this->container['number'] = $number; @@ -375,10 +360,10 @@ public function getCreatedAt() * * @return self */ - public function setCreatedAt($created_at) + public function setCreatedAt(?int $created_at) { if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + throw new InvalidArgumentException('non-nullable created_at cannot be null'); } $this->container['created_at'] = $created_at; @@ -402,10 +387,10 @@ public function getUpdatedAt() * * @return self */ - public function setUpdatedAt($updated_at) + public function setUpdatedAt(?int $updated_at) { if (is_null($updated_at)) { - throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + throw new InvalidArgumentException('non-nullable updated_at cannot be null'); } $this->container['updated_at'] = $updated_at; @@ -429,23 +414,22 @@ public function getAccounts() * * @return self */ - public function setAccounts($accounts) + public function setAccounts(?array $accounts) { if (is_null($accounts)) { - throw new \InvalidArgumentException('non-nullable accounts cannot be null'); + throw new InvalidArgumentException('non-nullable accounts cannot be null'); } $this->container['accounts'] = $accounts; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -454,11 +438,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -469,10 +453,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -485,11 +467,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -497,12 +477,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -531,5 +511,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/FaxListResponse.php b/sdks/php/src/Model/FaxListResponse.php index 77cbc79a1..bb402e895 100644 --- a/sdks/php/src/Model/FaxListResponse.php +++ b/sdks/php/src/Model/FaxListResponse.php @@ -1,14 +1,11 @@ */ -class FaxListResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class FaxListResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxListResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'faxes' => '\Dropbox\Sign\Model\FaxResponse[]', - 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse' + 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'faxes' => null, - 'list_info' => null + 'list_info' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'faxes' => false, - 'list_info' => false + 'list_info' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'faxes' => 'faxes', - 'list_info' => 'list_info' + 'list_info' => 'list_info', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'faxes' => 'setFaxes', - 'list_info' => 'setListInfo' + 'list_info' => 'setListInfo', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'faxes' => 'getFaxes', - 'list_info' => 'getListInfo' + 'list_info' => 'getListInfo', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('list_info', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): FaxListResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): FaxListResponse { /** @var FaxListResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, FaxListResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -322,7 +310,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets faxes * @@ -340,10 +327,10 @@ public function getFaxes() * * @return self */ - public function setFaxes($faxes) + public function setFaxes(array $faxes) { if (is_null($faxes)) { - throw new \InvalidArgumentException('non-nullable faxes cannot be null'); + throw new InvalidArgumentException('non-nullable faxes cannot be null'); } $this->container['faxes'] = $faxes; @@ -367,23 +354,22 @@ public function getListInfo() * * @return self */ - public function setListInfo($list_info) + public function setListInfo(ListInfoResponse $list_info) { if (is_null($list_info)) { - throw new \InvalidArgumentException('non-nullable list_info cannot be null'); + throw new InvalidArgumentException('non-nullable list_info cannot be null'); } $this->container['list_info'] = $list_info; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -392,11 +378,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -407,10 +393,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -423,11 +407,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -435,12 +417,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -469,5 +451,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/FaxResponse.php b/sdks/php/src/Model/FaxResponse.php index b262c70a7..ebe08f475 100644 --- a/sdks/php/src/Model/FaxResponse.php +++ b/sdks/php/src/Model/FaxResponse.php @@ -1,14 +1,11 @@ */ -class FaxResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class FaxResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'fax_id' => 'string', 'title' => 'string', @@ -69,16 +67,16 @@ class FaxResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'transmissions' => '\Dropbox\Sign\Model\FaxResponseTransmission[]', 'subject' => 'string', 'message' => 'string', - 'final_copy_uri' => 'string' + 'final_copy_uri' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'fax_id' => null, 'title' => null, @@ -90,14 +88,14 @@ class FaxResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'transmissions' => null, 'subject' => null, 'message' => null, - 'final_copy_uri' => null + 'final_copy_uri' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'fax_id' => false, 'title' => false, @@ -109,14 +107,14 @@ class FaxResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'transmissions' => false, 'subject' => true, 'message' => true, - 'final_copy_uri' => true + 'final_copy_uri' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -141,8 +139,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -152,7 +148,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -162,7 +158,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -171,9 +167,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -182,9 +175,6 @@ 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 { @@ -208,7 +198,7 @@ public function isNullableSetToNull(string $property): bool 'transmissions' => 'transmissions', 'subject' => 'subject', 'message' => 'message', - 'final_copy_uri' => 'final_copy_uri' + 'final_copy_uri' => 'final_copy_uri', ]; /** @@ -227,7 +217,7 @@ public function isNullableSetToNull(string $property): bool 'transmissions' => 'setTransmissions', 'subject' => 'setSubject', 'message' => 'setMessage', - 'final_copy_uri' => 'setFinalCopyUri' + 'final_copy_uri' => 'setFinalCopyUri', ]; /** @@ -246,7 +236,7 @@ public function isNullableSetToNull(string $property): bool 'transmissions' => 'getTransmissions', 'subject' => 'getSubject', 'message' => 'getMessage', - 'final_copy_uri' => 'getFinalCopyUri' + 'final_copy_uri' => 'getFinalCopyUri', ]; /** @@ -290,7 +280,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -302,7 +291,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -319,34 +308,33 @@ public function __construct(?array $data = null) $this->setIfExists('final_copy_uri', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): FaxResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): FaxResponse { /** @var FaxResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, FaxResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -403,7 +391,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets fax_id * @@ -421,10 +408,10 @@ public function getFaxId() * * @return self */ - public function setFaxId($fax_id) + public function setFaxId(string $fax_id) { if (is_null($fax_id)) { - throw new \InvalidArgumentException('non-nullable fax_id cannot be null'); + throw new InvalidArgumentException('non-nullable fax_id cannot be null'); } $this->container['fax_id'] = $fax_id; @@ -448,10 +435,10 @@ public function getTitle() * * @return self */ - public function setTitle($title) + public function setTitle(string $title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + throw new InvalidArgumentException('non-nullable title cannot be null'); } $this->container['title'] = $title; @@ -475,10 +462,10 @@ public function getOriginalTitle() * * @return self */ - public function setOriginalTitle($original_title) + public function setOriginalTitle(string $original_title) { if (is_null($original_title)) { - throw new \InvalidArgumentException('non-nullable original_title cannot be null'); + throw new InvalidArgumentException('non-nullable original_title cannot be null'); } $this->container['original_title'] = $original_title; @@ -502,10 +489,10 @@ public function getMetadata() * * @return self */ - public function setMetadata($metadata) + public function setMetadata(array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } $this->container['metadata'] = $metadata; @@ -529,10 +516,10 @@ public function getCreatedAt() * * @return self */ - public function setCreatedAt($created_at) + public function setCreatedAt(int $created_at) { if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + throw new InvalidArgumentException('non-nullable created_at cannot be null'); } $this->container['created_at'] = $created_at; @@ -556,10 +543,10 @@ public function getSender() * * @return self */ - public function setSender($sender) + public function setSender(string $sender) { if (is_null($sender)) { - throw new \InvalidArgumentException('non-nullable sender cannot be null'); + throw new InvalidArgumentException('non-nullable sender cannot be null'); } $this->container['sender'] = $sender; @@ -583,10 +570,10 @@ public function getFilesUrl() * * @return self */ - public function setFilesUrl($files_url) + public function setFilesUrl(string $files_url) { if (is_null($files_url)) { - throw new \InvalidArgumentException('non-nullable files_url cannot be null'); + throw new InvalidArgumentException('non-nullable files_url cannot be null'); } $this->container['files_url'] = $files_url; @@ -610,10 +597,10 @@ public function getTransmissions() * * @return self */ - public function setTransmissions($transmissions) + public function setTransmissions(array $transmissions) { if (is_null($transmissions)) { - throw new \InvalidArgumentException('non-nullable transmissions cannot be null'); + throw new InvalidArgumentException('non-nullable transmissions cannot be null'); } $this->container['transmissions'] = $transmissions; @@ -637,13 +624,13 @@ public function getSubject() * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { array_push($this->openAPINullablesSetToNull, 'subject'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('subject', $nullablesSetToNull, true); + $index = array_search('subject', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -671,13 +658,13 @@ public function getMessage() * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { array_push($this->openAPINullablesSetToNull, 'message'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('message', $nullablesSetToNull, true); + $index = array_search('message', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -705,13 +692,13 @@ public function getFinalCopyUri() * * @return self */ - public function setFinalCopyUri($final_copy_uri) + public function setFinalCopyUri(?string $final_copy_uri) { if (is_null($final_copy_uri)) { array_push($this->openAPINullablesSetToNull, 'final_copy_uri'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('final_copy_uri', $nullablesSetToNull, true); + $index = array_search('final_copy_uri', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -721,14 +708,13 @@ public function setFinalCopyUri($final_copy_uri) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -737,11 +723,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -752,10 +738,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -768,11 +752,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -780,12 +762,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -814,5 +796,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/FaxResponseTransmission.php b/sdks/php/src/Model/FaxResponseTransmission.php index f4196408f..440773960 100644 --- a/sdks/php/src/Model/FaxResponseTransmission.php +++ b/sdks/php/src/Model/FaxResponseTransmission.php @@ -1,14 +1,11 @@ */ -class FaxResponseTransmission implements ModelInterface, ArrayAccess, \JsonSerializable +class FaxResponseTransmission implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxResponseTransmission'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'recipient' => 'string', 'status_code' => 'string', - 'sent_at' => 'int' + 'sent_at' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'recipient' => null, 'status_code' => null, - 'sent_at' => null + 'sent_at' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'recipient' => false, 'status_code' => false, - 'sent_at' => false + 'sent_at' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'recipient' => 'recipient', 'status_code' => 'status_code', - 'sent_at' => 'sent_at' + 'sent_at' => 'sent_at', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'recipient' => 'setRecipient', 'status_code' => 'setStatusCode', - 'sent_at' => 'setSentAt' + 'sent_at' => 'setSentAt', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'recipient' => 'getRecipient', 'status_code' => 'getStatusCode', - 'sent_at' => 'getSentAt' + 'sent_at' => 'getSentAt', ]; /** @@ -281,7 +271,7 @@ public function getStatusCodeAllowableValues() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -290,34 +280,33 @@ public function __construct(?array $data = null) $this->setIfExists('sent_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): FaxResponseTransmission { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): FaxResponseTransmission { /** @var FaxResponseTransmission */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, FaxResponseTransmission::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -365,7 +354,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets recipient * @@ -383,10 +371,10 @@ public function getRecipient() * * @return self */ - public function setRecipient($recipient) + public function setRecipient(string $recipient) { if (is_null($recipient)) { - throw new \InvalidArgumentException('non-nullable recipient cannot be null'); + throw new InvalidArgumentException('non-nullable recipient cannot be null'); } $this->container['recipient'] = $recipient; @@ -410,14 +398,14 @@ public function getStatusCode() * * @return self */ - public function setStatusCode($status_code) + public function setStatusCode(string $status_code) { if (is_null($status_code)) { - throw new \InvalidArgumentException('non-nullable status_code cannot be null'); + throw new InvalidArgumentException('non-nullable status_code cannot be null'); } $allowedValues = $this->getStatusCodeAllowableValues(); if (!in_array($status_code, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'status_code', must be one of '%s'", $status_code, @@ -447,23 +435,22 @@ public function getSentAt() * * @return self */ - public function setSentAt($sent_at) + public function setSentAt(?int $sent_at) { if (is_null($sent_at)) { - throw new \InvalidArgumentException('non-nullable sent_at cannot be null'); + throw new InvalidArgumentException('non-nullable sent_at cannot be null'); } $this->container['sent_at'] = $sent_at; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -472,11 +459,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -487,10 +474,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -503,11 +488,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -515,12 +498,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -549,5 +532,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/FaxSendRequest.php b/sdks/php/src/Model/FaxSendRequest.php index bf99eed0c..4923a515a 100644 --- a/sdks/php/src/Model/FaxSendRequest.php +++ b/sdks/php/src/Model/FaxSendRequest.php @@ -1,14 +1,11 @@ */ -class FaxSendRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class FaxSendRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FaxSendRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'recipient' => 'string', 'sender' => 'string', @@ -67,16 +66,16 @@ class FaxSendRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'cover_page_to' => 'string', 'cover_page_from' => 'string', 'cover_page_message' => 'string', - 'title' => 'string' + 'title' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'recipient' => null, 'sender' => null, @@ -86,14 +85,14 @@ class FaxSendRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'cover_page_to' => null, 'cover_page_from' => null, 'cover_page_message' => null, - 'title' => null + 'title' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'recipient' => false, 'sender' => false, @@ -103,14 +102,14 @@ class FaxSendRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'cover_page_to' => false, 'cover_page_from' => false, 'cover_page_message' => false, - 'title' => false + 'title' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -135,8 +134,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -146,7 +143,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -156,7 +153,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -165,9 +162,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -176,9 +170,6 @@ 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 { @@ -200,7 +191,7 @@ public function isNullableSetToNull(string $property): bool 'cover_page_to' => 'cover_page_to', 'cover_page_from' => 'cover_page_from', 'cover_page_message' => 'cover_page_message', - 'title' => 'title' + 'title' => 'title', ]; /** @@ -217,7 +208,7 @@ public function isNullableSetToNull(string $property): bool 'cover_page_to' => 'setCoverPageTo', 'cover_page_from' => 'setCoverPageFrom', 'cover_page_message' => 'setCoverPageMessage', - 'title' => 'setTitle' + 'title' => 'setTitle', ]; /** @@ -234,7 +225,7 @@ public function isNullableSetToNull(string $property): bool 'cover_page_to' => 'getCoverPageTo', 'cover_page_from' => 'getCoverPageFrom', 'cover_page_message' => 'getCoverPageMessage', - 'title' => 'getTitle' + 'title' => 'getTitle', ]; /** @@ -278,7 +269,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -290,7 +280,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -305,34 +295,33 @@ public function __construct(?array $data = null) $this->setIfExists('title', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): FaxSendRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): FaxSendRequest { /** @var FaxSendRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, FaxSendRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -368,7 +357,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets recipient * @@ -386,10 +374,10 @@ public function getRecipient() * * @return self */ - public function setRecipient($recipient) + public function setRecipient(string $recipient) { if (is_null($recipient)) { - throw new \InvalidArgumentException('non-nullable recipient cannot be null'); + throw new InvalidArgumentException('non-nullable recipient cannot be null'); } $this->container['recipient'] = $recipient; @@ -413,10 +401,10 @@ public function getSender() * * @return self */ - public function setSender($sender) + public function setSender(?string $sender) { if (is_null($sender)) { - throw new \InvalidArgumentException('non-nullable sender cannot be null'); + throw new InvalidArgumentException('non-nullable sender cannot be null'); } $this->container['sender'] = $sender; @@ -426,7 +414,7 @@ public function setSender($sender) /** * Gets files * - * @return \SplFileObject[]|null + * @return SplFileObject[]|null */ public function getFiles() { @@ -436,14 +424,14 @@ public function getFiles() /** * Sets files * - * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to fax This endpoint requires either **files** or **file_urls[]**, but not both. + * @param SplFileObject[]|null $files use `files[]` to indicate the uploaded file(s) to fax This endpoint requires either **files** or **file_urls[]**, but not both * * @return self */ - public function setFiles($files) + public function setFiles(?array $files) { if (is_null($files)) { - throw new \InvalidArgumentException('non-nullable files cannot be null'); + throw new InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -463,14 +451,14 @@ public function getFileUrls() /** * Sets file_urls * - * @param string[]|null $file_urls Use `file_urls[]` to have Dropbox Fax download the file(s) to fax This endpoint requires either **files** or **file_urls[]**, but not both. + * @param string[]|null $file_urls use `file_urls[]` to have Dropbox Fax download the file(s) to fax This endpoint requires either **files** or **file_urls[]**, but not both * * @return self */ - public function setFileUrls($file_urls) + public function setFileUrls(?array $file_urls) { if (is_null($file_urls)) { - throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -494,10 +482,10 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -521,10 +509,10 @@ public function getCoverPageTo() * * @return self */ - public function setCoverPageTo($cover_page_to) + public function setCoverPageTo(?string $cover_page_to) { if (is_null($cover_page_to)) { - throw new \InvalidArgumentException('non-nullable cover_page_to cannot be null'); + throw new InvalidArgumentException('non-nullable cover_page_to cannot be null'); } $this->container['cover_page_to'] = $cover_page_to; @@ -548,10 +536,10 @@ public function getCoverPageFrom() * * @return self */ - public function setCoverPageFrom($cover_page_from) + public function setCoverPageFrom(?string $cover_page_from) { if (is_null($cover_page_from)) { - throw new \InvalidArgumentException('non-nullable cover_page_from cannot be null'); + throw new InvalidArgumentException('non-nullable cover_page_from cannot be null'); } $this->container['cover_page_from'] = $cover_page_from; @@ -575,10 +563,10 @@ public function getCoverPageMessage() * * @return self */ - public function setCoverPageMessage($cover_page_message) + public function setCoverPageMessage(?string $cover_page_message) { if (is_null($cover_page_message)) { - throw new \InvalidArgumentException('non-nullable cover_page_message cannot be null'); + throw new InvalidArgumentException('non-nullable cover_page_message cannot be null'); } $this->container['cover_page_message'] = $cover_page_message; @@ -602,23 +590,22 @@ public function getTitle() * * @return self */ - public function setTitle($title) + public function setTitle(?string $title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + throw new InvalidArgumentException('non-nullable title cannot be null'); } $this->container['title'] = $title; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -627,11 +614,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -642,10 +629,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -658,11 +643,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -670,12 +653,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -704,5 +687,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/FileResponse.php b/sdks/php/src/Model/FileResponse.php index df7fc7185..82f84a632 100644 --- a/sdks/php/src/Model/FileResponse.php +++ b/sdks/php/src/Model/FileResponse.php @@ -1,14 +1,11 @@ */ -class FileResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class FileResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FileResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'file_url' => 'string', - 'expires_at' => 'int' + 'expires_at' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'file_url' => null, - 'expires_at' => null + 'expires_at' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'file_url' => false, - 'expires_at' => false + 'expires_at' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'file_url' => 'file_url', - 'expires_at' => 'expires_at' + 'expires_at' => 'expires_at', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'file_url' => 'setFileUrl', - 'expires_at' => 'setExpiresAt' + 'expires_at' => 'setExpiresAt', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'file_url' => 'getFileUrl', - 'expires_at' => 'getExpiresAt' + 'expires_at' => 'getExpiresAt', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): FileResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): FileResponse { /** @var FileResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, FileResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -322,7 +310,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets file_url * @@ -336,14 +323,14 @@ public function getFileUrl() /** * Sets file_url * - * @param string $file_url URL to the file. + * @param string $file_url URL to the file * * @return self */ - public function setFileUrl($file_url) + public function setFileUrl(string $file_url) { if (is_null($file_url)) { - throw new \InvalidArgumentException('non-nullable file_url cannot be null'); + throw new InvalidArgumentException('non-nullable file_url cannot be null'); } $this->container['file_url'] = $file_url; @@ -363,27 +350,26 @@ public function getExpiresAt() /** * Sets expires_at * - * @param int $expires_at When the link expires. + * @param int $expires_at when the link expires * * @return self */ - public function setExpiresAt($expires_at) + public function setExpiresAt(int $expires_at) { if (is_null($expires_at)) { - throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + throw new InvalidArgumentException('non-nullable expires_at cannot be null'); } $this->container['expires_at'] = $expires_at; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -392,11 +378,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -407,10 +393,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -423,11 +407,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -435,12 +417,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -469,5 +451,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/FileResponseDataUri.php b/sdks/php/src/Model/FileResponseDataUri.php index 8164ba6fe..98e37dda6 100644 --- a/sdks/php/src/Model/FileResponseDataUri.php +++ b/sdks/php/src/Model/FileResponseDataUri.php @@ -1,14 +1,11 @@ */ -class FileResponseDataUri implements ModelInterface, ArrayAccess, \JsonSerializable +class FileResponseDataUri implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FileResponseDataUri'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'data_uri' => 'string' + 'data_uri' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'data_uri' => null + 'data_uri' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'data_uri' => false + 'data_uri' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,8 +109,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -122,7 +118,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +128,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,9 +137,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -152,9 +145,6 @@ 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 { @@ -168,7 +158,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'data_uri' => 'data_uri' + 'data_uri' => 'data_uri', ]; /** @@ -177,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'data_uri' => 'setDataUri' + 'data_uri' => 'setDataUri', ]; /** @@ -186,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'data_uri' => 'getDataUri' + 'data_uri' => 'getDataUri', ]; /** @@ -230,7 +220,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -242,41 +231,40 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { $this->setIfExists('data_uri', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): FileResponseDataUri { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): FileResponseDataUri { /** @var FileResponseDataUri */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, FileResponseDataUri::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -312,7 +300,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets data_uri * @@ -326,27 +313,26 @@ public function getDataUri() /** * Sets data_uri * - * @param string $data_uri File as base64 encoded string. + * @param string $data_uri file as base64 encoded string * * @return self */ - public function setDataUri($data_uri) + public function setDataUri(string $data_uri) { if (is_null($data_uri)) { - throw new \InvalidArgumentException('non-nullable data_uri cannot be null'); + throw new InvalidArgumentException('non-nullable data_uri cannot be null'); } $this->container['data_uri'] = $data_uri; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -355,11 +341,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -370,10 +356,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -386,11 +370,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -398,12 +380,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -432,5 +414,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/ListInfoResponse.php b/sdks/php/src/Model/ListInfoResponse.php index 4f5deecc3..a036c6d06 100644 --- a/sdks/php/src/Model/ListInfoResponse.php +++ b/sdks/php/src/Model/ListInfoResponse.php @@ -1,14 +1,11 @@ */ -class ListInfoResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class ListInfoResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListInfoResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'num_pages' => 'int', 'num_results' => 'int', 'page' => 'int', - 'page_size' => 'int' + 'page_size' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'num_pages' => null, 'num_results' => null, 'page' => null, - 'page_size' => null + 'page_size' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'num_pages' => false, 'num_results' => true, 'page' => false, - 'page_size' => false + 'page_size' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -121,8 +119,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -132,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -142,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -151,9 +147,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -162,9 +155,6 @@ 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 { @@ -181,7 +171,7 @@ public function isNullableSetToNull(string $property): bool 'num_pages' => 'num_pages', 'num_results' => 'num_results', 'page' => 'page', - 'page_size' => 'page_size' + 'page_size' => 'page_size', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool 'num_pages' => 'setNumPages', 'num_results' => 'setNumResults', 'page' => 'setPage', - 'page_size' => 'setPageSize' + 'page_size' => 'setPageSize', ]; /** @@ -205,7 +195,7 @@ public function isNullableSetToNull(string $property): bool 'num_pages' => 'getNumPages', 'num_results' => 'getNumResults', 'page' => 'getPage', - 'page_size' => 'getPageSize' + 'page_size' => 'getPageSize', ]; /** @@ -249,7 +239,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -261,7 +250,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -271,34 +260,33 @@ public function __construct(?array $data = null) $this->setIfExists('page_size', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ListInfoResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ListInfoResponse { /** @var ListInfoResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, ListInfoResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -315,9 +303,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -331,7 +317,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets num_pages * @@ -345,14 +330,14 @@ public function getNumPages() /** * Sets num_pages * - * @param int|null $num_pages Total number of pages available. + * @param int|null $num_pages total number of pages available * * @return self */ - public function setNumPages($num_pages) + public function setNumPages(?int $num_pages) { if (is_null($num_pages)) { - throw new \InvalidArgumentException('non-nullable num_pages cannot be null'); + throw new InvalidArgumentException('non-nullable num_pages cannot be null'); } $this->container['num_pages'] = $num_pages; @@ -372,17 +357,17 @@ public function getNumResults() /** * Sets num_results * - * @param int|null $num_results Total number of objects available. + * @param int|null $num_results total number of objects available * * @return self */ - public function setNumResults($num_results) + public function setNumResults(?int $num_results) { if (is_null($num_results)) { array_push($this->openAPINullablesSetToNull, 'num_results'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('num_results', $nullablesSetToNull, true); + $index = array_search('num_results', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -406,14 +391,14 @@ public function getPage() /** * Sets page * - * @param int|null $page Number of the page being returned. + * @param int|null $page number of the page being returned * * @return self */ - public function setPage($page) + public function setPage(?int $page) { if (is_null($page)) { - throw new \InvalidArgumentException('non-nullable page cannot be null'); + throw new InvalidArgumentException('non-nullable page cannot be null'); } $this->container['page'] = $page; @@ -433,27 +418,26 @@ public function getPageSize() /** * Sets page_size * - * @param int|null $page_size Objects returned per page. + * @param int|null $page_size objects returned per page * * @return self */ - public function setPageSize($page_size) + public function setPageSize(?int $page_size) { if (is_null($page_size)) { - throw new \InvalidArgumentException('non-nullable page_size cannot be null'); + throw new InvalidArgumentException('non-nullable page_size cannot be null'); } $this->container['page_size'] = $page_size; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -462,11 +446,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -477,10 +461,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -493,11 +475,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -505,12 +485,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -539,5 +519,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/ModelInterface.php b/sdks/php/src/Model/ModelInterface.php index 331da6275..1df0ec6c4 100644 --- a/sdks/php/src/Model/ModelInterface.php +++ b/sdks/php/src/Model/ModelInterface.php @@ -1,14 +1,11 @@ */ -class OAuthTokenGenerateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class OAuthTokenGenerateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OAuthTokenGenerateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'client_id' => 'string', 'client_secret' => 'string', 'code' => 'string', 'grant_type' => 'string', - 'state' => 'string' + 'state' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'client_id' => null, 'client_secret' => null, 'code' => null, 'grant_type' => null, - 'state' => null + 'state' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'client_id' => false, 'client_secret' => false, 'code' => false, 'grant_type' => false, - 'state' => false + 'state' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -123,8 +121,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -134,7 +130,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -144,7 +140,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -153,9 +149,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -164,9 +157,6 @@ 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 { @@ -184,7 +174,7 @@ public function isNullableSetToNull(string $property): bool 'client_secret' => 'client_secret', 'code' => 'code', 'grant_type' => 'grant_type', - 'state' => 'state' + 'state' => 'state', ]; /** @@ -197,7 +187,7 @@ public function isNullableSetToNull(string $property): bool 'client_secret' => 'setClientSecret', 'code' => 'setCode', 'grant_type' => 'setGrantType', - 'state' => 'setState' + 'state' => 'setState', ]; /** @@ -210,7 +200,7 @@ public function isNullableSetToNull(string $property): bool 'client_secret' => 'getClientSecret', 'code' => 'getCode', 'grant_type' => 'getGrantType', - 'state' => 'getState' + 'state' => 'getState', ]; /** @@ -254,7 +244,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -266,7 +255,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -277,34 +266,33 @@ public function __construct(?array $data = null) $this->setIfExists('state', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): OAuthTokenGenerateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): OAuthTokenGenerateRequest { /** @var OAuthTokenGenerateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, OAuthTokenGenerateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -352,7 +340,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets client_id * @@ -366,14 +353,14 @@ public function getClientId() /** * Sets client_id * - * @param string $client_id The client id of the app requesting authorization. + * @param string $client_id the client id of the app requesting authorization * * @return self */ - public function setClientId($client_id) + public function setClientId(string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -393,14 +380,14 @@ public function getClientSecret() /** * Sets client_secret * - * @param string $client_secret The secret token of your app. + * @param string $client_secret the secret token of your app * * @return self */ - public function setClientSecret($client_secret) + public function setClientSecret(string $client_secret) { if (is_null($client_secret)) { - throw new \InvalidArgumentException('non-nullable client_secret cannot be null'); + throw new InvalidArgumentException('non-nullable client_secret cannot be null'); } $this->container['client_secret'] = $client_secret; @@ -420,14 +407,14 @@ public function getCode() /** * Sets code * - * @param string $code The code passed to your callback when the user granted access. + * @param string $code the code passed to your callback when the user granted access * * @return self */ - public function setCode($code) + public function setCode(string $code) { if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); + throw new InvalidArgumentException('non-nullable code cannot be null'); } $this->container['code'] = $code; @@ -447,14 +434,14 @@ public function getGrantType() /** * Sets grant_type * - * @param string $grant_type When generating a new token use `authorization_code`. + * @param string $grant_type when generating a new token use `authorization_code` * * @return self */ - public function setGrantType($grant_type) + public function setGrantType(string $grant_type) { if (is_null($grant_type)) { - throw new \InvalidArgumentException('non-nullable grant_type cannot be null'); + throw new InvalidArgumentException('non-nullable grant_type cannot be null'); } $this->container['grant_type'] = $grant_type; @@ -474,27 +461,26 @@ public function getState() /** * Sets state * - * @param string $state Same as the state you specified earlier. + * @param string $state same as the state you specified earlier * * @return self */ - public function setState($state) + public function setState(string $state) { if (is_null($state)) { - throw new \InvalidArgumentException('non-nullable state cannot be null'); + throw new InvalidArgumentException('non-nullable state cannot be null'); } $this->container['state'] = $state; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -503,11 +489,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -518,10 +504,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -534,11 +518,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -546,12 +528,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -580,5 +562,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/OAuthTokenRefreshRequest.php b/sdks/php/src/Model/OAuthTokenRefreshRequest.php index db7285ad1..d92365095 100644 --- a/sdks/php/src/Model/OAuthTokenRefreshRequest.php +++ b/sdks/php/src/Model/OAuthTokenRefreshRequest.php @@ -1,14 +1,11 @@ */ -class OAuthTokenRefreshRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class OAuthTokenRefreshRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OAuthTokenRefreshRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'grant_type' => 'string', 'refresh_token' => 'string', 'client_id' => 'string', - 'client_secret' => 'string' + 'client_secret' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'grant_type' => null, 'refresh_token' => null, 'client_id' => null, - 'client_secret' => null + 'client_secret' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'grant_type' => false, 'refresh_token' => false, 'client_id' => false, - 'client_secret' => false + 'client_secret' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -120,8 +118,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -131,7 +127,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -141,7 +137,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -150,9 +146,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -161,9 +154,6 @@ 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 { @@ -180,7 +170,7 @@ public function isNullableSetToNull(string $property): bool 'grant_type' => 'grant_type', 'refresh_token' => 'refresh_token', 'client_id' => 'client_id', - 'client_secret' => 'client_secret' + 'client_secret' => 'client_secret', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool 'grant_type' => 'setGrantType', 'refresh_token' => 'setRefreshToken', 'client_id' => 'setClientId', - 'client_secret' => 'setClientSecret' + 'client_secret' => 'setClientSecret', ]; /** @@ -204,7 +194,7 @@ public function isNullableSetToNull(string $property): bool 'grant_type' => 'getGrantType', 'refresh_token' => 'getRefreshToken', 'client_id' => 'getClientId', - 'client_secret' => 'getClientSecret' + 'client_secret' => 'getClientSecret', ]; /** @@ -248,7 +238,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -260,7 +249,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -270,34 +259,33 @@ public function __construct(?array $data = null) $this->setIfExists('client_secret', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): OAuthTokenRefreshRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): OAuthTokenRefreshRequest { /** @var OAuthTokenRefreshRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, OAuthTokenRefreshRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -336,7 +324,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets grant_type * @@ -350,14 +337,14 @@ public function getGrantType() /** * Sets grant_type * - * @param string $grant_type When refreshing an existing token use `refresh_token`. + * @param string $grant_type when refreshing an existing token use `refresh_token` * * @return self */ - public function setGrantType($grant_type) + public function setGrantType(string $grant_type) { if (is_null($grant_type)) { - throw new \InvalidArgumentException('non-nullable grant_type cannot be null'); + throw new InvalidArgumentException('non-nullable grant_type cannot be null'); } $this->container['grant_type'] = $grant_type; @@ -377,14 +364,14 @@ public function getRefreshToken() /** * Sets refresh_token * - * @param string $refresh_token The token provided when you got the expired access token. + * @param string $refresh_token the token provided when you got the expired access token * * @return self */ - public function setRefreshToken($refresh_token) + public function setRefreshToken(string $refresh_token) { if (is_null($refresh_token)) { - throw new \InvalidArgumentException('non-nullable refresh_token cannot be null'); + throw new InvalidArgumentException('non-nullable refresh_token cannot be null'); } $this->container['refresh_token'] = $refresh_token; @@ -408,10 +395,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(?string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -435,23 +422,22 @@ public function getClientSecret() * * @return self */ - public function setClientSecret($client_secret) + public function setClientSecret(?string $client_secret) { if (is_null($client_secret)) { - throw new \InvalidArgumentException('non-nullable client_secret cannot be null'); + throw new InvalidArgumentException('non-nullable client_secret cannot be null'); } $this->container['client_secret'] = $client_secret; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -460,11 +446,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -475,10 +461,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -491,11 +475,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -503,12 +485,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -537,5 +519,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/OAuthTokenResponse.php b/sdks/php/src/Model/OAuthTokenResponse.php index ab2e311f4..72b899309 100644 --- a/sdks/php/src/Model/OAuthTokenResponse.php +++ b/sdks/php/src/Model/OAuthTokenResponse.php @@ -1,14 +1,11 @@ */ -class OAuthTokenResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class OAuthTokenResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OAuthTokenResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'access_token' => 'string', 'token_type' => 'string', 'refresh_token' => 'string', 'expires_in' => 'int', - 'state' => 'string' + 'state' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'access_token' => null, 'token_type' => null, 'refresh_token' => null, 'expires_in' => null, - 'state' => null + 'state' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'access_token' => false, 'token_type' => false, 'refresh_token' => false, 'expires_in' => false, - 'state' => true + 'state' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -123,8 +121,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -134,7 +130,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -144,7 +140,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -153,9 +149,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -164,9 +157,6 @@ 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 { @@ -184,7 +174,7 @@ public function isNullableSetToNull(string $property): bool 'token_type' => 'token_type', 'refresh_token' => 'refresh_token', 'expires_in' => 'expires_in', - 'state' => 'state' + 'state' => 'state', ]; /** @@ -197,7 +187,7 @@ public function isNullableSetToNull(string $property): bool 'token_type' => 'setTokenType', 'refresh_token' => 'setRefreshToken', 'expires_in' => 'setExpiresIn', - 'state' => 'setState' + 'state' => 'setState', ]; /** @@ -210,7 +200,7 @@ public function isNullableSetToNull(string $property): bool 'token_type' => 'getTokenType', 'refresh_token' => 'getRefreshToken', 'expires_in' => 'getExpiresIn', - 'state' => 'getState' + 'state' => 'getState', ]; /** @@ -254,7 +244,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -266,7 +255,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -277,34 +266,33 @@ public function __construct(?array $data = null) $this->setIfExists('state', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): OAuthTokenResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): OAuthTokenResponse { /** @var OAuthTokenResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, OAuthTokenResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -321,9 +309,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -337,7 +323,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets access_token * @@ -355,10 +340,10 @@ public function getAccessToken() * * @return self */ - public function setAccessToken($access_token) + public function setAccessToken(?string $access_token) { if (is_null($access_token)) { - throw new \InvalidArgumentException('non-nullable access_token cannot be null'); + throw new InvalidArgumentException('non-nullable access_token cannot be null'); } $this->container['access_token'] = $access_token; @@ -382,10 +367,10 @@ public function getTokenType() * * @return self */ - public function setTokenType($token_type) + public function setTokenType(?string $token_type) { if (is_null($token_type)) { - throw new \InvalidArgumentException('non-nullable token_type cannot be null'); + throw new InvalidArgumentException('non-nullable token_type cannot be null'); } $this->container['token_type'] = $token_type; @@ -409,10 +394,10 @@ public function getRefreshToken() * * @return self */ - public function setRefreshToken($refresh_token) + public function setRefreshToken(?string $refresh_token) { if (is_null($refresh_token)) { - throw new \InvalidArgumentException('non-nullable refresh_token cannot be null'); + throw new InvalidArgumentException('non-nullable refresh_token cannot be null'); } $this->container['refresh_token'] = $refresh_token; @@ -436,10 +421,10 @@ public function getExpiresIn() * * @return self */ - public function setExpiresIn($expires_in) + public function setExpiresIn(?int $expires_in) { if (is_null($expires_in)) { - throw new \InvalidArgumentException('non-nullable expires_in cannot be null'); + throw new InvalidArgumentException('non-nullable expires_in cannot be null'); } $this->container['expires_in'] = $expires_in; @@ -463,13 +448,13 @@ public function getState() * * @return self */ - public function setState($state) + public function setState(?string $state) { if (is_null($state)) { array_push($this->openAPINullablesSetToNull, 'state'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('state', $nullablesSetToNull, true); + $index = array_search('state', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -479,14 +464,13 @@ public function setState($state) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -495,11 +479,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -510,10 +494,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -526,11 +508,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -538,12 +518,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -572,5 +552,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/ReportCreateRequest.php b/sdks/php/src/Model/ReportCreateRequest.php index 42995e896..f2aefab1b 100644 --- a/sdks/php/src/Model/ReportCreateRequest.php +++ b/sdks/php/src/Model/ReportCreateRequest.php @@ -1,14 +1,11 @@ */ -class ReportCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class ReportCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ReportCreateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'end_date' => 'string', 'report_type' => 'string[]', - 'start_date' => 'string' + 'start_date' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'end_date' => null, 'report_type' => null, - 'start_date' => null + 'start_date' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'end_date' => false, 'report_type' => false, - 'start_date' => false + 'start_date' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'end_date' => 'end_date', 'report_type' => 'report_type', - 'start_date' => 'start_date' + 'start_date' => 'start_date', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'end_date' => 'setEndDate', 'report_type' => 'setReportType', - 'start_date' => 'setStartDate' + 'start_date' => 'setStartDate', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'end_date' => 'getEndDate', 'report_type' => 'getReportType', - 'start_date' => 'getStartDate' + 'start_date' => 'getStartDate', ]; /** @@ -269,7 +259,7 @@ public function getReportTypeAllowableValues() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -278,34 +268,33 @@ public function __construct(?array $data = null) $this->setIfExists('start_date', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ReportCreateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ReportCreateRequest { /** @var ReportCreateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, ReportCreateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -330,11 +319,11 @@ public function listInvalidProperties() if ($this->container['report_type'] === null) { $invalidProperties[] = "'report_type' can't be null"; } - if ((count($this->container['report_type']) > 2)) { + if (count($this->container['report_type']) > 2) { $invalidProperties[] = "invalid value for 'report_type', number of items must be less than or equal to 2."; } - if ((count($this->container['report_type']) < 1)) { + if (count($this->container['report_type']) < 1) { $invalidProperties[] = "invalid value for 'report_type', number of items must be greater than or equal to 1."; } @@ -355,7 +344,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets end_date * @@ -369,14 +357,14 @@ public function getEndDate() /** * Sets end_date * - * @param string $end_date The (inclusive) end date for the report data in `MM/DD/YYYY` format. + * @param string $end_date the (inclusive) end date for the report data in `MM/DD/YYYY` format * * @return self */ - public function setEndDate($end_date) + public function setEndDate(string $end_date) { if (is_null($end_date)) { - throw new \InvalidArgumentException('non-nullable end_date cannot be null'); + throw new InvalidArgumentException('non-nullable end_date cannot be null'); } $this->container['end_date'] = $end_date; @@ -400,14 +388,14 @@ public function getReportType() * * @return self */ - public function setReportType($report_type) + public function setReportType(array $report_type) { if (is_null($report_type)) { - throw new \InvalidArgumentException('non-nullable report_type cannot be null'); + throw new InvalidArgumentException('non-nullable report_type cannot be null'); } $allowedValues = $this->getReportTypeAllowableValues(); if (array_diff($report_type, $allowedValues)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value for 'report_type', must be one of '%s'", implode("', '", $allowedValues) @@ -415,11 +403,11 @@ public function setReportType($report_type) ); } - if ((count($report_type) > 2)) { - throw new \InvalidArgumentException('invalid value for $report_type when calling ReportCreateRequest., number of items must be less than or equal to 2.'); + if (count($report_type) > 2) { + throw new InvalidArgumentException('invalid value for $report_type when calling ReportCreateRequest., number of items must be less than or equal to 2.'); } - if ((count($report_type) < 1)) { - throw new \InvalidArgumentException('invalid length for $report_type when calling ReportCreateRequest., number of items must be greater than or equal to 1.'); + if (count($report_type) < 1) { + throw new InvalidArgumentException('invalid length for $report_type when calling ReportCreateRequest., number of items must be greater than or equal to 1.'); } $this->container['report_type'] = $report_type; @@ -439,27 +427,26 @@ public function getStartDate() /** * Sets start_date * - * @param string $start_date The (inclusive) start date for the report data in `MM/DD/YYYY` format. + * @param string $start_date the (inclusive) start date for the report data in `MM/DD/YYYY` format * * @return self */ - public function setStartDate($start_date) + public function setStartDate(string $start_date) { if (is_null($start_date)) { - throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + throw new InvalidArgumentException('non-nullable start_date cannot be null'); } $this->container['start_date'] = $start_date; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -468,11 +455,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -483,10 +470,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -499,11 +484,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -511,12 +494,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -545,5 +528,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/ReportCreateResponse.php b/sdks/php/src/Model/ReportCreateResponse.php index 5ba20adf4..bc712c962 100644 --- a/sdks/php/src/Model/ReportCreateResponse.php +++ b/sdks/php/src/Model/ReportCreateResponse.php @@ -1,14 +1,11 @@ */ -class ReportCreateResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class ReportCreateResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ReportCreateResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'report' => '\Dropbox\Sign\Model\ReportResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'report' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'report' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'report' => 'report', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'report' => 'setReport', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'report' => 'getReport', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ReportCreateResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ReportCreateResponse { /** @var ReportCreateResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, ReportCreateResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,7 +307,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets report * @@ -337,10 +324,10 @@ public function getReport() * * @return self */ - public function setReport($report) + public function setReport(ReportResponse $report) { if (is_null($report)) { - throw new \InvalidArgumentException('non-nullable report cannot be null'); + throw new InvalidArgumentException('non-nullable report cannot be null'); } $this->container['report'] = $report; @@ -360,27 +347,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -389,11 +375,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -404,10 +390,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -420,11 +404,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -432,12 +414,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -466,5 +448,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/ReportResponse.php b/sdks/php/src/Model/ReportResponse.php index 6ffa90c81..537eb9293 100644 --- a/sdks/php/src/Model/ReportResponse.php +++ b/sdks/php/src/Model/ReportResponse.php @@ -1,14 +1,11 @@ */ -class ReportResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class ReportResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ReportResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'success' => 'string', 'start_date' => 'string', 'end_date' => 'string', - 'report_type' => 'string[]' + 'report_type' => 'string[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'success' => null, 'start_date' => null, 'end_date' => null, - 'report_type' => null + 'report_type' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'success' => false, 'start_date' => false, 'end_date' => false, - 'report_type' => false + 'report_type' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -121,8 +119,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -132,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -142,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -151,9 +147,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -162,9 +155,6 @@ 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 { @@ -181,7 +171,7 @@ public function isNullableSetToNull(string $property): bool 'success' => 'success', 'start_date' => 'start_date', 'end_date' => 'end_date', - 'report_type' => 'report_type' + 'report_type' => 'report_type', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool 'success' => 'setSuccess', 'start_date' => 'setStartDate', 'end_date' => 'setEndDate', - 'report_type' => 'setReportType' + 'report_type' => 'setReportType', ]; /** @@ -205,7 +195,7 @@ public function isNullableSetToNull(string $property): bool 'success' => 'getSuccess', 'start_date' => 'getStartDate', 'end_date' => 'getEndDate', - 'report_type' => 'getReportType' + 'report_type' => 'getReportType', ]; /** @@ -276,7 +266,7 @@ public function getReportTypeAllowableValues() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -286,34 +276,33 @@ public function __construct(?array $data = null) $this->setIfExists('report_type', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ReportResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ReportResponse { /** @var ReportResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, ReportResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -330,9 +319,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -346,7 +333,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets success * @@ -364,10 +350,10 @@ public function getSuccess() * * @return self */ - public function setSuccess($success) + public function setSuccess(?string $success) { if (is_null($success)) { - throw new \InvalidArgumentException('non-nullable success cannot be null'); + throw new InvalidArgumentException('non-nullable success cannot be null'); } $this->container['success'] = $success; @@ -387,14 +373,14 @@ public function getStartDate() /** * Sets start_date * - * @param string|null $start_date The (inclusive) start date for the report data in MM/DD/YYYY format. + * @param string|null $start_date the (inclusive) start date for the report data in MM/DD/YYYY format * * @return self */ - public function setStartDate($start_date) + public function setStartDate(?string $start_date) { if (is_null($start_date)) { - throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + throw new InvalidArgumentException('non-nullable start_date cannot be null'); } $this->container['start_date'] = $start_date; @@ -414,14 +400,14 @@ public function getEndDate() /** * Sets end_date * - * @param string|null $end_date The (inclusive) end date for the report data in MM/DD/YYYY format. + * @param string|null $end_date the (inclusive) end date for the report data in MM/DD/YYYY format * * @return self */ - public function setEndDate($end_date) + public function setEndDate(?string $end_date) { if (is_null($end_date)) { - throw new \InvalidArgumentException('non-nullable end_date cannot be null'); + throw new InvalidArgumentException('non-nullable end_date cannot be null'); } $this->container['end_date'] = $end_date; @@ -445,14 +431,14 @@ public function getReportType() * * @return self */ - public function setReportType($report_type) + public function setReportType(?array $report_type) { if (is_null($report_type)) { - throw new \InvalidArgumentException('non-nullable report_type cannot be null'); + throw new InvalidArgumentException('non-nullable report_type cannot be null'); } $allowedValues = $this->getReportTypeAllowableValues(); if (array_diff($report_type, $allowedValues)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value for 'report_type', must be one of '%s'", implode("', '", $allowedValues) @@ -463,14 +449,13 @@ public function setReportType($report_type) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -479,11 +464,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -494,10 +479,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -510,11 +493,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -522,12 +503,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -556,5 +537,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.php index da74a6fb9..1874fd232 100644 --- a/sdks/php/src/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.php @@ -1,14 +1,11 @@ */ -class SignatureRequestBulkCreateEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestBulkCreateEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestBulkCreateEmbeddedWithTemplateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template_ids' => 'string[]', 'client_id' => 'string', @@ -71,16 +70,16 @@ class SignatureRequestBulkCreateEmbeddedWithTemplateRequest implements ModelInte 'signing_redirect_url' => 'string', 'subject' => 'string', 'test_mode' => 'bool', - 'title' => 'string' + 'title' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template_ids' => null, 'client_id' => null, @@ -94,14 +93,14 @@ class SignatureRequestBulkCreateEmbeddedWithTemplateRequest implements ModelInte 'signing_redirect_url' => null, 'subject' => null, 'test_mode' => null, - 'title' => null + 'title' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'template_ids' => false, 'client_id' => false, @@ -115,14 +114,14 @@ class SignatureRequestBulkCreateEmbeddedWithTemplateRequest implements ModelInte 'signing_redirect_url' => false, 'subject' => false, 'test_mode' => false, - 'title' => false + 'title' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -147,8 +146,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -158,7 +155,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -168,7 +165,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -177,9 +174,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -188,9 +182,6 @@ 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 { @@ -216,7 +207,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'signing_redirect_url', 'subject' => 'subject', 'test_mode' => 'test_mode', - 'title' => 'title' + 'title' => 'title', ]; /** @@ -237,7 +228,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'setSigningRedirectUrl', 'subject' => 'setSubject', 'test_mode' => 'setTestMode', - 'title' => 'setTitle' + 'title' => 'setTitle', ]; /** @@ -258,7 +249,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'getSigningRedirectUrl', 'subject' => 'getSubject', 'test_mode' => 'getTestMode', - 'title' => 'getTitle' + 'title' => 'getTitle', ]; /** @@ -302,7 +293,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -314,7 +304,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -333,34 +323,33 @@ public function __construct(?array $data = null) $this->setIfExists('title', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestBulkCreateEmbeddedWithTemplateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestBulkCreateEmbeddedWithTemplateRequest { /** @var SignatureRequestBulkCreateEmbeddedWithTemplateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestBulkCreateEmbeddedWithTemplateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -411,7 +400,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets template_ids * @@ -425,14 +413,14 @@ public function getTemplateIds() /** * Sets template_ids * - * @param string[] $template_ids Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + * @param string[] $template_ids use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used * * @return self */ - public function setTemplateIds($template_ids) + public function setTemplateIds(array $template_ids) { if (is_null($template_ids)) { - throw new \InvalidArgumentException('non-nullable template_ids cannot be null'); + throw new InvalidArgumentException('non-nullable template_ids cannot be null'); } $this->container['template_ids'] = $template_ids; @@ -456,10 +444,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -469,7 +457,7 @@ public function setClientId($client_id) /** * Gets signer_file * - * @return \SplFileObject|null + * @return SplFileObject|null */ public function getSignerFile() { @@ -479,14 +467,14 @@ public function getSignerFile() /** * Sets signer_file * - * @param \SplFileObject|null $signer_file `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` + * @param SplFileObject|null $signer_file `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` * * @return self */ - public function setSignerFile($signer_file) + public function setSignerFile(?SplFileObject $signer_file) { if (is_null($signer_file)) { - throw new \InvalidArgumentException('non-nullable signer_file cannot be null'); + throw new InvalidArgumentException('non-nullable signer_file cannot be null'); } $this->container['signer_file'] = $signer_file; @@ -510,10 +498,10 @@ public function getSignerList() * * @return self */ - public function setSignerList($signer_list) + public function setSignerList(?array $signer_list) { if (is_null($signer_list)) { - throw new \InvalidArgumentException('non-nullable signer_list cannot be null'); + throw new InvalidArgumentException('non-nullable signer_list cannot be null'); } $this->container['signer_list'] = $signer_list; @@ -537,10 +525,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline($allow_decline) + public function setAllowDecline(?bool $allow_decline) { if (is_null($allow_decline)) { - throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -564,10 +552,10 @@ public function getCcs() * * @return self */ - public function setCcs($ccs) + public function setCcs(?array $ccs) { if (is_null($ccs)) { - throw new \InvalidArgumentException('non-nullable ccs cannot be null'); + throw new InvalidArgumentException('non-nullable ccs cannot be null'); } $this->container['ccs'] = $ccs; @@ -591,10 +579,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields($custom_fields) + public function setCustomFields(?array $custom_fields) { if (is_null($custom_fields)) { - throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -614,17 +602,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message The custom message in the email that will be sent to the signers. + * @param string|null $message the custom message in the email that will be sent to the signers * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + throw new InvalidArgumentException('non-nullable message cannot be null'); } - if ((mb_strlen($message) > 5000)) { - throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestBulkCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestBulkCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -649,13 +637,12 @@ public function getMetadata() * * @return self */ - public function setMetadata($metadata) + public function setMetadata(?array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } - $this->container['metadata'] = $metadata; return $this; @@ -674,14 +661,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. + * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign * * @return self */ - public function setSigningRedirectUrl($signing_redirect_url) + public function setSigningRedirectUrl(?string $signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -701,17 +688,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject The subject in the email that will be sent to the signers. + * @param string|null $subject the subject in the email that will be sent to the signers * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { - throw new \InvalidArgumentException('non-nullable subject cannot be null'); + throw new InvalidArgumentException('non-nullable subject cannot be null'); } - if ((mb_strlen($subject) > 255)) { - throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestBulkCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); + if (mb_strlen($subject) > 255) { + throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestBulkCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -736,10 +723,10 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -759,31 +746,30 @@ public function getTitle() /** * Sets title * - * @param string|null $title The title you want to assign to the SignatureRequest. + * @param string|null $title the title you want to assign to the SignatureRequest * * @return self */ - public function setTitle($title) + public function setTitle(?string $title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + throw new InvalidArgumentException('non-nullable title cannot be null'); } - if ((mb_strlen($title) > 255)) { - throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestBulkCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); + if (mb_strlen($title) > 255) { + throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestBulkCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -792,11 +778,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -807,10 +793,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -823,11 +807,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -835,12 +817,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -869,5 +851,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestBulkSendWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestBulkSendWithTemplateRequest.php index a9bd87d1d..1e85b4445 100644 --- a/sdks/php/src/Model/SignatureRequestBulkSendWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestBulkSendWithTemplateRequest.php @@ -1,14 +1,11 @@ */ -class SignatureRequestBulkSendWithTemplateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestBulkSendWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestBulkSendWithTemplateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template_ids' => 'string[]', 'signer_file' => '\SplFileObject', @@ -71,16 +70,16 @@ class SignatureRequestBulkSendWithTemplateRequest implements ModelInterface, Arr 'signing_redirect_url' => 'string', 'subject' => 'string', 'test_mode' => 'bool', - 'title' => 'string' + 'title' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template_ids' => null, 'signer_file' => 'binary', @@ -94,14 +93,14 @@ class SignatureRequestBulkSendWithTemplateRequest implements ModelInterface, Arr 'signing_redirect_url' => null, 'subject' => null, 'test_mode' => null, - 'title' => null + 'title' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'template_ids' => false, 'signer_file' => false, @@ -115,14 +114,14 @@ class SignatureRequestBulkSendWithTemplateRequest implements ModelInterface, Arr 'signing_redirect_url' => false, 'subject' => false, 'test_mode' => false, - 'title' => false + 'title' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -147,8 +146,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -158,7 +155,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -168,7 +165,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -177,9 +174,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -188,9 +182,6 @@ 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 { @@ -216,7 +207,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'signing_redirect_url', 'subject' => 'subject', 'test_mode' => 'test_mode', - 'title' => 'title' + 'title' => 'title', ]; /** @@ -237,7 +228,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'setSigningRedirectUrl', 'subject' => 'setSubject', 'test_mode' => 'setTestMode', - 'title' => 'setTitle' + 'title' => 'setTitle', ]; /** @@ -258,7 +249,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'getSigningRedirectUrl', 'subject' => 'getSubject', 'test_mode' => 'getTestMode', - 'title' => 'getTitle' + 'title' => 'getTitle', ]; /** @@ -302,7 +293,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -314,7 +304,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -333,34 +323,33 @@ public function __construct(?array $data = null) $this->setIfExists('title', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestBulkSendWithTemplateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestBulkSendWithTemplateRequest { /** @var SignatureRequestBulkSendWithTemplateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestBulkSendWithTemplateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -408,7 +397,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets template_ids * @@ -422,14 +410,14 @@ public function getTemplateIds() /** * Sets template_ids * - * @param string[] $template_ids Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + * @param string[] $template_ids use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used * * @return self */ - public function setTemplateIds($template_ids) + public function setTemplateIds(array $template_ids) { if (is_null($template_ids)) { - throw new \InvalidArgumentException('non-nullable template_ids cannot be null'); + throw new InvalidArgumentException('non-nullable template_ids cannot be null'); } $this->container['template_ids'] = $template_ids; @@ -439,7 +427,7 @@ public function setTemplateIds($template_ids) /** * Gets signer_file * - * @return \SplFileObject|null + * @return SplFileObject|null */ public function getSignerFile() { @@ -449,14 +437,14 @@ public function getSignerFile() /** * Sets signer_file * - * @param \SplFileObject|null $signer_file `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` + * @param SplFileObject|null $signer_file `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` * * @return self */ - public function setSignerFile($signer_file) + public function setSignerFile(?SplFileObject $signer_file) { if (is_null($signer_file)) { - throw new \InvalidArgumentException('non-nullable signer_file cannot be null'); + throw new InvalidArgumentException('non-nullable signer_file cannot be null'); } $this->container['signer_file'] = $signer_file; @@ -480,10 +468,10 @@ public function getSignerList() * * @return self */ - public function setSignerList($signer_list) + public function setSignerList(?array $signer_list) { if (is_null($signer_list)) { - throw new \InvalidArgumentException('non-nullable signer_list cannot be null'); + throw new InvalidArgumentException('non-nullable signer_list cannot be null'); } $this->container['signer_list'] = $signer_list; @@ -507,10 +495,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline($allow_decline) + public function setAllowDecline(?bool $allow_decline) { if (is_null($allow_decline)) { - throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -534,10 +522,10 @@ public function getCcs() * * @return self */ - public function setCcs($ccs) + public function setCcs(?array $ccs) { if (is_null($ccs)) { - throw new \InvalidArgumentException('non-nullable ccs cannot be null'); + throw new InvalidArgumentException('non-nullable ccs cannot be null'); } $this->container['ccs'] = $ccs; @@ -561,10 +549,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(?string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -588,10 +576,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields($custom_fields) + public function setCustomFields(?array $custom_fields) { if (is_null($custom_fields)) { - throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -611,17 +599,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message The custom message in the email that will be sent to the signers. + * @param string|null $message the custom message in the email that will be sent to the signers * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + throw new InvalidArgumentException('non-nullable message cannot be null'); } - if ((mb_strlen($message) > 5000)) { - throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestBulkSendWithTemplateRequest., must be smaller than or equal to 5000.'); + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestBulkSendWithTemplateRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -646,13 +634,12 @@ public function getMetadata() * * @return self */ - public function setMetadata($metadata) + public function setMetadata(?array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } - $this->container['metadata'] = $metadata; return $this; @@ -671,14 +658,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. + * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign * * @return self */ - public function setSigningRedirectUrl($signing_redirect_url) + public function setSigningRedirectUrl(?string $signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -698,17 +685,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject The subject in the email that will be sent to the signers. + * @param string|null $subject the subject in the email that will be sent to the signers * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { - throw new \InvalidArgumentException('non-nullable subject cannot be null'); + throw new InvalidArgumentException('non-nullable subject cannot be null'); } - if ((mb_strlen($subject) > 255)) { - throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestBulkSendWithTemplateRequest., must be smaller than or equal to 255.'); + if (mb_strlen($subject) > 255) { + throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestBulkSendWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -733,10 +720,10 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -756,31 +743,30 @@ public function getTitle() /** * Sets title * - * @param string|null $title The title you want to assign to the SignatureRequest. + * @param string|null $title the title you want to assign to the SignatureRequest * * @return self */ - public function setTitle($title) + public function setTitle(?string $title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + throw new InvalidArgumentException('non-nullable title cannot be null'); } - if ((mb_strlen($title) > 255)) { - throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestBulkSendWithTemplateRequest., must be smaller than or equal to 255.'); + if (mb_strlen($title) > 255) { + throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestBulkSendWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -789,11 +775,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -804,10 +790,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -820,11 +804,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -832,12 +814,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -866,5 +848,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestCreateEmbeddedRequest.php b/sdks/php/src/Model/SignatureRequestCreateEmbeddedRequest.php index 0ce71fc64..badc3ea00 100644 --- a/sdks/php/src/Model/SignatureRequestCreateEmbeddedRequest.php +++ b/sdks/php/src/Model/SignatureRequestCreateEmbeddedRequest.php @@ -1,14 +1,11 @@ */ -class SignatureRequestCreateEmbeddedRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestCreateEmbeddedRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestCreateEmbeddedRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'client_id' => 'string', 'files' => '\SplFileObject[]', @@ -82,16 +81,16 @@ class SignatureRequestCreateEmbeddedRequest implements ModelInterface, ArrayAcce 'title' => 'string', 'use_text_tags' => 'bool', 'populate_auto_fill_fields' => 'bool', - 'expires_at' => 'int' + 'expires_at' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'client_id' => null, 'files' => 'binary', @@ -116,14 +115,14 @@ class SignatureRequestCreateEmbeddedRequest implements ModelInterface, ArrayAcce 'title' => null, 'use_text_tags' => null, 'populate_auto_fill_fields' => null, - 'expires_at' => null + 'expires_at' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'client_id' => false, 'files' => false, @@ -148,14 +147,14 @@ class SignatureRequestCreateEmbeddedRequest implements ModelInterface, ArrayAcce 'title' => false, 'use_text_tags' => false, 'populate_auto_fill_fields' => false, - 'expires_at' => true + 'expires_at' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -180,8 +179,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -191,7 +188,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -201,7 +198,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -210,9 +207,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -221,9 +215,6 @@ 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 { @@ -260,7 +251,7 @@ public function isNullableSetToNull(string $property): bool 'title' => 'title', 'use_text_tags' => 'use_text_tags', 'populate_auto_fill_fields' => 'populate_auto_fill_fields', - 'expires_at' => 'expires_at' + 'expires_at' => 'expires_at', ]; /** @@ -292,7 +283,7 @@ public function isNullableSetToNull(string $property): bool 'title' => 'setTitle', 'use_text_tags' => 'setUseTextTags', 'populate_auto_fill_fields' => 'setPopulateAutoFillFields', - 'expires_at' => 'setExpiresAt' + 'expires_at' => 'setExpiresAt', ]; /** @@ -324,7 +315,7 @@ public function isNullableSetToNull(string $property): bool 'title' => 'getTitle', 'use_text_tags' => 'getUseTextTags', 'populate_auto_fill_fields' => 'getPopulateAutoFillFields', - 'expires_at' => 'getExpiresAt' + 'expires_at' => 'getExpiresAt', ]; /** @@ -368,7 +359,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -380,7 +370,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -410,34 +400,33 @@ public function __construct(?array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestCreateEmbeddedRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestCreateEmbeddedRequest { /** @var SignatureRequestCreateEmbeddedRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestCreateEmbeddedRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -485,7 +474,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets client_id * @@ -503,10 +491,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -516,7 +504,7 @@ public function setClientId($client_id) /** * Gets files * - * @return \SplFileObject[]|null + * @return SplFileObject[]|null */ public function getFiles() { @@ -526,14 +514,14 @@ public function getFiles() /** * Sets files * - * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles($files) + public function setFiles(?array $files) { if (is_null($files)) { - throw new \InvalidArgumentException('non-nullable files cannot be null'); + throw new InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -557,10 +545,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls($file_urls) + public function setFileUrls(?array $file_urls) { if (is_null($file_urls)) { - throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -584,10 +572,10 @@ public function getSigners() * * @return self */ - public function setSigners($signers) + public function setSigners(?array $signers) { if (is_null($signers)) { - throw new \InvalidArgumentException('non-nullable signers cannot be null'); + throw new InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -611,10 +599,10 @@ public function getGroupedSigners() * * @return self */ - public function setGroupedSigners($grouped_signers) + public function setGroupedSigners(?array $grouped_signers) { if (is_null($grouped_signers)) { - throw new \InvalidArgumentException('non-nullable grouped_signers cannot be null'); + throw new InvalidArgumentException('non-nullable grouped_signers cannot be null'); } $this->container['grouped_signers'] = $grouped_signers; @@ -638,10 +626,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline($allow_decline) + public function setAllowDecline(?bool $allow_decline) { if (is_null($allow_decline)) { - throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -665,10 +653,10 @@ public function getAllowReassign() * * @return self */ - public function setAllowReassign($allow_reassign) + public function setAllowReassign(?bool $allow_reassign) { if (is_null($allow_reassign)) { - throw new \InvalidArgumentException('non-nullable allow_reassign cannot be null'); + throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); } $this->container['allow_reassign'] = $allow_reassign; @@ -692,10 +680,10 @@ public function getAttachments() * * @return self */ - public function setAttachments($attachments) + public function setAttachments(?array $attachments) { if (is_null($attachments)) { - throw new \InvalidArgumentException('non-nullable attachments cannot be null'); + throw new InvalidArgumentException('non-nullable attachments cannot be null'); } $this->container['attachments'] = $attachments; @@ -715,14 +703,14 @@ public function getCcEmailAddresses() /** * Sets cc_email_addresses * - * @param string[]|null $cc_email_addresses The email addresses that should be CCed. + * @param string[]|null $cc_email_addresses the email addresses that should be CCed * * @return self */ - public function setCcEmailAddresses($cc_email_addresses) + public function setCcEmailAddresses(?array $cc_email_addresses) { if (is_null($cc_email_addresses)) { - throw new \InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); } $this->container['cc_email_addresses'] = $cc_email_addresses; @@ -746,10 +734,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields($custom_fields) + public function setCustomFields(?array $custom_fields) { if (is_null($custom_fields)) { - throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -773,10 +761,10 @@ public function getFieldOptions() * * @return self */ - public function setFieldOptions($field_options) + public function setFieldOptions(?SubFieldOptions $field_options) { if (is_null($field_options)) { - throw new \InvalidArgumentException('non-nullable field_options cannot be null'); + throw new InvalidArgumentException('non-nullable field_options cannot be null'); } $this->container['field_options'] = $field_options; @@ -800,10 +788,10 @@ public function getFormFieldGroups() * * @return self */ - public function setFormFieldGroups($form_field_groups) + public function setFormFieldGroups(?array $form_field_groups) { if (is_null($form_field_groups)) { - throw new \InvalidArgumentException('non-nullable form_field_groups cannot be null'); + throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); } $this->container['form_field_groups'] = $form_field_groups; @@ -823,14 +811,14 @@ public function getFormFieldRules() /** * Sets form_field_rules * - * @param SubFormFieldRule[]|null $form_field_rules Conditional Logic rules for fields defined in `form_fields_per_document`. + * @param SubFormFieldRule[]|null $form_field_rules conditional Logic rules for fields defined in `form_fields_per_document` * * @return self */ - public function setFormFieldRules($form_field_rules) + public function setFormFieldRules(?array $form_field_rules) { if (is_null($form_field_rules)) { - throw new \InvalidArgumentException('non-nullable form_field_rules cannot be null'); + throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); } $this->container['form_field_rules'] = $form_field_rules; @@ -854,10 +842,10 @@ public function getFormFieldsPerDocument() * * @return self */ - public function setFormFieldsPerDocument($form_fields_per_document) + public function setFormFieldsPerDocument(?array $form_fields_per_document) { if (is_null($form_fields_per_document)) { - throw new \InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); } $this->container['form_fields_per_document'] = $form_fields_per_document; @@ -881,10 +869,10 @@ public function getHideTextTags() * * @return self */ - public function setHideTextTags($hide_text_tags) + public function setHideTextTags(?bool $hide_text_tags) { if (is_null($hide_text_tags)) { - throw new \InvalidArgumentException('non-nullable hide_text_tags cannot be null'); + throw new InvalidArgumentException('non-nullable hide_text_tags cannot be null'); } $this->container['hide_text_tags'] = $hide_text_tags; @@ -904,17 +892,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message The custom message in the email that will be sent to the signers. + * @param string|null $message the custom message in the email that will be sent to the signers * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + throw new InvalidArgumentException('non-nullable message cannot be null'); } - if ((mb_strlen($message) > 5000)) { - throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestCreateEmbeddedRequest., must be smaller than or equal to 5000.'); + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestCreateEmbeddedRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -939,13 +927,12 @@ public function getMetadata() * * @return self */ - public function setMetadata($metadata) + public function setMetadata(?array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } - $this->container['metadata'] = $metadata; return $this; @@ -968,10 +955,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions($signing_options) + public function setSigningOptions(?SubSigningOptions $signing_options) { if (is_null($signing_options)) { - throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -991,17 +978,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject The subject in the email that will be sent to the signers. + * @param string|null $subject the subject in the email that will be sent to the signers * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { - throw new \InvalidArgumentException('non-nullable subject cannot be null'); + throw new InvalidArgumentException('non-nullable subject cannot be null'); } - if ((mb_strlen($subject) > 255)) { - throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestCreateEmbeddedRequest., must be smaller than or equal to 255.'); + if (mb_strlen($subject) > 255) { + throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestCreateEmbeddedRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -1026,10 +1013,10 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -1049,17 +1036,17 @@ public function getTitle() /** * Sets title * - * @param string|null $title The title you want to assign to the SignatureRequest. + * @param string|null $title the title you want to assign to the SignatureRequest * * @return self */ - public function setTitle($title) + public function setTitle(?string $title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + throw new InvalidArgumentException('non-nullable title cannot be null'); } - if ((mb_strlen($title) > 255)) { - throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestCreateEmbeddedRequest., must be smaller than or equal to 255.'); + if (mb_strlen($title) > 255) { + throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestCreateEmbeddedRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; @@ -1084,10 +1071,10 @@ public function getUseTextTags() * * @return self */ - public function setUseTextTags($use_text_tags) + public function setUseTextTags(?bool $use_text_tags) { if (is_null($use_text_tags)) { - throw new \InvalidArgumentException('non-nullable use_text_tags cannot be null'); + throw new InvalidArgumentException('non-nullable use_text_tags cannot be null'); } $this->container['use_text_tags'] = $use_text_tags; @@ -1111,10 +1098,10 @@ public function getPopulateAutoFillFields() * * @return self */ - public function setPopulateAutoFillFields($populate_auto_fill_fields) + public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) { if (is_null($populate_auto_fill_fields)) { - throw new \InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); + throw new InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); } $this->container['populate_auto_fill_fields'] = $populate_auto_fill_fields; @@ -1138,13 +1125,13 @@ public function getExpiresAt() * * @return self */ - public function setExpiresAt($expires_at) + public function setExpiresAt(?int $expires_at) { if (is_null($expires_at)) { array_push($this->openAPINullablesSetToNull, 'expires_at'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('expires_at', $nullablesSetToNull, true); + $index = array_search('expires_at', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1154,14 +1141,13 @@ public function setExpiresAt($expires_at) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1170,11 +1156,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1185,10 +1171,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1201,11 +1185,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1213,12 +1195,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1247,5 +1229,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.php index 83334eeae..4f5b84e26 100644 --- a/sdks/php/src/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.php @@ -1,14 +1,11 @@ */ -class SignatureRequestCreateEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestCreateEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestCreateEmbeddedWithTemplateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template_ids' => 'string[]', 'client_id' => 'string', @@ -73,16 +72,16 @@ class SignatureRequestCreateEmbeddedWithTemplateRequest implements ModelInterfac 'subject' => 'string', 'test_mode' => 'bool', 'title' => 'string', - 'populate_auto_fill_fields' => 'bool' + 'populate_auto_fill_fields' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template_ids' => null, 'client_id' => null, @@ -98,14 +97,14 @@ class SignatureRequestCreateEmbeddedWithTemplateRequest implements ModelInterfac 'subject' => null, 'test_mode' => null, 'title' => null, - 'populate_auto_fill_fields' => null + 'populate_auto_fill_fields' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'template_ids' => false, 'client_id' => false, @@ -121,14 +120,14 @@ class SignatureRequestCreateEmbeddedWithTemplateRequest implements ModelInterfac 'subject' => false, 'test_mode' => false, 'title' => false, - 'populate_auto_fill_fields' => false + 'populate_auto_fill_fields' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -153,8 +152,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -164,7 +161,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -174,7 +171,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -183,9 +180,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -194,9 +188,6 @@ 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 { @@ -224,7 +215,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'subject', 'test_mode' => 'test_mode', 'title' => 'title', - 'populate_auto_fill_fields' => 'populate_auto_fill_fields' + 'populate_auto_fill_fields' => 'populate_auto_fill_fields', ]; /** @@ -247,7 +238,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'setSubject', 'test_mode' => 'setTestMode', 'title' => 'setTitle', - 'populate_auto_fill_fields' => 'setPopulateAutoFillFields' + 'populate_auto_fill_fields' => 'setPopulateAutoFillFields', ]; /** @@ -270,7 +261,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'getSubject', 'test_mode' => 'getTestMode', 'title' => 'getTitle', - 'populate_auto_fill_fields' => 'getPopulateAutoFillFields' + 'populate_auto_fill_fields' => 'getPopulateAutoFillFields', ]; /** @@ -314,7 +305,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -326,7 +316,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -347,34 +337,33 @@ public function __construct(?array $data = null) $this->setIfExists('populate_auto_fill_fields', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestCreateEmbeddedWithTemplateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestCreateEmbeddedWithTemplateRequest { /** @var SignatureRequestCreateEmbeddedWithTemplateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestCreateEmbeddedWithTemplateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -428,7 +417,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets template_ids * @@ -442,14 +430,14 @@ public function getTemplateIds() /** * Sets template_ids * - * @param string[] $template_ids Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + * @param string[] $template_ids use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used * * @return self */ - public function setTemplateIds($template_ids) + public function setTemplateIds(array $template_ids) { if (is_null($template_ids)) { - throw new \InvalidArgumentException('non-nullable template_ids cannot be null'); + throw new InvalidArgumentException('non-nullable template_ids cannot be null'); } $this->container['template_ids'] = $template_ids; @@ -473,10 +461,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -496,14 +484,14 @@ public function getSigners() /** * Sets signers * - * @param SubSignatureRequestTemplateSigner[] $signers Add Signers to your Templated-based Signature Request. + * @param SubSignatureRequestTemplateSigner[] $signers add Signers to your Templated-based Signature Request * * @return self */ - public function setSigners($signers) + public function setSigners(array $signers) { if (is_null($signers)) { - throw new \InvalidArgumentException('non-nullable signers cannot be null'); + throw new InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -527,10 +515,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline($allow_decline) + public function setAllowDecline(?bool $allow_decline) { if (is_null($allow_decline)) { - throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -554,10 +542,10 @@ public function getCcs() * * @return self */ - public function setCcs($ccs) + public function setCcs(?array $ccs) { if (is_null($ccs)) { - throw new \InvalidArgumentException('non-nullable ccs cannot be null'); + throw new InvalidArgumentException('non-nullable ccs cannot be null'); } $this->container['ccs'] = $ccs; @@ -581,10 +569,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields($custom_fields) + public function setCustomFields(?array $custom_fields) { if (is_null($custom_fields)) { - throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -594,7 +582,7 @@ public function setCustomFields($custom_fields) /** * Gets files * - * @return \SplFileObject[]|null + * @return SplFileObject[]|null */ public function getFiles() { @@ -604,14 +592,14 @@ public function getFiles() /** * Sets files * - * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles($files) + public function setFiles(?array $files) { if (is_null($files)) { - throw new \InvalidArgumentException('non-nullable files cannot be null'); + throw new InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -635,10 +623,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls($file_urls) + public function setFileUrls(?array $file_urls) { if (is_null($file_urls)) { - throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -658,17 +646,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message The custom message in the email that will be sent to the signers. + * @param string|null $message the custom message in the email that will be sent to the signers * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + throw new InvalidArgumentException('non-nullable message cannot be null'); } - if ((mb_strlen($message) > 5000)) { - throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -693,13 +681,12 @@ public function getMetadata() * * @return self */ - public function setMetadata($metadata) + public function setMetadata(?array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } - $this->container['metadata'] = $metadata; return $this; @@ -722,10 +709,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions($signing_options) + public function setSigningOptions(?SubSigningOptions $signing_options) { if (is_null($signing_options)) { - throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -745,17 +732,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject The subject in the email that will be sent to the signers. + * @param string|null $subject the subject in the email that will be sent to the signers * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { - throw new \InvalidArgumentException('non-nullable subject cannot be null'); + throw new InvalidArgumentException('non-nullable subject cannot be null'); } - if ((mb_strlen($subject) > 255)) { - throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); + if (mb_strlen($subject) > 255) { + throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -780,10 +767,10 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -803,17 +790,17 @@ public function getTitle() /** * Sets title * - * @param string|null $title The title you want to assign to the SignatureRequest. + * @param string|null $title the title you want to assign to the SignatureRequest * * @return self */ - public function setTitle($title) + public function setTitle(?string $title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + throw new InvalidArgumentException('non-nullable title cannot be null'); } - if ((mb_strlen($title) > 255)) { - throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); + if (mb_strlen($title) > 255) { + throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; @@ -838,23 +825,22 @@ public function getPopulateAutoFillFields() * * @return self */ - public function setPopulateAutoFillFields($populate_auto_fill_fields) + public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) { if (is_null($populate_auto_fill_fields)) { - throw new \InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); + throw new InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); } $this->container['populate_auto_fill_fields'] = $populate_auto_fill_fields; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -863,11 +849,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -878,10 +864,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -894,11 +878,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -906,12 +888,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -940,5 +922,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestEditEmbeddedRequest.php b/sdks/php/src/Model/SignatureRequestEditEmbeddedRequest.php index 9fe30629e..cb0190f9c 100644 --- a/sdks/php/src/Model/SignatureRequestEditEmbeddedRequest.php +++ b/sdks/php/src/Model/SignatureRequestEditEmbeddedRequest.php @@ -1,14 +1,11 @@ */ -class SignatureRequestEditEmbeddedRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestEditEmbeddedRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestEditEmbeddedRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'client_id' => 'string', 'files' => '\SplFileObject[]', @@ -82,16 +81,16 @@ class SignatureRequestEditEmbeddedRequest implements ModelInterface, ArrayAccess 'title' => 'string', 'use_text_tags' => 'bool', 'populate_auto_fill_fields' => 'bool', - 'expires_at' => 'int' + 'expires_at' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'client_id' => null, 'files' => 'binary', @@ -116,14 +115,14 @@ class SignatureRequestEditEmbeddedRequest implements ModelInterface, ArrayAccess 'title' => null, 'use_text_tags' => null, 'populate_auto_fill_fields' => null, - 'expires_at' => null + 'expires_at' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'client_id' => false, 'files' => false, @@ -148,14 +147,14 @@ class SignatureRequestEditEmbeddedRequest implements ModelInterface, ArrayAccess 'title' => false, 'use_text_tags' => false, 'populate_auto_fill_fields' => false, - 'expires_at' => true + 'expires_at' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -180,8 +179,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -191,7 +188,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -201,7 +198,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -210,9 +207,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -221,9 +215,6 @@ 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 { @@ -260,7 +251,7 @@ public function isNullableSetToNull(string $property): bool 'title' => 'title', 'use_text_tags' => 'use_text_tags', 'populate_auto_fill_fields' => 'populate_auto_fill_fields', - 'expires_at' => 'expires_at' + 'expires_at' => 'expires_at', ]; /** @@ -292,7 +283,7 @@ public function isNullableSetToNull(string $property): bool 'title' => 'setTitle', 'use_text_tags' => 'setUseTextTags', 'populate_auto_fill_fields' => 'setPopulateAutoFillFields', - 'expires_at' => 'setExpiresAt' + 'expires_at' => 'setExpiresAt', ]; /** @@ -324,7 +315,7 @@ public function isNullableSetToNull(string $property): bool 'title' => 'getTitle', 'use_text_tags' => 'getUseTextTags', 'populate_auto_fill_fields' => 'getPopulateAutoFillFields', - 'expires_at' => 'getExpiresAt' + 'expires_at' => 'getExpiresAt', ]; /** @@ -368,7 +359,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -380,7 +370,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -410,34 +400,33 @@ public function __construct(?array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestEditEmbeddedRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestEditEmbeddedRequest { /** @var SignatureRequestEditEmbeddedRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestEditEmbeddedRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -485,7 +474,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets client_id * @@ -503,10 +491,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -516,7 +504,7 @@ public function setClientId($client_id) /** * Gets files * - * @return \SplFileObject[]|null + * @return SplFileObject[]|null */ public function getFiles() { @@ -526,14 +514,14 @@ public function getFiles() /** * Sets files * - * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles($files) + public function setFiles(?array $files) { if (is_null($files)) { - throw new \InvalidArgumentException('non-nullable files cannot be null'); + throw new InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -557,10 +545,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls($file_urls) + public function setFileUrls(?array $file_urls) { if (is_null($file_urls)) { - throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -584,10 +572,10 @@ public function getSigners() * * @return self */ - public function setSigners($signers) + public function setSigners(?array $signers) { if (is_null($signers)) { - throw new \InvalidArgumentException('non-nullable signers cannot be null'); + throw new InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -611,10 +599,10 @@ public function getGroupedSigners() * * @return self */ - public function setGroupedSigners($grouped_signers) + public function setGroupedSigners(?array $grouped_signers) { if (is_null($grouped_signers)) { - throw new \InvalidArgumentException('non-nullable grouped_signers cannot be null'); + throw new InvalidArgumentException('non-nullable grouped_signers cannot be null'); } $this->container['grouped_signers'] = $grouped_signers; @@ -638,10 +626,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline($allow_decline) + public function setAllowDecline(?bool $allow_decline) { if (is_null($allow_decline)) { - throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -665,10 +653,10 @@ public function getAllowReassign() * * @return self */ - public function setAllowReassign($allow_reassign) + public function setAllowReassign(?bool $allow_reassign) { if (is_null($allow_reassign)) { - throw new \InvalidArgumentException('non-nullable allow_reassign cannot be null'); + throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); } $this->container['allow_reassign'] = $allow_reassign; @@ -692,10 +680,10 @@ public function getAttachments() * * @return self */ - public function setAttachments($attachments) + public function setAttachments(?array $attachments) { if (is_null($attachments)) { - throw new \InvalidArgumentException('non-nullable attachments cannot be null'); + throw new InvalidArgumentException('non-nullable attachments cannot be null'); } $this->container['attachments'] = $attachments; @@ -715,14 +703,14 @@ public function getCcEmailAddresses() /** * Sets cc_email_addresses * - * @param string[]|null $cc_email_addresses The email addresses that should be CCed. + * @param string[]|null $cc_email_addresses the email addresses that should be CCed * * @return self */ - public function setCcEmailAddresses($cc_email_addresses) + public function setCcEmailAddresses(?array $cc_email_addresses) { if (is_null($cc_email_addresses)) { - throw new \InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); } $this->container['cc_email_addresses'] = $cc_email_addresses; @@ -746,10 +734,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields($custom_fields) + public function setCustomFields(?array $custom_fields) { if (is_null($custom_fields)) { - throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -773,10 +761,10 @@ public function getFieldOptions() * * @return self */ - public function setFieldOptions($field_options) + public function setFieldOptions(?SubFieldOptions $field_options) { if (is_null($field_options)) { - throw new \InvalidArgumentException('non-nullable field_options cannot be null'); + throw new InvalidArgumentException('non-nullable field_options cannot be null'); } $this->container['field_options'] = $field_options; @@ -800,10 +788,10 @@ public function getFormFieldGroups() * * @return self */ - public function setFormFieldGroups($form_field_groups) + public function setFormFieldGroups(?array $form_field_groups) { if (is_null($form_field_groups)) { - throw new \InvalidArgumentException('non-nullable form_field_groups cannot be null'); + throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); } $this->container['form_field_groups'] = $form_field_groups; @@ -823,14 +811,14 @@ public function getFormFieldRules() /** * Sets form_field_rules * - * @param SubFormFieldRule[]|null $form_field_rules Conditional Logic rules for fields defined in `form_fields_per_document`. + * @param SubFormFieldRule[]|null $form_field_rules conditional Logic rules for fields defined in `form_fields_per_document` * * @return self */ - public function setFormFieldRules($form_field_rules) + public function setFormFieldRules(?array $form_field_rules) { if (is_null($form_field_rules)) { - throw new \InvalidArgumentException('non-nullable form_field_rules cannot be null'); + throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); } $this->container['form_field_rules'] = $form_field_rules; @@ -854,10 +842,10 @@ public function getFormFieldsPerDocument() * * @return self */ - public function setFormFieldsPerDocument($form_fields_per_document) + public function setFormFieldsPerDocument(?array $form_fields_per_document) { if (is_null($form_fields_per_document)) { - throw new \InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); } $this->container['form_fields_per_document'] = $form_fields_per_document; @@ -881,10 +869,10 @@ public function getHideTextTags() * * @return self */ - public function setHideTextTags($hide_text_tags) + public function setHideTextTags(?bool $hide_text_tags) { if (is_null($hide_text_tags)) { - throw new \InvalidArgumentException('non-nullable hide_text_tags cannot be null'); + throw new InvalidArgumentException('non-nullable hide_text_tags cannot be null'); } $this->container['hide_text_tags'] = $hide_text_tags; @@ -904,17 +892,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message The custom message in the email that will be sent to the signers. + * @param string|null $message the custom message in the email that will be sent to the signers * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + throw new InvalidArgumentException('non-nullable message cannot be null'); } - if ((mb_strlen($message) > 5000)) { - throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestEditEmbeddedRequest., must be smaller than or equal to 5000.'); + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestEditEmbeddedRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -939,13 +927,12 @@ public function getMetadata() * * @return self */ - public function setMetadata($metadata) + public function setMetadata(?array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } - $this->container['metadata'] = $metadata; return $this; @@ -968,10 +955,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions($signing_options) + public function setSigningOptions(?SubSigningOptions $signing_options) { if (is_null($signing_options)) { - throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -991,17 +978,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject The subject in the email that will be sent to the signers. + * @param string|null $subject the subject in the email that will be sent to the signers * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { - throw new \InvalidArgumentException('non-nullable subject cannot be null'); + throw new InvalidArgumentException('non-nullable subject cannot be null'); } - if ((mb_strlen($subject) > 255)) { - throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditEmbeddedRequest., must be smaller than or equal to 255.'); + if (mb_strlen($subject) > 255) { + throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditEmbeddedRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -1026,10 +1013,10 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -1049,17 +1036,17 @@ public function getTitle() /** * Sets title * - * @param string|null $title The title you want to assign to the SignatureRequest. + * @param string|null $title the title you want to assign to the SignatureRequest * * @return self */ - public function setTitle($title) + public function setTitle(?string $title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + throw new InvalidArgumentException('non-nullable title cannot be null'); } - if ((mb_strlen($title) > 255)) { - throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestEditEmbeddedRequest., must be smaller than or equal to 255.'); + if (mb_strlen($title) > 255) { + throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestEditEmbeddedRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; @@ -1084,10 +1071,10 @@ public function getUseTextTags() * * @return self */ - public function setUseTextTags($use_text_tags) + public function setUseTextTags(?bool $use_text_tags) { if (is_null($use_text_tags)) { - throw new \InvalidArgumentException('non-nullable use_text_tags cannot be null'); + throw new InvalidArgumentException('non-nullable use_text_tags cannot be null'); } $this->container['use_text_tags'] = $use_text_tags; @@ -1111,10 +1098,10 @@ public function getPopulateAutoFillFields() * * @return self */ - public function setPopulateAutoFillFields($populate_auto_fill_fields) + public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) { if (is_null($populate_auto_fill_fields)) { - throw new \InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); + throw new InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); } $this->container['populate_auto_fill_fields'] = $populate_auto_fill_fields; @@ -1138,13 +1125,13 @@ public function getExpiresAt() * * @return self */ - public function setExpiresAt($expires_at) + public function setExpiresAt(?int $expires_at) { if (is_null($expires_at)) { array_push($this->openAPINullablesSetToNull, 'expires_at'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('expires_at', $nullablesSetToNull, true); + $index = array_search('expires_at', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1154,14 +1141,13 @@ public function setExpiresAt($expires_at) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1170,11 +1156,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1185,10 +1171,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1201,11 +1185,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1213,12 +1195,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1247,5 +1229,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestEditEmbeddedWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestEditEmbeddedWithTemplateRequest.php index bb5eba50b..ac58ec089 100644 --- a/sdks/php/src/Model/SignatureRequestEditEmbeddedWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestEditEmbeddedWithTemplateRequest.php @@ -1,14 +1,11 @@ */ -class SignatureRequestEditEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestEditEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestEditEmbeddedWithTemplateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template_ids' => 'string[]', 'client_id' => 'string', @@ -73,16 +72,16 @@ class SignatureRequestEditEmbeddedWithTemplateRequest implements ModelInterface, 'subject' => 'string', 'test_mode' => 'bool', 'title' => 'string', - 'populate_auto_fill_fields' => 'bool' + 'populate_auto_fill_fields' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template_ids' => null, 'client_id' => null, @@ -98,14 +97,14 @@ class SignatureRequestEditEmbeddedWithTemplateRequest implements ModelInterface, 'subject' => null, 'test_mode' => null, 'title' => null, - 'populate_auto_fill_fields' => null + 'populate_auto_fill_fields' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'template_ids' => false, 'client_id' => false, @@ -121,14 +120,14 @@ class SignatureRequestEditEmbeddedWithTemplateRequest implements ModelInterface, 'subject' => false, 'test_mode' => false, 'title' => false, - 'populate_auto_fill_fields' => false + 'populate_auto_fill_fields' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -153,8 +152,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -164,7 +161,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -174,7 +171,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -183,9 +180,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -194,9 +188,6 @@ 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 { @@ -224,7 +215,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'subject', 'test_mode' => 'test_mode', 'title' => 'title', - 'populate_auto_fill_fields' => 'populate_auto_fill_fields' + 'populate_auto_fill_fields' => 'populate_auto_fill_fields', ]; /** @@ -247,7 +238,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'setSubject', 'test_mode' => 'setTestMode', 'title' => 'setTitle', - 'populate_auto_fill_fields' => 'setPopulateAutoFillFields' + 'populate_auto_fill_fields' => 'setPopulateAutoFillFields', ]; /** @@ -270,7 +261,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'getSubject', 'test_mode' => 'getTestMode', 'title' => 'getTitle', - 'populate_auto_fill_fields' => 'getPopulateAutoFillFields' + 'populate_auto_fill_fields' => 'getPopulateAutoFillFields', ]; /** @@ -314,7 +305,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -326,7 +316,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -347,34 +337,33 @@ public function __construct(?array $data = null) $this->setIfExists('populate_auto_fill_fields', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestEditEmbeddedWithTemplateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestEditEmbeddedWithTemplateRequest { /** @var SignatureRequestEditEmbeddedWithTemplateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestEditEmbeddedWithTemplateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -428,7 +417,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets template_ids * @@ -442,14 +430,14 @@ public function getTemplateIds() /** * Sets template_ids * - * @param string[] $template_ids Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + * @param string[] $template_ids use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used * * @return self */ - public function setTemplateIds($template_ids) + public function setTemplateIds(array $template_ids) { if (is_null($template_ids)) { - throw new \InvalidArgumentException('non-nullable template_ids cannot be null'); + throw new InvalidArgumentException('non-nullable template_ids cannot be null'); } $this->container['template_ids'] = $template_ids; @@ -473,10 +461,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -496,14 +484,14 @@ public function getSigners() /** * Sets signers * - * @param SubSignatureRequestTemplateSigner[] $signers Add Signers to your Templated-based Signature Request. + * @param SubSignatureRequestTemplateSigner[] $signers add Signers to your Templated-based Signature Request * * @return self */ - public function setSigners($signers) + public function setSigners(array $signers) { if (is_null($signers)) { - throw new \InvalidArgumentException('non-nullable signers cannot be null'); + throw new InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -527,10 +515,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline($allow_decline) + public function setAllowDecline(?bool $allow_decline) { if (is_null($allow_decline)) { - throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -554,10 +542,10 @@ public function getCcs() * * @return self */ - public function setCcs($ccs) + public function setCcs(?array $ccs) { if (is_null($ccs)) { - throw new \InvalidArgumentException('non-nullable ccs cannot be null'); + throw new InvalidArgumentException('non-nullable ccs cannot be null'); } $this->container['ccs'] = $ccs; @@ -581,10 +569,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields($custom_fields) + public function setCustomFields(?array $custom_fields) { if (is_null($custom_fields)) { - throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -594,7 +582,7 @@ public function setCustomFields($custom_fields) /** * Gets files * - * @return \SplFileObject[]|null + * @return SplFileObject[]|null */ public function getFiles() { @@ -604,14 +592,14 @@ public function getFiles() /** * Sets files * - * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles($files) + public function setFiles(?array $files) { if (is_null($files)) { - throw new \InvalidArgumentException('non-nullable files cannot be null'); + throw new InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -635,10 +623,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls($file_urls) + public function setFileUrls(?array $file_urls) { if (is_null($file_urls)) { - throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -658,17 +646,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message The custom message in the email that will be sent to the signers. + * @param string|null $message the custom message in the email that will be sent to the signers * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + throw new InvalidArgumentException('non-nullable message cannot be null'); } - if ((mb_strlen($message) > 5000)) { - throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestEditEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestEditEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -693,13 +681,12 @@ public function getMetadata() * * @return self */ - public function setMetadata($metadata) + public function setMetadata(?array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } - $this->container['metadata'] = $metadata; return $this; @@ -722,10 +709,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions($signing_options) + public function setSigningOptions(?SubSigningOptions $signing_options) { if (is_null($signing_options)) { - throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -745,17 +732,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject The subject in the email that will be sent to the signers. + * @param string|null $subject the subject in the email that will be sent to the signers * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { - throw new \InvalidArgumentException('non-nullable subject cannot be null'); + throw new InvalidArgumentException('non-nullable subject cannot be null'); } - if ((mb_strlen($subject) > 255)) { - throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); + if (mb_strlen($subject) > 255) { + throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -780,10 +767,10 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -803,17 +790,17 @@ public function getTitle() /** * Sets title * - * @param string|null $title The title you want to assign to the SignatureRequest. + * @param string|null $title the title you want to assign to the SignatureRequest * * @return self */ - public function setTitle($title) + public function setTitle(?string $title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + throw new InvalidArgumentException('non-nullable title cannot be null'); } - if ((mb_strlen($title) > 255)) { - throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestEditEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); + if (mb_strlen($title) > 255) { + throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestEditEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; @@ -838,23 +825,22 @@ public function getPopulateAutoFillFields() * * @return self */ - public function setPopulateAutoFillFields($populate_auto_fill_fields) + public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) { if (is_null($populate_auto_fill_fields)) { - throw new \InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); + throw new InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); } $this->container['populate_auto_fill_fields'] = $populate_auto_fill_fields; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -863,11 +849,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -878,10 +864,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -894,11 +878,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -906,12 +888,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -940,5 +922,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestEditRequest.php b/sdks/php/src/Model/SignatureRequestEditRequest.php index 4529f58c0..131a3e4c4 100644 --- a/sdks/php/src/Model/SignatureRequestEditRequest.php +++ b/sdks/php/src/Model/SignatureRequestEditRequest.php @@ -1,14 +1,11 @@ */ -class SignatureRequestEditRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestEditRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestEditRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'files' => '\SplFileObject[]', 'file_urls' => 'string[]', @@ -83,16 +82,16 @@ class SignatureRequestEditRequest implements ModelInterface, ArrayAccess, \JsonS 'test_mode' => 'bool', 'title' => 'string', 'use_text_tags' => 'bool', - 'expires_at' => 'int' + 'expires_at' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'files' => 'binary', 'file_urls' => null, @@ -118,14 +117,14 @@ class SignatureRequestEditRequest implements ModelInterface, ArrayAccess, \JsonS 'test_mode' => null, 'title' => null, 'use_text_tags' => null, - 'expires_at' => null + 'expires_at' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'files' => false, 'file_urls' => false, @@ -151,14 +150,14 @@ class SignatureRequestEditRequest implements ModelInterface, ArrayAccess, \JsonS 'test_mode' => false, 'title' => false, 'use_text_tags' => false, - 'expires_at' => true + 'expires_at' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -183,8 +182,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -194,7 +191,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -204,7 +201,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -213,9 +210,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -224,9 +218,6 @@ 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 { @@ -264,7 +255,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'test_mode', 'title' => 'title', 'use_text_tags' => 'use_text_tags', - 'expires_at' => 'expires_at' + 'expires_at' => 'expires_at', ]; /** @@ -297,7 +288,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'setTestMode', 'title' => 'setTitle', 'use_text_tags' => 'setUseTextTags', - 'expires_at' => 'setExpiresAt' + 'expires_at' => 'setExpiresAt', ]; /** @@ -330,7 +321,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'getTestMode', 'title' => 'getTitle', 'use_text_tags' => 'getUseTextTags', - 'expires_at' => 'getExpiresAt' + 'expires_at' => 'getExpiresAt', ]; /** @@ -374,7 +365,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -386,7 +376,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -417,34 +407,33 @@ public function __construct(?array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestEditRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestEditRequest { /** @var SignatureRequestEditRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestEditRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -489,11 +478,10 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets files * - * @return \SplFileObject[]|null + * @return SplFileObject[]|null */ public function getFiles() { @@ -503,14 +491,14 @@ public function getFiles() /** * Sets files * - * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles($files) + public function setFiles(?array $files) { if (is_null($files)) { - throw new \InvalidArgumentException('non-nullable files cannot be null'); + throw new InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -534,10 +522,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls($file_urls) + public function setFileUrls(?array $file_urls) { if (is_null($file_urls)) { - throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -561,10 +549,10 @@ public function getSigners() * * @return self */ - public function setSigners($signers) + public function setSigners(?array $signers) { if (is_null($signers)) { - throw new \InvalidArgumentException('non-nullable signers cannot be null'); + throw new InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -588,10 +576,10 @@ public function getGroupedSigners() * * @return self */ - public function setGroupedSigners($grouped_signers) + public function setGroupedSigners(?array $grouped_signers) { if (is_null($grouped_signers)) { - throw new \InvalidArgumentException('non-nullable grouped_signers cannot be null'); + throw new InvalidArgumentException('non-nullable grouped_signers cannot be null'); } $this->container['grouped_signers'] = $grouped_signers; @@ -615,10 +603,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline($allow_decline) + public function setAllowDecline(?bool $allow_decline) { if (is_null($allow_decline)) { - throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -642,10 +630,10 @@ public function getAllowReassign() * * @return self */ - public function setAllowReassign($allow_reassign) + public function setAllowReassign(?bool $allow_reassign) { if (is_null($allow_reassign)) { - throw new \InvalidArgumentException('non-nullable allow_reassign cannot be null'); + throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); } $this->container['allow_reassign'] = $allow_reassign; @@ -669,10 +657,10 @@ public function getAttachments() * * @return self */ - public function setAttachments($attachments) + public function setAttachments(?array $attachments) { if (is_null($attachments)) { - throw new \InvalidArgumentException('non-nullable attachments cannot be null'); + throw new InvalidArgumentException('non-nullable attachments cannot be null'); } $this->container['attachments'] = $attachments; @@ -692,14 +680,14 @@ public function getCcEmailAddresses() /** * Sets cc_email_addresses * - * @param string[]|null $cc_email_addresses The email addresses that should be CCed. + * @param string[]|null $cc_email_addresses the email addresses that should be CCed * * @return self */ - public function setCcEmailAddresses($cc_email_addresses) + public function setCcEmailAddresses(?array $cc_email_addresses) { if (is_null($cc_email_addresses)) { - throw new \InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); } $this->container['cc_email_addresses'] = $cc_email_addresses; @@ -723,10 +711,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(?string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -750,10 +738,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields($custom_fields) + public function setCustomFields(?array $custom_fields) { if (is_null($custom_fields)) { - throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -777,10 +765,10 @@ public function getFieldOptions() * * @return self */ - public function setFieldOptions($field_options) + public function setFieldOptions(?SubFieldOptions $field_options) { if (is_null($field_options)) { - throw new \InvalidArgumentException('non-nullable field_options cannot be null'); + throw new InvalidArgumentException('non-nullable field_options cannot be null'); } $this->container['field_options'] = $field_options; @@ -804,10 +792,10 @@ public function getFormFieldGroups() * * @return self */ - public function setFormFieldGroups($form_field_groups) + public function setFormFieldGroups(?array $form_field_groups) { if (is_null($form_field_groups)) { - throw new \InvalidArgumentException('non-nullable form_field_groups cannot be null'); + throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); } $this->container['form_field_groups'] = $form_field_groups; @@ -827,14 +815,14 @@ public function getFormFieldRules() /** * Sets form_field_rules * - * @param SubFormFieldRule[]|null $form_field_rules Conditional Logic rules for fields defined in `form_fields_per_document`. + * @param SubFormFieldRule[]|null $form_field_rules conditional Logic rules for fields defined in `form_fields_per_document` * * @return self */ - public function setFormFieldRules($form_field_rules) + public function setFormFieldRules(?array $form_field_rules) { if (is_null($form_field_rules)) { - throw new \InvalidArgumentException('non-nullable form_field_rules cannot be null'); + throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); } $this->container['form_field_rules'] = $form_field_rules; @@ -858,10 +846,10 @@ public function getFormFieldsPerDocument() * * @return self */ - public function setFormFieldsPerDocument($form_fields_per_document) + public function setFormFieldsPerDocument(?array $form_fields_per_document) { if (is_null($form_fields_per_document)) { - throw new \InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); } $this->container['form_fields_per_document'] = $form_fields_per_document; @@ -885,10 +873,10 @@ public function getHideTextTags() * * @return self */ - public function setHideTextTags($hide_text_tags) + public function setHideTextTags(?bool $hide_text_tags) { if (is_null($hide_text_tags)) { - throw new \InvalidArgumentException('non-nullable hide_text_tags cannot be null'); + throw new InvalidArgumentException('non-nullable hide_text_tags cannot be null'); } $this->container['hide_text_tags'] = $hide_text_tags; @@ -912,10 +900,10 @@ public function getIsEid() * * @return self */ - public function setIsEid($is_eid) + public function setIsEid(?bool $is_eid) { if (is_null($is_eid)) { - throw new \InvalidArgumentException('non-nullable is_eid cannot be null'); + throw new InvalidArgumentException('non-nullable is_eid cannot be null'); } $this->container['is_eid'] = $is_eid; @@ -935,17 +923,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message The custom message in the email that will be sent to the signers. + * @param string|null $message the custom message in the email that will be sent to the signers * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + throw new InvalidArgumentException('non-nullable message cannot be null'); } - if ((mb_strlen($message) > 5000)) { - throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestEditRequest., must be smaller than or equal to 5000.'); + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestEditRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -970,13 +958,12 @@ public function getMetadata() * * @return self */ - public function setMetadata($metadata) + public function setMetadata(?array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } - $this->container['metadata'] = $metadata; return $this; @@ -999,10 +986,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions($signing_options) + public function setSigningOptions(?SubSigningOptions $signing_options) { if (is_null($signing_options)) { - throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -1022,14 +1009,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. + * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign * * @return self */ - public function setSigningRedirectUrl($signing_redirect_url) + public function setSigningRedirectUrl(?string $signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -1049,17 +1036,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject The subject in the email that will be sent to the signers. + * @param string|null $subject the subject in the email that will be sent to the signers * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { - throw new \InvalidArgumentException('non-nullable subject cannot be null'); + throw new InvalidArgumentException('non-nullable subject cannot be null'); } - if ((mb_strlen($subject) > 255)) { - throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditRequest., must be smaller than or equal to 255.'); + if (mb_strlen($subject) > 255) { + throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -1084,10 +1071,10 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -1107,17 +1094,17 @@ public function getTitle() /** * Sets title * - * @param string|null $title The title you want to assign to the SignatureRequest. + * @param string|null $title the title you want to assign to the SignatureRequest * * @return self */ - public function setTitle($title) + public function setTitle(?string $title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + throw new InvalidArgumentException('non-nullable title cannot be null'); } - if ((mb_strlen($title) > 255)) { - throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestEditRequest., must be smaller than or equal to 255.'); + if (mb_strlen($title) > 255) { + throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestEditRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; @@ -1142,10 +1129,10 @@ public function getUseTextTags() * * @return self */ - public function setUseTextTags($use_text_tags) + public function setUseTextTags(?bool $use_text_tags) { if (is_null($use_text_tags)) { - throw new \InvalidArgumentException('non-nullable use_text_tags cannot be null'); + throw new InvalidArgumentException('non-nullable use_text_tags cannot be null'); } $this->container['use_text_tags'] = $use_text_tags; @@ -1169,13 +1156,13 @@ public function getExpiresAt() * * @return self */ - public function setExpiresAt($expires_at) + public function setExpiresAt(?int $expires_at) { if (is_null($expires_at)) { array_push($this->openAPINullablesSetToNull, 'expires_at'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('expires_at', $nullablesSetToNull, true); + $index = array_search('expires_at', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1185,14 +1172,13 @@ public function setExpiresAt($expires_at) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1201,11 +1187,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1216,10 +1202,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1232,11 +1216,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1244,12 +1226,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1278,5 +1260,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestEditWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestEditWithTemplateRequest.php index 39c50c802..c7f839f75 100644 --- a/sdks/php/src/Model/SignatureRequestEditWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestEditWithTemplateRequest.php @@ -1,14 +1,11 @@ */ -class SignatureRequestEditWithTemplateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestEditWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestEditWithTemplateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template_ids' => 'string[]', 'signers' => '\Dropbox\Sign\Model\SubSignatureRequestTemplateSigner[]', @@ -75,16 +74,16 @@ class SignatureRequestEditWithTemplateRequest implements ModelInterface, ArrayAc 'signing_redirect_url' => 'string', 'subject' => 'string', 'test_mode' => 'bool', - 'title' => 'string' + 'title' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template_ids' => null, 'signers' => null, @@ -101,14 +100,14 @@ class SignatureRequestEditWithTemplateRequest implements ModelInterface, ArrayAc 'signing_redirect_url' => null, 'subject' => null, 'test_mode' => null, - 'title' => null + 'title' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'template_ids' => false, 'signers' => false, @@ -125,14 +124,14 @@ class SignatureRequestEditWithTemplateRequest implements ModelInterface, ArrayAc 'signing_redirect_url' => false, 'subject' => false, 'test_mode' => false, - 'title' => false + 'title' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -157,8 +156,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -168,7 +165,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -178,7 +175,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -187,9 +184,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -198,9 +192,6 @@ 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 { @@ -229,7 +220,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'signing_redirect_url', 'subject' => 'subject', 'test_mode' => 'test_mode', - 'title' => 'title' + 'title' => 'title', ]; /** @@ -253,7 +244,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'setSigningRedirectUrl', 'subject' => 'setSubject', 'test_mode' => 'setTestMode', - 'title' => 'setTitle' + 'title' => 'setTitle', ]; /** @@ -277,7 +268,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'getSigningRedirectUrl', 'subject' => 'getSubject', 'test_mode' => 'getTestMode', - 'title' => 'getTitle' + 'title' => 'getTitle', ]; /** @@ -321,7 +312,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -333,7 +323,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -355,34 +345,33 @@ public function __construct(?array $data = null) $this->setIfExists('title', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestEditWithTemplateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestEditWithTemplateRequest { /** @var SignatureRequestEditWithTemplateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestEditWithTemplateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -433,7 +422,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets template_ids * @@ -447,14 +435,14 @@ public function getTemplateIds() /** * Sets template_ids * - * @param string[] $template_ids Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + * @param string[] $template_ids use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used * * @return self */ - public function setTemplateIds($template_ids) + public function setTemplateIds(array $template_ids) { if (is_null($template_ids)) { - throw new \InvalidArgumentException('non-nullable template_ids cannot be null'); + throw new InvalidArgumentException('non-nullable template_ids cannot be null'); } $this->container['template_ids'] = $template_ids; @@ -474,14 +462,14 @@ public function getSigners() /** * Sets signers * - * @param SubSignatureRequestTemplateSigner[] $signers Add Signers to your Templated-based Signature Request. + * @param SubSignatureRequestTemplateSigner[] $signers add Signers to your Templated-based Signature Request * * @return self */ - public function setSigners($signers) + public function setSigners(array $signers) { if (is_null($signers)) { - throw new \InvalidArgumentException('non-nullable signers cannot be null'); + throw new InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -505,10 +493,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline($allow_decline) + public function setAllowDecline(?bool $allow_decline) { if (is_null($allow_decline)) { - throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -532,10 +520,10 @@ public function getCcs() * * @return self */ - public function setCcs($ccs) + public function setCcs(?array $ccs) { if (is_null($ccs)) { - throw new \InvalidArgumentException('non-nullable ccs cannot be null'); + throw new InvalidArgumentException('non-nullable ccs cannot be null'); } $this->container['ccs'] = $ccs; @@ -559,10 +547,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(?string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -586,10 +574,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields($custom_fields) + public function setCustomFields(?array $custom_fields) { if (is_null($custom_fields)) { - throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -599,7 +587,7 @@ public function setCustomFields($custom_fields) /** * Gets files * - * @return \SplFileObject[]|null + * @return SplFileObject[]|null */ public function getFiles() { @@ -609,14 +597,14 @@ public function getFiles() /** * Sets files * - * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles($files) + public function setFiles(?array $files) { if (is_null($files)) { - throw new \InvalidArgumentException('non-nullable files cannot be null'); + throw new InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -640,10 +628,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls($file_urls) + public function setFileUrls(?array $file_urls) { if (is_null($file_urls)) { - throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -667,10 +655,10 @@ public function getIsEid() * * @return self */ - public function setIsEid($is_eid) + public function setIsEid(?bool $is_eid) { if (is_null($is_eid)) { - throw new \InvalidArgumentException('non-nullable is_eid cannot be null'); + throw new InvalidArgumentException('non-nullable is_eid cannot be null'); } $this->container['is_eid'] = $is_eid; @@ -690,17 +678,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message The custom message in the email that will be sent to the signers. + * @param string|null $message the custom message in the email that will be sent to the signers * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + throw new InvalidArgumentException('non-nullable message cannot be null'); } - if ((mb_strlen($message) > 5000)) { - throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestEditWithTemplateRequest., must be smaller than or equal to 5000.'); + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestEditWithTemplateRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -725,13 +713,12 @@ public function getMetadata() * * @return self */ - public function setMetadata($metadata) + public function setMetadata(?array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } - $this->container['metadata'] = $metadata; return $this; @@ -754,10 +741,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions($signing_options) + public function setSigningOptions(?SubSigningOptions $signing_options) { if (is_null($signing_options)) { - throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -777,14 +764,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. + * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign * * @return self */ - public function setSigningRedirectUrl($signing_redirect_url) + public function setSigningRedirectUrl(?string $signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -804,17 +791,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject The subject in the email that will be sent to the signers. + * @param string|null $subject the subject in the email that will be sent to the signers * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { - throw new \InvalidArgumentException('non-nullable subject cannot be null'); + throw new InvalidArgumentException('non-nullable subject cannot be null'); } - if ((mb_strlen($subject) > 255)) { - throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditWithTemplateRequest., must be smaller than or equal to 255.'); + if (mb_strlen($subject) > 255) { + throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -839,10 +826,10 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -862,31 +849,30 @@ public function getTitle() /** * Sets title * - * @param string|null $title The title you want to assign to the SignatureRequest. + * @param string|null $title the title you want to assign to the SignatureRequest * * @return self */ - public function setTitle($title) + public function setTitle(?string $title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + throw new InvalidArgumentException('non-nullable title cannot be null'); } - if ((mb_strlen($title) > 255)) { - throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestEditWithTemplateRequest., must be smaller than or equal to 255.'); + if (mb_strlen($title) > 255) { + throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestEditWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -895,11 +881,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -910,10 +896,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -926,11 +910,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -938,12 +920,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -972,5 +954,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestGetResponse.php b/sdks/php/src/Model/SignatureRequestGetResponse.php index 404d339e2..d976e4932 100644 --- a/sdks/php/src/Model/SignatureRequestGetResponse.php +++ b/sdks/php/src/Model/SignatureRequestGetResponse.php @@ -1,14 +1,11 @@ */ -class SignatureRequestGetResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestGetResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestGetResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'signature_request' => '\Dropbox\Sign\Model\SignatureRequestResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'signature_request' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'signature_request' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'signature_request' => 'signature_request', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'signature_request' => 'setSignatureRequest', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'signature_request' => 'getSignatureRequest', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestGetResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestGetResponse { /** @var SignatureRequestGetResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestGetResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,7 +307,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets signature_request * @@ -337,10 +324,10 @@ public function getSignatureRequest() * * @return self */ - public function setSignatureRequest($signature_request) + public function setSignatureRequest(SignatureRequestResponse $signature_request) { if (is_null($signature_request)) { - throw new \InvalidArgumentException('non-nullable signature_request cannot be null'); + throw new InvalidArgumentException('non-nullable signature_request cannot be null'); } $this->container['signature_request'] = $signature_request; @@ -360,27 +347,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -389,11 +375,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -404,10 +390,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -420,11 +404,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -432,12 +414,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -466,5 +448,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestListResponse.php b/sdks/php/src/Model/SignatureRequestListResponse.php index 9a47907c9..5d9a26926 100644 --- a/sdks/php/src/Model/SignatureRequestListResponse.php +++ b/sdks/php/src/Model/SignatureRequestListResponse.php @@ -1,14 +1,11 @@ */ -class SignatureRequestListResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestListResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestListResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'signature_requests' => '\Dropbox\Sign\Model\SignatureRequestResponse[]', 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'signature_requests' => null, 'list_info' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'signature_requests' => false, 'list_info' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'signature_requests' => 'signature_requests', 'list_info' => 'list_info', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'signature_requests' => 'setSignatureRequests', 'list_info' => 'setListInfo', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'signature_requests' => 'getSignatureRequests', 'list_info' => 'getListInfo', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -242,7 +232,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -254,7 +243,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -263,34 +252,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestListResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestListResponse { /** @var SignatureRequestListResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestListResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -329,7 +317,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets signature_requests * @@ -343,14 +330,14 @@ public function getSignatureRequests() /** * Sets signature_requests * - * @param SignatureRequestResponse[] $signature_requests Contains information about signature requests. + * @param SignatureRequestResponse[] $signature_requests contains information about signature requests * * @return self */ - public function setSignatureRequests($signature_requests) + public function setSignatureRequests(array $signature_requests) { if (is_null($signature_requests)) { - throw new \InvalidArgumentException('non-nullable signature_requests cannot be null'); + throw new InvalidArgumentException('non-nullable signature_requests cannot be null'); } $this->container['signature_requests'] = $signature_requests; @@ -374,10 +361,10 @@ public function getListInfo() * * @return self */ - public function setListInfo($list_info) + public function setListInfo(ListInfoResponse $list_info) { if (is_null($list_info)) { - throw new \InvalidArgumentException('non-nullable list_info cannot be null'); + throw new InvalidArgumentException('non-nullable list_info cannot be null'); } $this->container['list_info'] = $list_info; @@ -397,27 +384,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -426,11 +412,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -441,10 +427,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -457,11 +441,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -469,12 +451,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -503,5 +485,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestRemindRequest.php b/sdks/php/src/Model/SignatureRequestRemindRequest.php index 8e50feac9..1c5eaefbd 100644 --- a/sdks/php/src/Model/SignatureRequestRemindRequest.php +++ b/sdks/php/src/Model/SignatureRequestRemindRequest.php @@ -1,14 +1,11 @@ */ -class SignatureRequestRemindRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestRemindRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestRemindRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'email_address' => 'string', - 'name' => 'string' + 'name' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'email_address' => 'email', - 'name' => null + 'name' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'email_address' => false, - 'name' => false + 'name' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'email_address' => 'email_address', - 'name' => 'name' + 'name' => 'name', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'email_address' => 'setEmailAddress', - 'name' => 'setName' + 'name' => 'setName', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'email_address' => 'getEmailAddress', - 'name' => 'getName' + 'name' => 'getName', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('name', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestRemindRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestRemindRequest { /** @var SignatureRequestRemindRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestRemindRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,7 +307,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets email_address * @@ -333,14 +320,14 @@ public function getEmailAddress() /** * Sets email_address * - * @param string $email_address The email address of the signer to send a reminder to. + * @param string $email_address the email address of the signer to send a reminder to * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -364,23 +351,22 @@ public function getName() * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -389,11 +375,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -404,10 +390,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -420,11 +404,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -432,12 +414,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -466,5 +448,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestResponse.php b/sdks/php/src/Model/SignatureRequestResponse.php index 9ce1025ef..16a8fccf3 100644 --- a/sdks/php/src/Model/SignatureRequestResponse.php +++ b/sdks/php/src/Model/SignatureRequestResponse.php @@ -1,14 +1,11 @@ */ -class SignatureRequestResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'test_mode' => 'bool', 'signature_request_id' => 'string', @@ -84,16 +82,16 @@ class SignatureRequestResponse implements ModelInterface, ArrayAccess, \JsonSeri 'attachments' => '\Dropbox\Sign\Model\SignatureRequestResponseAttachment[]', 'response_data' => '\Dropbox\Sign\Model\SignatureRequestResponseDataBase[]', 'signatures' => '\Dropbox\Sign\Model\SignatureRequestResponseSignatures[]', - 'bulk_send_job_id' => 'string' + 'bulk_send_job_id' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'test_mode' => null, 'signature_request_id' => null, @@ -119,14 +117,14 @@ class SignatureRequestResponse implements ModelInterface, ArrayAccess, \JsonSeri 'attachments' => null, 'response_data' => null, 'signatures' => null, - 'bulk_send_job_id' => null + 'bulk_send_job_id' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'test_mode' => false, 'signature_request_id' => false, @@ -152,14 +150,14 @@ class SignatureRequestResponse implements ModelInterface, ArrayAccess, \JsonSeri 'attachments' => true, 'response_data' => true, 'signatures' => false, - 'bulk_send_job_id' => true + 'bulk_send_job_id' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -184,8 +182,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -195,7 +191,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -205,7 +201,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -214,9 +210,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -225,9 +218,6 @@ 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 { @@ -265,7 +255,7 @@ public function isNullableSetToNull(string $property): bool 'attachments' => 'attachments', 'response_data' => 'response_data', 'signatures' => 'signatures', - 'bulk_send_job_id' => 'bulk_send_job_id' + 'bulk_send_job_id' => 'bulk_send_job_id', ]; /** @@ -298,7 +288,7 @@ public function isNullableSetToNull(string $property): bool 'attachments' => 'setAttachments', 'response_data' => 'setResponseData', 'signatures' => 'setSignatures', - 'bulk_send_job_id' => 'setBulkSendJobId' + 'bulk_send_job_id' => 'setBulkSendJobId', ]; /** @@ -331,7 +321,7 @@ public function isNullableSetToNull(string $property): bool 'attachments' => 'getAttachments', 'response_data' => 'getResponseData', 'signatures' => 'getSignatures', - 'bulk_send_job_id' => 'getBulkSendJobId' + 'bulk_send_job_id' => 'getBulkSendJobId', ]; /** @@ -375,7 +365,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -387,7 +376,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -418,34 +407,33 @@ public function __construct(?array $data = null) $this->setIfExists('bulk_send_job_id', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponse { /** @var SignatureRequestResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -462,9 +450,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -478,7 +464,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets test_mode * @@ -496,10 +481,10 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -519,14 +504,14 @@ public function getSignatureRequestId() /** * Sets signature_request_id * - * @param string|null $signature_request_id The id of the SignatureRequest. + * @param string|null $signature_request_id the id of the SignatureRequest * * @return self */ - public function setSignatureRequestId($signature_request_id) + public function setSignatureRequestId(?string $signature_request_id) { if (is_null($signature_request_id)) { - throw new \InvalidArgumentException('non-nullable signature_request_id cannot be null'); + throw new InvalidArgumentException('non-nullable signature_request_id cannot be null'); } $this->container['signature_request_id'] = $signature_request_id; @@ -546,17 +531,17 @@ public function getRequesterEmailAddress() /** * Sets requester_email_address * - * @param string|null $requester_email_address The email address of the initiator of the SignatureRequest. + * @param string|null $requester_email_address the email address of the initiator of the SignatureRequest * * @return self */ - public function setRequesterEmailAddress($requester_email_address) + public function setRequesterEmailAddress(?string $requester_email_address) { if (is_null($requester_email_address)) { array_push($this->openAPINullablesSetToNull, 'requester_email_address'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('requester_email_address', $nullablesSetToNull, true); + $index = array_search('requester_email_address', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -580,14 +565,14 @@ public function getTitle() /** * Sets title * - * @param string|null $title The title the specified Account uses for the SignatureRequest. + * @param string|null $title the title the specified Account uses for the SignatureRequest * * @return self */ - public function setTitle($title) + public function setTitle(?string $title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + throw new InvalidArgumentException('non-nullable title cannot be null'); } $this->container['title'] = $title; @@ -607,14 +592,14 @@ public function getOriginalTitle() /** * Sets original_title * - * @param string|null $original_title Default Label for account. + * @param string|null $original_title default Label for account * * @return self */ - public function setOriginalTitle($original_title) + public function setOriginalTitle(?string $original_title) { if (is_null($original_title)) { - throw new \InvalidArgumentException('non-nullable original_title cannot be null'); + throw new InvalidArgumentException('non-nullable original_title cannot be null'); } $this->container['original_title'] = $original_title; @@ -634,17 +619,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject The subject in the email that was initially sent to the signers. + * @param string|null $subject the subject in the email that was initially sent to the signers * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { array_push($this->openAPINullablesSetToNull, 'subject'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('subject', $nullablesSetToNull, true); + $index = array_search('subject', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -668,17 +653,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message The custom message in the email that was initially sent to the signers. + * @param string|null $message the custom message in the email that was initially sent to the signers * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { array_push($this->openAPINullablesSetToNull, 'message'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('message', $nullablesSetToNull, true); + $index = array_search('message', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -702,14 +687,14 @@ public function getMetadata() /** * Sets metadata * - * @param array|null $metadata The metadata attached to the signature request. + * @param array|null $metadata the metadata attached to the signature request * * @return self */ - public function setMetadata($metadata) + public function setMetadata(?array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } $this->container['metadata'] = $metadata; @@ -729,14 +714,14 @@ public function getCreatedAt() /** * Sets created_at * - * @param int|null $created_at Time the signature request was created. + * @param int|null $created_at time the signature request was created * * @return self */ - public function setCreatedAt($created_at) + public function setCreatedAt(?int $created_at) { if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + throw new InvalidArgumentException('non-nullable created_at cannot be null'); } $this->container['created_at'] = $created_at; @@ -760,13 +745,13 @@ public function getExpiresAt() * * @return self */ - public function setExpiresAt($expires_at) + public function setExpiresAt(?int $expires_at) { if (is_null($expires_at)) { array_push($this->openAPINullablesSetToNull, 'expires_at'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('expires_at', $nullablesSetToNull, true); + $index = array_search('expires_at', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -790,14 +775,14 @@ public function getIsComplete() /** * Sets is_complete * - * @param bool|null $is_complete Whether or not the SignatureRequest has been fully executed by all signers. + * @param bool|null $is_complete whether or not the SignatureRequest has been fully executed by all signers * * @return self */ - public function setIsComplete($is_complete) + public function setIsComplete(?bool $is_complete) { if (is_null($is_complete)) { - throw new \InvalidArgumentException('non-nullable is_complete cannot be null'); + throw new InvalidArgumentException('non-nullable is_complete cannot be null'); } $this->container['is_complete'] = $is_complete; @@ -817,14 +802,14 @@ public function getIsDeclined() /** * Sets is_declined * - * @param bool|null $is_declined Whether or not the SignatureRequest has been declined by a signer. + * @param bool|null $is_declined whether or not the SignatureRequest has been declined by a signer * * @return self */ - public function setIsDeclined($is_declined) + public function setIsDeclined(?bool $is_declined) { if (is_null($is_declined)) { - throw new \InvalidArgumentException('non-nullable is_declined cannot be null'); + throw new InvalidArgumentException('non-nullable is_declined cannot be null'); } $this->container['is_declined'] = $is_declined; @@ -844,14 +829,14 @@ public function getHasError() /** * Sets has_error * - * @param bool|null $has_error Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). + * @param bool|null $has_error whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings) * * @return self */ - public function setHasError($has_error) + public function setHasError(?bool $has_error) { if (is_null($has_error)) { - throw new \InvalidArgumentException('non-nullable has_error cannot be null'); + throw new InvalidArgumentException('non-nullable has_error cannot be null'); } $this->container['has_error'] = $has_error; @@ -871,14 +856,14 @@ public function getFilesUrl() /** * Sets files_url * - * @param string|null $files_url The URL where a copy of the request's documents can be downloaded. + * @param string|null $files_url the URL where a copy of the request's documents can be downloaded * * @return self */ - public function setFilesUrl($files_url) + public function setFilesUrl(?string $files_url) { if (is_null($files_url)) { - throw new \InvalidArgumentException('non-nullable files_url cannot be null'); + throw new InvalidArgumentException('non-nullable files_url cannot be null'); } $this->container['files_url'] = $files_url; @@ -902,13 +887,13 @@ public function getSigningUrl() * * @return self */ - public function setSigningUrl($signing_url) + public function setSigningUrl(?string $signing_url) { if (is_null($signing_url)) { array_push($this->openAPINullablesSetToNull, 'signing_url'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signing_url', $nullablesSetToNull, true); + $index = array_search('signing_url', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -932,14 +917,14 @@ public function getDetailsUrl() /** * Sets details_url * - * @param string|null $details_url The URL where the requester and the signers can view the current status of the SignatureRequest. + * @param string|null $details_url the URL where the requester and the signers can view the current status of the SignatureRequest * * @return self */ - public function setDetailsUrl($details_url) + public function setDetailsUrl(?string $details_url) { if (is_null($details_url)) { - throw new \InvalidArgumentException('non-nullable details_url cannot be null'); + throw new InvalidArgumentException('non-nullable details_url cannot be null'); } $this->container['details_url'] = $details_url; @@ -963,10 +948,10 @@ public function getCcEmailAddresses() * * @return self */ - public function setCcEmailAddresses($cc_email_addresses) + public function setCcEmailAddresses(?array $cc_email_addresses) { if (is_null($cc_email_addresses)) { - throw new \InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); } $this->container['cc_email_addresses'] = $cc_email_addresses; @@ -986,17 +971,17 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url The URL you want the signer redirected to after they successfully sign. + * @param string|null $signing_redirect_url the URL you want the signer redirected to after they successfully sign * * @return self */ - public function setSigningRedirectUrl($signing_redirect_url) + public function setSigningRedirectUrl(?string $signing_redirect_url) { if (is_null($signing_redirect_url)) { array_push($this->openAPINullablesSetToNull, 'signing_redirect_url'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signing_redirect_url', $nullablesSetToNull, true); + $index = array_search('signing_redirect_url', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1024,13 +1009,13 @@ public function getFinalCopyUri() * * @return self */ - public function setFinalCopyUri($final_copy_uri) + public function setFinalCopyUri(?string $final_copy_uri) { if (is_null($final_copy_uri)) { array_push($this->openAPINullablesSetToNull, 'final_copy_uri'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('final_copy_uri', $nullablesSetToNull, true); + $index = array_search('final_copy_uri', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1054,17 +1039,17 @@ public function getTemplateIds() /** * Sets template_ids * - * @param string[]|null $template_ids Templates IDs used in this SignatureRequest (if any). + * @param string[]|null $template_ids templates IDs used in this SignatureRequest (if any) * * @return self */ - public function setTemplateIds($template_ids) + public function setTemplateIds(?array $template_ids) { if (is_null($template_ids)) { array_push($this->openAPINullablesSetToNull, 'template_ids'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('template_ids', $nullablesSetToNull, true); + $index = array_search('template_ids', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1092,13 +1077,13 @@ public function getCustomFields() * * @return self */ - public function setCustomFields($custom_fields) + public function setCustomFields(?array $custom_fields) { if (is_null($custom_fields)) { array_push($this->openAPINullablesSetToNull, 'custom_fields'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('custom_fields', $nullablesSetToNull, true); + $index = array_search('custom_fields', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1122,17 +1107,17 @@ public function getAttachments() /** * Sets attachments * - * @param SignatureRequestResponseAttachment[]|null $attachments Signer attachments. + * @param SignatureRequestResponseAttachment[]|null $attachments signer attachments * * @return self */ - public function setAttachments($attachments) + public function setAttachments(?array $attachments) { if (is_null($attachments)) { array_push($this->openAPINullablesSetToNull, 'attachments'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('attachments', $nullablesSetToNull, true); + $index = array_search('attachments', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1156,17 +1141,17 @@ public function getResponseData() /** * Sets response_data * - * @param SignatureRequestResponseDataBase[]|null $response_data An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. + * @param SignatureRequestResponseDataBase[]|null $response_data an array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers * * @return self */ - public function setResponseData($response_data) + public function setResponseData(?array $response_data) { if (is_null($response_data)) { array_push($this->openAPINullablesSetToNull, 'response_data'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('response_data', $nullablesSetToNull, true); + $index = array_search('response_data', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1190,14 +1175,14 @@ public function getSignatures() /** * Sets signatures * - * @param SignatureRequestResponseSignatures[]|null $signatures An array of signature objects, 1 for each signer. + * @param SignatureRequestResponseSignatures[]|null $signatures an array of signature objects, 1 for each signer * * @return self */ - public function setSignatures($signatures) + public function setSignatures(?array $signatures) { if (is_null($signatures)) { - throw new \InvalidArgumentException('non-nullable signatures cannot be null'); + throw new InvalidArgumentException('non-nullable signatures cannot be null'); } $this->container['signatures'] = $signatures; @@ -1217,17 +1202,17 @@ public function getBulkSendJobId() /** * Sets bulk_send_job_id * - * @param string|null $bulk_send_job_id The ID of the Bulk Send job which sent the signature request, if applicable. + * @param string|null $bulk_send_job_id the ID of the Bulk Send job which sent the signature request, if applicable * * @return self */ - public function setBulkSendJobId($bulk_send_job_id) + public function setBulkSendJobId(?string $bulk_send_job_id) { if (is_null($bulk_send_job_id)) { array_push($this->openAPINullablesSetToNull, 'bulk_send_job_id'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('bulk_send_job_id', $nullablesSetToNull, true); + $index = array_search('bulk_send_job_id', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1237,14 +1222,13 @@ public function setBulkSendJobId($bulk_send_job_id) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1253,11 +1237,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1268,10 +1252,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1284,11 +1266,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1296,12 +1276,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1330,5 +1310,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestResponseAttachment.php b/sdks/php/src/Model/SignatureRequestResponseAttachment.php index 279d9e5cc..8a91a0b96 100644 --- a/sdks/php/src/Model/SignatureRequestResponseAttachment.php +++ b/sdks/php/src/Model/SignatureRequestResponseAttachment.php @@ -1,14 +1,11 @@ */ -class SignatureRequestResponseAttachment implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestResponseAttachment implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseAttachment'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'signer' => 'string', 'name' => 'string', 'required' => 'bool', 'instructions' => 'string', - 'uploaded_at' => 'int' + 'uploaded_at' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'id' => null, 'signer' => null, 'name' => null, 'required' => null, 'instructions' => null, - 'uploaded_at' => null + 'uploaded_at' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'id' => false, 'signer' => false, 'name' => false, 'required' => false, 'instructions' => true, - 'uploaded_at' => true + 'uploaded_at' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -127,8 +125,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -138,7 +134,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -148,7 +144,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -157,9 +153,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -168,9 +161,6 @@ 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 { @@ -189,7 +179,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'name', 'required' => 'required', 'instructions' => 'instructions', - 'uploaded_at' => 'uploaded_at' + 'uploaded_at' => 'uploaded_at', ]; /** @@ -203,7 +193,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'setName', 'required' => 'setRequired', 'instructions' => 'setInstructions', - 'uploaded_at' => 'setUploadedAt' + 'uploaded_at' => 'setUploadedAt', ]; /** @@ -217,7 +207,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'getName', 'required' => 'getRequired', 'instructions' => 'getInstructions', - 'uploaded_at' => 'getUploadedAt' + 'uploaded_at' => 'getUploadedAt', ]; /** @@ -261,7 +251,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -273,7 +262,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -285,34 +274,33 @@ public function __construct(?array $data = null) $this->setIfExists('uploaded_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseAttachment { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseAttachment { /** @var SignatureRequestResponseAttachment */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestResponseAttachment::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -357,7 +345,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets id * @@ -371,14 +358,14 @@ public function getId() /** * Sets id * - * @param string $id The unique ID for this attachment. + * @param string $id the unique ID for this attachment * * @return self */ - public function setId($id) + public function setId(string $id) { if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + throw new InvalidArgumentException('non-nullable id cannot be null'); } $this->container['id'] = $id; @@ -398,14 +385,14 @@ public function getSigner() /** * Sets signer * - * @param string $signer The Signer this attachment is assigned to. + * @param string $signer the Signer this attachment is assigned to * * @return self */ - public function setSigner($signer) + public function setSigner(string $signer) { if (is_null($signer)) { - throw new \InvalidArgumentException('non-nullable signer cannot be null'); + throw new InvalidArgumentException('non-nullable signer cannot be null'); } $this->container['signer'] = $signer; @@ -425,14 +412,14 @@ public function getName() /** * Sets name * - * @param string $name The name of this attachment. + * @param string $name the name of this attachment * * @return self */ - public function setName($name) + public function setName(string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -452,14 +439,14 @@ public function getRequired() /** * Sets required * - * @param bool $required A boolean value denoting if this attachment is required. + * @param bool $required a boolean value denoting if this attachment is required * * @return self */ - public function setRequired($required) + public function setRequired(bool $required) { if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + throw new InvalidArgumentException('non-nullable required cannot be null'); } $this->container['required'] = $required; @@ -479,17 +466,17 @@ public function getInstructions() /** * Sets instructions * - * @param string|null $instructions Instructions for Signer. + * @param string|null $instructions instructions for Signer * * @return self */ - public function setInstructions($instructions) + public function setInstructions(?string $instructions) { if (is_null($instructions)) { array_push($this->openAPINullablesSetToNull, 'instructions'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('instructions', $nullablesSetToNull, true); + $index = array_search('instructions', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -513,17 +500,17 @@ public function getUploadedAt() /** * Sets uploaded_at * - * @param int|null $uploaded_at Timestamp when attachment was uploaded by Signer. + * @param int|null $uploaded_at timestamp when attachment was uploaded by Signer * * @return self */ - public function setUploadedAt($uploaded_at) + public function setUploadedAt(?int $uploaded_at) { if (is_null($uploaded_at)) { array_push($this->openAPINullablesSetToNull, 'uploaded_at'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('uploaded_at', $nullablesSetToNull, true); + $index = array_search('uploaded_at', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -533,14 +520,13 @@ public function setUploadedAt($uploaded_at) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -549,11 +535,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -564,10 +550,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -580,11 +564,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -592,12 +574,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -626,5 +608,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestResponseCustomFieldBase.php b/sdks/php/src/Model/SignatureRequestResponseCustomFieldBase.php index dfab3276c..9d88d03f9 100644 --- a/sdks/php/src/Model/SignatureRequestResponseCustomFieldBase.php +++ b/sdks/php/src/Model/SignatureRequestResponseCustomFieldBase.php @@ -1,14 +1,11 @@ */ -class SignatureRequestResponseCustomFieldBase implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestResponseCustomFieldBase implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = 'type'; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseCustomFieldBase'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'name' => 'string', 'required' => 'bool', 'api_id' => 'string', - 'editor' => 'string' + 'editor' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'name' => null, 'required' => null, 'api_id' => null, - 'editor' => null + 'editor' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, 'name' => false, 'required' => false, 'api_id' => false, - 'editor' => true + 'editor' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -124,8 +122,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -135,7 +131,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -145,7 +141,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -154,9 +150,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -165,9 +158,6 @@ 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 { @@ -185,7 +175,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'name', 'required' => 'required', 'api_id' => 'api_id', - 'editor' => 'editor' + 'editor' => 'editor', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'setName', 'required' => 'setRequired', 'api_id' => 'setApiId', - 'editor' => 'setEditor' + 'editor' => 'setEditor', ]; /** @@ -211,7 +201,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'getName', 'required' => 'getRequired', 'api_id' => 'getApiId', - 'editor' => 'getEditor' + 'editor' => 'getEditor', ]; /** @@ -255,7 +245,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -267,7 +256,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -281,7 +270,6 @@ public function __construct(?array $data = null) $this->container['type'] = static::$openAPIModelName; } - public static function discriminatorClassName(array $data): ?string { if (!array_key_exists('type', $data)) { @@ -299,14 +287,12 @@ public static function discriminatorClassName(array $data): ?string } /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -345,7 +331,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -363,10 +348,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -386,14 +371,14 @@ public function getName() /** * Sets name * - * @param string $name The name of the Custom Field. + * @param string $name the name of the Custom Field * * @return self */ - public function setName($name) + public function setName(string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -413,14 +398,14 @@ public function getRequired() /** * Sets required * - * @param bool|null $required A boolean value denoting if this field is required. + * @param bool|null $required a boolean value denoting if this field is required * * @return self */ - public function setRequired($required) + public function setRequired(?bool $required) { if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + throw new InvalidArgumentException('non-nullable required cannot be null'); } $this->container['required'] = $required; @@ -440,14 +425,14 @@ public function getApiId() /** * Sets api_id * - * @param string|null $api_id The unique ID for this field. + * @param string|null $api_id the unique ID for this field * * @return self */ - public function setApiId($api_id) + public function setApiId(?string $api_id) { if (is_null($api_id)) { - throw new \InvalidArgumentException('non-nullable api_id cannot be null'); + throw new InvalidArgumentException('non-nullable api_id cannot be null'); } $this->container['api_id'] = $api_id; @@ -467,17 +452,17 @@ public function getEditor() /** * Sets editor * - * @param string|null $editor The name of the Role that is able to edit this field. + * @param string|null $editor the name of the Role that is able to edit this field * * @return self */ - public function setEditor($editor) + public function setEditor(?string $editor) { if (is_null($editor)) { array_push($this->openAPINullablesSetToNull, 'editor'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('editor', $nullablesSetToNull, true); + $index = array_search('editor', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -487,14 +472,13 @@ public function setEditor($editor) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -503,11 +487,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -518,10 +502,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -534,11 +516,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -546,12 +526,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -580,5 +560,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestResponseCustomFieldCheckbox.php b/sdks/php/src/Model/SignatureRequestResponseCustomFieldCheckbox.php index 5d249cfad..983134b39 100644 --- a/sdks/php/src/Model/SignatureRequestResponseCustomFieldCheckbox.php +++ b/sdks/php/src/Model/SignatureRequestResponseCustomFieldCheckbox.php @@ -1,14 +1,11 @@ */ class SignatureRequestResponseCustomFieldCheckbox extends SignatureRequestResponseCustomFieldBase @@ -46,49 +44,49 @@ class SignatureRequestResponseCustomFieldCheckbox extends SignatureRequestRespon public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseCustomFieldCheckbox'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'value' => 'bool' + 'value' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'value' => null + 'value' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, - 'value' => false + 'value' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,8 +111,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -124,7 +120,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +130,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,9 +139,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -154,9 +147,6 @@ 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 { @@ -171,7 +161,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'value' => 'value' + 'value' => 'value', ]; /** @@ -181,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'value' => 'setValue' + 'value' => 'setValue', ]; /** @@ -191,7 +181,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'value' => 'getValue' + 'value' => 'getValue', ]; /** @@ -235,13 +225,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -251,34 +239,33 @@ public function __construct(?array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseCustomFieldCheckbox { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseCustomFieldCheckbox { /** @var SignatureRequestResponseCustomFieldCheckbox */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestResponseCustomFieldCheckbox::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -314,7 +301,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -332,10 +318,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -359,23 +345,22 @@ public function getValue() * * @return self */ - public function setValue($value) + public function setValue(?bool $value) { if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + throw new InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -384,11 +369,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -399,10 +384,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -415,11 +398,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -427,12 +408,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -461,5 +442,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestResponseCustomFieldText.php b/sdks/php/src/Model/SignatureRequestResponseCustomFieldText.php index d97557059..6c4a94396 100644 --- a/sdks/php/src/Model/SignatureRequestResponseCustomFieldText.php +++ b/sdks/php/src/Model/SignatureRequestResponseCustomFieldText.php @@ -1,14 +1,11 @@ */ class SignatureRequestResponseCustomFieldText extends SignatureRequestResponseCustomFieldBase @@ -46,49 +44,49 @@ class SignatureRequestResponseCustomFieldText extends SignatureRequestResponseCu public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseCustomFieldText'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'value' => 'string' + 'value' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'value' => null + 'value' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, - 'value' => false + 'value' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,8 +111,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -124,7 +120,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +130,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,9 +139,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -154,9 +147,6 @@ 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 { @@ -171,7 +161,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'value' => 'value' + 'value' => 'value', ]; /** @@ -181,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'value' => 'setValue' + 'value' => 'setValue', ]; /** @@ -191,7 +181,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'value' => 'getValue' + 'value' => 'getValue', ]; /** @@ -235,13 +225,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -251,34 +239,33 @@ public function __construct(?array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseCustomFieldText { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseCustomFieldText { /** @var SignatureRequestResponseCustomFieldText */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestResponseCustomFieldText::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -314,7 +301,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -332,10 +318,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -359,23 +345,22 @@ public function getValue() * * @return self */ - public function setValue($value) + public function setValue(?string $value) { if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + throw new InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -384,11 +369,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -399,10 +384,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -415,11 +398,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -427,12 +408,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -461,5 +442,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestResponseCustomFieldTypeEnum.php b/sdks/php/src/Model/SignatureRequestResponseCustomFieldTypeEnum.php index 17f4e0706..f441dd572 100644 --- a/sdks/php/src/Model/SignatureRequestResponseCustomFieldTypeEnum.php +++ b/sdks/php/src/Model/SignatureRequestResponseCustomFieldTypeEnum.php @@ -1,14 +1,11 @@ */ -class SignatureRequestResponseDataBase implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestResponseDataBase implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = 'type'; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataBase'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'api_id' => 'string', 'signature_id' => 'string', 'name' => 'string', 'required' => 'bool', - 'type' => 'string' + 'type' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'api_id' => null, 'signature_id' => null, 'name' => null, 'required' => null, - 'type' => null + 'type' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'api_id' => false, 'signature_id' => false, 'name' => false, 'required' => false, - 'type' => false + 'type' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -124,8 +122,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -135,7 +131,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -145,7 +141,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -154,9 +150,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -165,9 +158,6 @@ 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 { @@ -185,7 +175,7 @@ public function isNullableSetToNull(string $property): bool 'signature_id' => 'signature_id', 'name' => 'name', 'required' => 'required', - 'type' => 'type' + 'type' => 'type', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool 'signature_id' => 'setSignatureId', 'name' => 'setName', 'required' => 'setRequired', - 'type' => 'setType' + 'type' => 'setType', ]; /** @@ -211,7 +201,7 @@ public function isNullableSetToNull(string $property): bool 'signature_id' => 'getSignatureId', 'name' => 'getName', 'required' => 'getRequired', - 'type' => 'getType' + 'type' => 'getType', ]; /** @@ -255,7 +245,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -267,7 +256,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -281,7 +270,6 @@ public function __construct(?array $data = null) $this->container['type'] = static::$openAPIModelName; } - public static function discriminatorClassName(array $data): ?string { if (!array_key_exists('type', $data)) { @@ -320,14 +308,12 @@ public static function discriminatorClassName(array $data): ?string } /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -344,9 +330,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -360,7 +344,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets api_id * @@ -374,14 +357,14 @@ public function getApiId() /** * Sets api_id * - * @param string|null $api_id The unique ID for this field. + * @param string|null $api_id the unique ID for this field * * @return self */ - public function setApiId($api_id) + public function setApiId(?string $api_id) { if (is_null($api_id)) { - throw new \InvalidArgumentException('non-nullable api_id cannot be null'); + throw new InvalidArgumentException('non-nullable api_id cannot be null'); } $this->container['api_id'] = $api_id; @@ -401,14 +384,14 @@ public function getSignatureId() /** * Sets signature_id * - * @param string|null $signature_id The ID of the signature to which this response is linked. + * @param string|null $signature_id the ID of the signature to which this response is linked * * @return self */ - public function setSignatureId($signature_id) + public function setSignatureId(?string $signature_id) { if (is_null($signature_id)) { - throw new \InvalidArgumentException('non-nullable signature_id cannot be null'); + throw new InvalidArgumentException('non-nullable signature_id cannot be null'); } $this->container['signature_id'] = $signature_id; @@ -428,14 +411,14 @@ public function getName() /** * Sets name * - * @param string|null $name The name of the form field. + * @param string|null $name the name of the form field * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -455,14 +438,14 @@ public function getRequired() /** * Sets required * - * @param bool|null $required A boolean value denoting if this field is required. + * @param bool|null $required a boolean value denoting if this field is required * * @return self */ - public function setRequired($required) + public function setRequired(?bool $required) { if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + throw new InvalidArgumentException('non-nullable required cannot be null'); } $this->container['required'] = $required; @@ -486,23 +469,22 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(?string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -511,11 +493,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -526,10 +508,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -542,11 +522,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -554,12 +532,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -588,5 +566,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestResponseDataTypeEnum.php b/sdks/php/src/Model/SignatureRequestResponseDataTypeEnum.php index f3ef8fb01..f8768e419 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataTypeEnum.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataTypeEnum.php @@ -1,14 +1,11 @@ */ class SignatureRequestResponseDataValueCheckbox extends SignatureRequestResponseDataBase @@ -45,49 +43,49 @@ class SignatureRequestResponseDataValueCheckbox extends SignatureRequestResponse public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataValueCheckbox'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'value' => 'bool' + 'value' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'value' => null + 'value' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, - 'value' => false + 'value' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,8 +110,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -123,7 +119,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -133,7 +129,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -142,9 +138,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -153,9 +146,6 @@ 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 { @@ -170,7 +160,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'value' => 'value' + 'value' => 'value', ]; /** @@ -180,7 +170,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'value' => 'setValue' + 'value' => 'setValue', ]; /** @@ -190,7 +180,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'value' => 'getValue' + 'value' => 'getValue', ]; /** @@ -234,13 +224,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -250,34 +238,33 @@ public function __construct(?array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseDataValueCheckbox { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseDataValueCheckbox { /** @var SignatureRequestResponseDataValueCheckbox */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueCheckbox::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,9 +281,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; + return parent::listInvalidProperties(); } /** @@ -310,7 +295,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -328,10 +312,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(?string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -351,27 +335,26 @@ public function getValue() /** * Sets value * - * @param bool|null $value The value of the form field. + * @param bool|null $value the value of the form field * * @return self */ - public function setValue($value) + public function setValue(?bool $value) { if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + throw new InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -380,11 +363,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -395,10 +378,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -411,11 +392,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -423,12 +402,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -457,5 +436,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueCheckboxMerge.php b/sdks/php/src/Model/SignatureRequestResponseDataValueCheckboxMerge.php index fa395f91c..bb808a601 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueCheckboxMerge.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueCheckboxMerge.php @@ -1,14 +1,11 @@ */ class SignatureRequestResponseDataValueCheckboxMerge extends SignatureRequestResponseDataBase @@ -45,49 +43,49 @@ class SignatureRequestResponseDataValueCheckboxMerge extends SignatureRequestRes public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataValueCheckboxMerge'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'value' => 'string' + 'value' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'value' => null + 'value' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, - 'value' => false + 'value' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,8 +110,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -123,7 +119,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -133,7 +129,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -142,9 +138,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -153,9 +146,6 @@ 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 { @@ -170,7 +160,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'value' => 'value' + 'value' => 'value', ]; /** @@ -180,7 +170,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'value' => 'setValue' + 'value' => 'setValue', ]; /** @@ -190,7 +180,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'value' => 'getValue' + 'value' => 'getValue', ]; /** @@ -234,13 +224,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -250,34 +238,33 @@ public function __construct(?array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseDataValueCheckboxMerge { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseDataValueCheckboxMerge { /** @var SignatureRequestResponseDataValueCheckboxMerge */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueCheckboxMerge::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,9 +281,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; + return parent::listInvalidProperties(); } /** @@ -310,7 +295,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -328,10 +312,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(?string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -351,27 +335,26 @@ public function getValue() /** * Sets value * - * @param string|null $value The value of the form field. + * @param string|null $value the value of the form field * * @return self */ - public function setValue($value) + public function setValue(?string $value) { if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + throw new InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -380,11 +363,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -395,10 +378,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -411,11 +392,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -423,12 +402,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -457,5 +436,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueDateSigned.php b/sdks/php/src/Model/SignatureRequestResponseDataValueDateSigned.php index e02c8a0ef..b422b6f5f 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueDateSigned.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueDateSigned.php @@ -1,14 +1,11 @@ */ class SignatureRequestResponseDataValueDateSigned extends SignatureRequestResponseDataBase @@ -45,49 +43,49 @@ class SignatureRequestResponseDataValueDateSigned extends SignatureRequestRespon public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataValueDateSigned'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'value' => 'string' + 'value' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'value' => null + 'value' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, - 'value' => false + 'value' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,8 +110,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -123,7 +119,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -133,7 +129,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -142,9 +138,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -153,9 +146,6 @@ 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 { @@ -170,7 +160,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'value' => 'value' + 'value' => 'value', ]; /** @@ -180,7 +170,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'value' => 'setValue' + 'value' => 'setValue', ]; /** @@ -190,7 +180,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'value' => 'getValue' + 'value' => 'getValue', ]; /** @@ -234,13 +224,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -250,34 +238,33 @@ public function __construct(?array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseDataValueDateSigned { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseDataValueDateSigned { /** @var SignatureRequestResponseDataValueDateSigned */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueDateSigned::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,9 +281,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; + return parent::listInvalidProperties(); } /** @@ -310,7 +295,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -328,10 +312,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(?string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -351,27 +335,26 @@ public function getValue() /** * Sets value * - * @param string|null $value The value of the form field. + * @param string|null $value the value of the form field * * @return self */ - public function setValue($value) + public function setValue(?string $value) { if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + throw new InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -380,11 +363,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -395,10 +378,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -411,11 +392,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -423,12 +402,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -457,5 +436,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueDropdown.php b/sdks/php/src/Model/SignatureRequestResponseDataValueDropdown.php index 495af4e93..e91201360 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueDropdown.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueDropdown.php @@ -1,14 +1,11 @@ */ class SignatureRequestResponseDataValueDropdown extends SignatureRequestResponseDataBase @@ -45,49 +43,49 @@ class SignatureRequestResponseDataValueDropdown extends SignatureRequestResponse public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataValueDropdown'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'value' => 'string' + 'value' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'value' => null + 'value' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, - 'value' => false + 'value' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,8 +110,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -123,7 +119,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -133,7 +129,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -142,9 +138,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -153,9 +146,6 @@ 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 { @@ -170,7 +160,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'value' => 'value' + 'value' => 'value', ]; /** @@ -180,7 +170,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'value' => 'setValue' + 'value' => 'setValue', ]; /** @@ -190,7 +180,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'value' => 'getValue' + 'value' => 'getValue', ]; /** @@ -234,13 +224,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -250,34 +238,33 @@ public function __construct(?array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseDataValueDropdown { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseDataValueDropdown { /** @var SignatureRequestResponseDataValueDropdown */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueDropdown::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,9 +281,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; + return parent::listInvalidProperties(); } /** @@ -310,7 +295,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -328,10 +312,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(?string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -351,27 +335,26 @@ public function getValue() /** * Sets value * - * @param string|null $value The value of the form field. + * @param string|null $value the value of the form field * * @return self */ - public function setValue($value) + public function setValue(?string $value) { if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + throw new InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -380,11 +363,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -395,10 +378,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -411,11 +392,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -423,12 +402,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -457,5 +436,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueInitials.php b/sdks/php/src/Model/SignatureRequestResponseDataValueInitials.php index b8d68df97..9cd07e08b 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueInitials.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueInitials.php @@ -1,14 +1,11 @@ */ class SignatureRequestResponseDataValueInitials extends SignatureRequestResponseDataBase @@ -45,52 +43,52 @@ class SignatureRequestResponseDataValueInitials extends SignatureRequestResponse public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataValueInitials'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'value' => 'string', - 'is_signed' => 'bool' + 'is_signed' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'value' => null, - 'is_signed' => null + 'is_signed' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, 'value' => false, - 'is_signed' => true + 'is_signed' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,8 +113,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -126,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -136,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -145,9 +141,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -156,9 +149,6 @@ 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 { @@ -174,7 +164,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'value' => 'value', - 'is_signed' => 'is_signed' + 'is_signed' => 'is_signed', ]; /** @@ -185,7 +175,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'value' => 'setValue', - 'is_signed' => 'setIsSigned' + 'is_signed' => 'setIsSigned', ]; /** @@ -196,7 +186,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'value' => 'getValue', - 'is_signed' => 'getIsSigned' + 'is_signed' => 'getIsSigned', ]; /** @@ -240,13 +230,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -257,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('is_signed', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseDataValueInitials { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseDataValueInitials { /** @var SignatureRequestResponseDataValueInitials */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueInitials::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -301,9 +288,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; + return parent::listInvalidProperties(); } /** @@ -317,7 +302,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -335,10 +319,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(?string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -358,14 +342,14 @@ public function getValue() /** * Sets value * - * @param string|null $value The value of the form field. + * @param string|null $value the value of the form field * * @return self */ - public function setValue($value) + public function setValue(?string $value) { if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + throw new InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; @@ -385,17 +369,17 @@ public function getIsSigned() /** * Sets is_signed * - * @param bool|null $is_signed This field contains the boolean true if the field is signed. + * @param bool|null $is_signed this field contains the boolean true if the field is signed * * @return self */ - public function setIsSigned($is_signed) + public function setIsSigned(?bool $is_signed) { if (is_null($is_signed)) { array_push($this->openAPINullablesSetToNull, 'is_signed'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('is_signed', $nullablesSetToNull, true); + $index = array_search('is_signed', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -405,14 +389,13 @@ public function setIsSigned($is_signed) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -421,11 +404,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -436,10 +419,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -452,11 +433,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -464,12 +443,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -498,5 +477,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueRadio.php b/sdks/php/src/Model/SignatureRequestResponseDataValueRadio.php index 9dc2c039a..fcd4570eb 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueRadio.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueRadio.php @@ -1,14 +1,11 @@ */ class SignatureRequestResponseDataValueRadio extends SignatureRequestResponseDataBase @@ -45,49 +43,49 @@ class SignatureRequestResponseDataValueRadio extends SignatureRequestResponseDat public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataValueRadio'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'value' => 'bool' + 'value' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'value' => null + 'value' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, - 'value' => false + 'value' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,8 +110,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -123,7 +119,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -133,7 +129,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -142,9 +138,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -153,9 +146,6 @@ 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 { @@ -170,7 +160,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'value' => 'value' + 'value' => 'value', ]; /** @@ -180,7 +170,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'value' => 'setValue' + 'value' => 'setValue', ]; /** @@ -190,7 +180,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'value' => 'getValue' + 'value' => 'getValue', ]; /** @@ -234,13 +224,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -250,34 +238,33 @@ public function __construct(?array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseDataValueRadio { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseDataValueRadio { /** @var SignatureRequestResponseDataValueRadio */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueRadio::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,9 +281,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; + return parent::listInvalidProperties(); } /** @@ -310,7 +295,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -328,10 +312,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(?string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -351,27 +335,26 @@ public function getValue() /** * Sets value * - * @param bool|null $value The value of the form field. + * @param bool|null $value the value of the form field * * @return self */ - public function setValue($value) + public function setValue(?bool $value) { if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + throw new InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -380,11 +363,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -395,10 +378,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -411,11 +392,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -423,12 +402,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -457,5 +436,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueSignature.php b/sdks/php/src/Model/SignatureRequestResponseDataValueSignature.php index 3576a9665..223ca960f 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueSignature.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueSignature.php @@ -1,14 +1,11 @@ */ class SignatureRequestResponseDataValueSignature extends SignatureRequestResponseDataBase @@ -45,52 +43,52 @@ class SignatureRequestResponseDataValueSignature extends SignatureRequestRespons public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataValueSignature'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'value' => 'string', - 'is_signed' => 'bool' + 'is_signed' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'value' => null, - 'is_signed' => null + 'is_signed' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, 'value' => false, - 'is_signed' => true + 'is_signed' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,8 +113,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -126,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -136,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -145,9 +141,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -156,9 +149,6 @@ 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 { @@ -174,7 +164,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'value' => 'value', - 'is_signed' => 'is_signed' + 'is_signed' => 'is_signed', ]; /** @@ -185,7 +175,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'value' => 'setValue', - 'is_signed' => 'setIsSigned' + 'is_signed' => 'setIsSigned', ]; /** @@ -196,7 +186,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'value' => 'getValue', - 'is_signed' => 'getIsSigned' + 'is_signed' => 'getIsSigned', ]; /** @@ -240,13 +230,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -257,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('is_signed', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseDataValueSignature { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseDataValueSignature { /** @var SignatureRequestResponseDataValueSignature */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueSignature::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -301,9 +288,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; + return parent::listInvalidProperties(); } /** @@ -317,7 +302,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -335,10 +319,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(?string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -358,14 +342,14 @@ public function getValue() /** * Sets value * - * @param string|null $value The value of the form field. + * @param string|null $value the value of the form field * * @return self */ - public function setValue($value) + public function setValue(?string $value) { if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + throw new InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; @@ -385,17 +369,17 @@ public function getIsSigned() /** * Sets is_signed * - * @param bool|null $is_signed This field contains the boolean true if the field is signed. + * @param bool|null $is_signed this field contains the boolean true if the field is signed * * @return self */ - public function setIsSigned($is_signed) + public function setIsSigned(?bool $is_signed) { if (is_null($is_signed)) { array_push($this->openAPINullablesSetToNull, 'is_signed'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('is_signed', $nullablesSetToNull, true); + $index = array_search('is_signed', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -405,14 +389,13 @@ public function setIsSigned($is_signed) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -421,11 +404,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -436,10 +419,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -452,11 +433,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -464,12 +443,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -498,5 +477,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueText.php b/sdks/php/src/Model/SignatureRequestResponseDataValueText.php index 722389b16..7c1c97b22 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueText.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueText.php @@ -1,14 +1,11 @@ */ class SignatureRequestResponseDataValueText extends SignatureRequestResponseDataBase @@ -45,49 +43,49 @@ class SignatureRequestResponseDataValueText extends SignatureRequestResponseData public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataValueText'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'value' => 'string' + 'value' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'value' => null + 'value' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, - 'value' => false + 'value' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,8 +110,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -123,7 +119,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -133,7 +129,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -142,9 +138,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -153,9 +146,6 @@ 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 { @@ -170,7 +160,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'value' => 'value' + 'value' => 'value', ]; /** @@ -180,7 +170,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'value' => 'setValue' + 'value' => 'setValue', ]; /** @@ -190,7 +180,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'value' => 'getValue' + 'value' => 'getValue', ]; /** @@ -234,13 +224,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -250,34 +238,33 @@ public function __construct(?array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseDataValueText { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseDataValueText { /** @var SignatureRequestResponseDataValueText */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueText::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,9 +281,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; + return parent::listInvalidProperties(); } /** @@ -310,7 +295,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -328,10 +312,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(?string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -351,27 +335,26 @@ public function getValue() /** * Sets value * - * @param string|null $value The value of the form field. + * @param string|null $value the value of the form field * * @return self */ - public function setValue($value) + public function setValue(?string $value) { if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + throw new InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -380,11 +363,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -395,10 +378,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -411,11 +392,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -423,12 +402,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -457,5 +436,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueTextMerge.php b/sdks/php/src/Model/SignatureRequestResponseDataValueTextMerge.php index 7fb653491..d8ea246f6 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueTextMerge.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueTextMerge.php @@ -1,14 +1,11 @@ */ class SignatureRequestResponseDataValueTextMerge extends SignatureRequestResponseDataBase @@ -45,49 +43,49 @@ class SignatureRequestResponseDataValueTextMerge extends SignatureRequestRespons public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseDataValueTextMerge'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'value' => 'string' + 'value' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'value' => null + 'value' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, - 'value' => false + 'value' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,8 +110,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -123,7 +119,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -133,7 +129,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -142,9 +138,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -153,9 +146,6 @@ 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 { @@ -170,7 +160,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'value' => 'value' + 'value' => 'value', ]; /** @@ -180,7 +170,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'value' => 'setValue' + 'value' => 'setValue', ]; /** @@ -190,7 +180,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'value' => 'getValue' + 'value' => 'getValue', ]; /** @@ -234,13 +224,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -250,34 +238,33 @@ public function __construct(?array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseDataValueTextMerge { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseDataValueTextMerge { /** @var SignatureRequestResponseDataValueTextMerge */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueTextMerge::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,9 +281,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; + return parent::listInvalidProperties(); } /** @@ -310,7 +295,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -328,10 +312,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(?string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -351,27 +335,26 @@ public function getValue() /** * Sets value * - * @param string|null $value The value of the form field. + * @param string|null $value the value of the form field * * @return self */ - public function setValue($value) + public function setValue(?string $value) { if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + throw new InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -380,11 +363,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -395,10 +378,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -411,11 +392,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -423,12 +402,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -457,5 +436,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestResponseSignatures.php b/sdks/php/src/Model/SignatureRequestResponseSignatures.php index 2e19c6a53..fa7653fa2 100644 --- a/sdks/php/src/Model/SignatureRequestResponseSignatures.php +++ b/sdks/php/src/Model/SignatureRequestResponseSignatures.php @@ -1,14 +1,11 @@ */ -class SignatureRequestResponseSignatures implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestResponseSignatures implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestResponseSignatures'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'signature_id' => 'string', 'signer_group_guid' => 'string', @@ -78,16 +76,16 @@ class SignatureRequestResponseSignatures implements ModelInterface, ArrayAccess, 'reassigned_by' => 'string', 'reassignment_reason' => 'string', 'reassigned_from' => 'string', - 'error' => 'string' + 'error' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'signature_id' => null, 'signer_group_guid' => null, @@ -107,14 +105,14 @@ class SignatureRequestResponseSignatures implements ModelInterface, ArrayAccess, 'reassigned_by' => null, 'reassignment_reason' => null, 'reassigned_from' => null, - 'error' => null + 'error' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'signature_id' => false, 'signer_group_guid' => true, @@ -134,14 +132,14 @@ class SignatureRequestResponseSignatures implements ModelInterface, ArrayAccess, 'reassigned_by' => true, 'reassignment_reason' => true, 'reassigned_from' => true, - 'error' => true + 'error' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -166,8 +164,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -177,7 +173,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -187,7 +183,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -196,9 +192,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -207,9 +200,6 @@ 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 { @@ -241,7 +231,7 @@ public function isNullableSetToNull(string $property): bool 'reassigned_by' => 'reassigned_by', 'reassignment_reason' => 'reassignment_reason', 'reassigned_from' => 'reassigned_from', - 'error' => 'error' + 'error' => 'error', ]; /** @@ -268,7 +258,7 @@ public function isNullableSetToNull(string $property): bool 'reassigned_by' => 'setReassignedBy', 'reassignment_reason' => 'setReassignmentReason', 'reassigned_from' => 'setReassignedFrom', - 'error' => 'setError' + 'error' => 'setError', ]; /** @@ -295,7 +285,7 @@ public function isNullableSetToNull(string $property): bool 'reassigned_by' => 'getReassignedBy', 'reassignment_reason' => 'getReassignmentReason', 'reassigned_from' => 'getReassignedFrom', - 'error' => 'getError' + 'error' => 'getError', ]; /** @@ -339,7 +329,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -351,7 +340,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -376,34 +365,33 @@ public function __construct(?array $data = null) $this->setIfExists('error', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseSignatures { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseSignatures { /** @var SignatureRequestResponseSignatures */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestResponseSignatures::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -420,9 +408,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -436,7 +422,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets signature_id * @@ -450,14 +435,14 @@ public function getSignatureId() /** * Sets signature_id * - * @param string|null $signature_id Signature identifier. + * @param string|null $signature_id signature identifier * * @return self */ - public function setSignatureId($signature_id) + public function setSignatureId(?string $signature_id) { if (is_null($signature_id)) { - throw new \InvalidArgumentException('non-nullable signature_id cannot be null'); + throw new InvalidArgumentException('non-nullable signature_id cannot be null'); } $this->container['signature_id'] = $signature_id; @@ -481,13 +466,13 @@ public function getSignerGroupGuid() * * @return self */ - public function setSignerGroupGuid($signer_group_guid) + public function setSignerGroupGuid(?string $signer_group_guid) { if (is_null($signer_group_guid)) { array_push($this->openAPINullablesSetToNull, 'signer_group_guid'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signer_group_guid', $nullablesSetToNull, true); + $index = array_search('signer_group_guid', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -511,14 +496,14 @@ public function getSignerEmailAddress() /** * Sets signer_email_address * - * @param string|null $signer_email_address The email address of the signer. + * @param string|null $signer_email_address the email address of the signer * * @return self */ - public function setSignerEmailAddress($signer_email_address) + public function setSignerEmailAddress(?string $signer_email_address) { if (is_null($signer_email_address)) { - throw new \InvalidArgumentException('non-nullable signer_email_address cannot be null'); + throw new InvalidArgumentException('non-nullable signer_email_address cannot be null'); } $this->container['signer_email_address'] = $signer_email_address; @@ -538,17 +523,17 @@ public function getSignerName() /** * Sets signer_name * - * @param string|null $signer_name The name of the signer. + * @param string|null $signer_name the name of the signer * * @return self */ - public function setSignerName($signer_name) + public function setSignerName(?string $signer_name) { if (is_null($signer_name)) { array_push($this->openAPINullablesSetToNull, 'signer_name'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signer_name', $nullablesSetToNull, true); + $index = array_search('signer_name', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -572,17 +557,17 @@ public function getSignerRole() /** * Sets signer_role * - * @param string|null $signer_role The role of the signer. + * @param string|null $signer_role the role of the signer * * @return self */ - public function setSignerRole($signer_role) + public function setSignerRole(?string $signer_role) { if (is_null($signer_role)) { array_push($this->openAPINullablesSetToNull, 'signer_role'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signer_role', $nullablesSetToNull, true); + $index = array_search('signer_role', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -606,17 +591,17 @@ public function getOrder() /** * Sets order * - * @param int|null $order If signer order is assigned this is the 0-based index for this signer. + * @param int|null $order if signer order is assigned this is the 0-based index for this signer * * @return self */ - public function setOrder($order) + public function setOrder(?int $order) { if (is_null($order)) { array_push($this->openAPINullablesSetToNull, 'order'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('order', $nullablesSetToNull, true); + $index = array_search('order', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -644,10 +629,10 @@ public function getStatusCode() * * @return self */ - public function setStatusCode($status_code) + public function setStatusCode(?string $status_code) { if (is_null($status_code)) { - throw new \InvalidArgumentException('non-nullable status_code cannot be null'); + throw new InvalidArgumentException('non-nullable status_code cannot be null'); } $this->container['status_code'] = $status_code; @@ -667,17 +652,17 @@ public function getDeclineReason() /** * Sets decline_reason * - * @param string|null $decline_reason The reason provided by the signer for declining the request. + * @param string|null $decline_reason the reason provided by the signer for declining the request * * @return self */ - public function setDeclineReason($decline_reason) + public function setDeclineReason(?string $decline_reason) { if (is_null($decline_reason)) { array_push($this->openAPINullablesSetToNull, 'decline_reason'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('decline_reason', $nullablesSetToNull, true); + $index = array_search('decline_reason', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -701,17 +686,17 @@ public function getSignedAt() /** * Sets signed_at * - * @param int|null $signed_at Time that the document was signed or null. + * @param int|null $signed_at time that the document was signed or null * * @return self */ - public function setSignedAt($signed_at) + public function setSignedAt(?int $signed_at) { if (is_null($signed_at)) { array_push($this->openAPINullablesSetToNull, 'signed_at'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signed_at', $nullablesSetToNull, true); + $index = array_search('signed_at', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -735,17 +720,17 @@ public function getLastViewedAt() /** * Sets last_viewed_at * - * @param int|null $last_viewed_at The time that the document was last viewed by this signer or null. + * @param int|null $last_viewed_at the time that the document was last viewed by this signer or null * * @return self */ - public function setLastViewedAt($last_viewed_at) + public function setLastViewedAt(?int $last_viewed_at) { if (is_null($last_viewed_at)) { array_push($this->openAPINullablesSetToNull, 'last_viewed_at'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('last_viewed_at', $nullablesSetToNull, true); + $index = array_search('last_viewed_at', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -769,17 +754,17 @@ public function getLastRemindedAt() /** * Sets last_reminded_at * - * @param int|null $last_reminded_at The time the last reminder email was sent to the signer or null. + * @param int|null $last_reminded_at the time the last reminder email was sent to the signer or null * * @return self */ - public function setLastRemindedAt($last_reminded_at) + public function setLastRemindedAt(?int $last_reminded_at) { if (is_null($last_reminded_at)) { array_push($this->openAPINullablesSetToNull, 'last_reminded_at'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('last_reminded_at', $nullablesSetToNull, true); + $index = array_search('last_reminded_at', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -803,14 +788,14 @@ public function getHasPin() /** * Sets has_pin * - * @param bool|null $has_pin Boolean to indicate whether this signature requires a PIN to access. + * @param bool|null $has_pin boolean to indicate whether this signature requires a PIN to access * * @return self */ - public function setHasPin($has_pin) + public function setHasPin(?bool $has_pin) { if (is_null($has_pin)) { - throw new \InvalidArgumentException('non-nullable has_pin cannot be null'); + throw new InvalidArgumentException('non-nullable has_pin cannot be null'); } $this->container['has_pin'] = $has_pin; @@ -830,17 +815,17 @@ public function getHasSmsAuth() /** * Sets has_sms_auth * - * @param bool|null $has_sms_auth Boolean to indicate whether this signature has SMS authentication enabled. + * @param bool|null $has_sms_auth boolean to indicate whether this signature has SMS authentication enabled * * @return self */ - public function setHasSmsAuth($has_sms_auth) + public function setHasSmsAuth(?bool $has_sms_auth) { if (is_null($has_sms_auth)) { array_push($this->openAPINullablesSetToNull, 'has_sms_auth'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('has_sms_auth', $nullablesSetToNull, true); + $index = array_search('has_sms_auth', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -864,17 +849,17 @@ public function getHasSmsDelivery() /** * Sets has_sms_delivery * - * @param bool|null $has_sms_delivery Boolean to indicate whether this signature has SMS delivery enabled. + * @param bool|null $has_sms_delivery boolean to indicate whether this signature has SMS delivery enabled * * @return self */ - public function setHasSmsDelivery($has_sms_delivery) + public function setHasSmsDelivery(?bool $has_sms_delivery) { if (is_null($has_sms_delivery)) { array_push($this->openAPINullablesSetToNull, 'has_sms_delivery'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('has_sms_delivery', $nullablesSetToNull, true); + $index = array_search('has_sms_delivery', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -898,17 +883,17 @@ public function getSmsPhoneNumber() /** * Sets sms_phone_number * - * @param string|null $sms_phone_number The SMS phone number used for authentication or signature request delivery. + * @param string|null $sms_phone_number the SMS phone number used for authentication or signature request delivery * * @return self */ - public function setSmsPhoneNumber($sms_phone_number) + public function setSmsPhoneNumber(?string $sms_phone_number) { if (is_null($sms_phone_number)) { array_push($this->openAPINullablesSetToNull, 'sms_phone_number'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('sms_phone_number', $nullablesSetToNull, true); + $index = array_search('sms_phone_number', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -932,17 +917,17 @@ public function getReassignedBy() /** * Sets reassigned_by * - * @param string|null $reassigned_by Email address of original signer who reassigned to this signer. + * @param string|null $reassigned_by email address of original signer who reassigned to this signer * * @return self */ - public function setReassignedBy($reassigned_by) + public function setReassignedBy(?string $reassigned_by) { if (is_null($reassigned_by)) { array_push($this->openAPINullablesSetToNull, 'reassigned_by'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('reassigned_by', $nullablesSetToNull, true); + $index = array_search('reassigned_by', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -966,17 +951,17 @@ public function getReassignmentReason() /** * Sets reassignment_reason * - * @param string|null $reassignment_reason Reason provided by original signer who reassigned to this signer. + * @param string|null $reassignment_reason reason provided by original signer who reassigned to this signer * * @return self */ - public function setReassignmentReason($reassignment_reason) + public function setReassignmentReason(?string $reassignment_reason) { if (is_null($reassignment_reason)) { array_push($this->openAPINullablesSetToNull, 'reassignment_reason'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('reassignment_reason', $nullablesSetToNull, true); + $index = array_search('reassignment_reason', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1000,17 +985,17 @@ public function getReassignedFrom() /** * Sets reassigned_from * - * @param string|null $reassigned_from Previous signature identifier. + * @param string|null $reassigned_from previous signature identifier * * @return self */ - public function setReassignedFrom($reassigned_from) + public function setReassignedFrom(?string $reassigned_from) { if (is_null($reassigned_from)) { array_push($this->openAPINullablesSetToNull, 'reassigned_from'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('reassigned_from', $nullablesSetToNull, true); + $index = array_search('reassigned_from', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1034,17 +1019,17 @@ public function getError() /** * Sets error * - * @param string|null $error Error message pertaining to this signer, or null. + * @param string|null $error error message pertaining to this signer, or null * * @return self */ - public function setError($error) + public function setError(?string $error) { if (is_null($error)) { array_push($this->openAPINullablesSetToNull, 'error'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('error', $nullablesSetToNull, true); + $index = array_search('error', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1054,14 +1039,13 @@ public function setError($error) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1070,11 +1054,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1085,10 +1069,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1101,11 +1083,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1113,12 +1093,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1147,5 +1127,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestSendRequest.php b/sdks/php/src/Model/SignatureRequestSendRequest.php index a8d77c8e0..f381a8d85 100644 --- a/sdks/php/src/Model/SignatureRequestSendRequest.php +++ b/sdks/php/src/Model/SignatureRequestSendRequest.php @@ -1,14 +1,11 @@ */ -class SignatureRequestSendRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestSendRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestSendRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'files' => '\SplFileObject[]', 'file_urls' => 'string[]', @@ -84,16 +83,16 @@ class SignatureRequestSendRequest implements ModelInterface, ArrayAccess, \JsonS 'test_mode' => 'bool', 'title' => 'string', 'use_text_tags' => 'bool', - 'expires_at' => 'int' + 'expires_at' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'files' => 'binary', 'file_urls' => null, @@ -120,14 +119,14 @@ class SignatureRequestSendRequest implements ModelInterface, ArrayAccess, \JsonS 'test_mode' => null, 'title' => null, 'use_text_tags' => null, - 'expires_at' => null + 'expires_at' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'files' => false, 'file_urls' => false, @@ -154,14 +153,14 @@ class SignatureRequestSendRequest implements ModelInterface, ArrayAccess, \JsonS 'test_mode' => false, 'title' => false, 'use_text_tags' => false, - 'expires_at' => true + 'expires_at' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -186,8 +185,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -197,7 +194,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -207,7 +204,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -216,9 +213,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -227,9 +221,6 @@ 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 { @@ -268,7 +259,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'test_mode', 'title' => 'title', 'use_text_tags' => 'use_text_tags', - 'expires_at' => 'expires_at' + 'expires_at' => 'expires_at', ]; /** @@ -302,7 +293,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'setTestMode', 'title' => 'setTitle', 'use_text_tags' => 'setUseTextTags', - 'expires_at' => 'setExpiresAt' + 'expires_at' => 'setExpiresAt', ]; /** @@ -336,7 +327,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'getTestMode', 'title' => 'getTitle', 'use_text_tags' => 'getUseTextTags', - 'expires_at' => 'getExpiresAt' + 'expires_at' => 'getExpiresAt', ]; /** @@ -380,7 +371,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -392,7 +382,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -424,34 +414,33 @@ public function __construct(?array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestSendRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestSendRequest { /** @var SignatureRequestSendRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestSendRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -496,11 +485,10 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets files * - * @return \SplFileObject[]|null + * @return SplFileObject[]|null */ public function getFiles() { @@ -510,14 +498,14 @@ public function getFiles() /** * Sets files * - * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles($files) + public function setFiles(?array $files) { if (is_null($files)) { - throw new \InvalidArgumentException('non-nullable files cannot be null'); + throw new InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -541,10 +529,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls($file_urls) + public function setFileUrls(?array $file_urls) { if (is_null($file_urls)) { - throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -568,10 +556,10 @@ public function getSigners() * * @return self */ - public function setSigners($signers) + public function setSigners(?array $signers) { if (is_null($signers)) { - throw new \InvalidArgumentException('non-nullable signers cannot be null'); + throw new InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -595,10 +583,10 @@ public function getGroupedSigners() * * @return self */ - public function setGroupedSigners($grouped_signers) + public function setGroupedSigners(?array $grouped_signers) { if (is_null($grouped_signers)) { - throw new \InvalidArgumentException('non-nullable grouped_signers cannot be null'); + throw new InvalidArgumentException('non-nullable grouped_signers cannot be null'); } $this->container['grouped_signers'] = $grouped_signers; @@ -622,10 +610,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline($allow_decline) + public function setAllowDecline(?bool $allow_decline) { if (is_null($allow_decline)) { - throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -649,10 +637,10 @@ public function getAllowReassign() * * @return self */ - public function setAllowReassign($allow_reassign) + public function setAllowReassign(?bool $allow_reassign) { if (is_null($allow_reassign)) { - throw new \InvalidArgumentException('non-nullable allow_reassign cannot be null'); + throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); } $this->container['allow_reassign'] = $allow_reassign; @@ -676,10 +664,10 @@ public function getAttachments() * * @return self */ - public function setAttachments($attachments) + public function setAttachments(?array $attachments) { if (is_null($attachments)) { - throw new \InvalidArgumentException('non-nullable attachments cannot be null'); + throw new InvalidArgumentException('non-nullable attachments cannot be null'); } $this->container['attachments'] = $attachments; @@ -699,14 +687,14 @@ public function getCcEmailAddresses() /** * Sets cc_email_addresses * - * @param string[]|null $cc_email_addresses The email addresses that should be CCed. + * @param string[]|null $cc_email_addresses the email addresses that should be CCed * * @return self */ - public function setCcEmailAddresses($cc_email_addresses) + public function setCcEmailAddresses(?array $cc_email_addresses) { if (is_null($cc_email_addresses)) { - throw new \InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); } $this->container['cc_email_addresses'] = $cc_email_addresses; @@ -730,10 +718,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(?string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -757,10 +745,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields($custom_fields) + public function setCustomFields(?array $custom_fields) { if (is_null($custom_fields)) { - throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -784,10 +772,10 @@ public function getFieldOptions() * * @return self */ - public function setFieldOptions($field_options) + public function setFieldOptions(?SubFieldOptions $field_options) { if (is_null($field_options)) { - throw new \InvalidArgumentException('non-nullable field_options cannot be null'); + throw new InvalidArgumentException('non-nullable field_options cannot be null'); } $this->container['field_options'] = $field_options; @@ -811,10 +799,10 @@ public function getFormFieldGroups() * * @return self */ - public function setFormFieldGroups($form_field_groups) + public function setFormFieldGroups(?array $form_field_groups) { if (is_null($form_field_groups)) { - throw new \InvalidArgumentException('non-nullable form_field_groups cannot be null'); + throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); } $this->container['form_field_groups'] = $form_field_groups; @@ -834,14 +822,14 @@ public function getFormFieldRules() /** * Sets form_field_rules * - * @param SubFormFieldRule[]|null $form_field_rules Conditional Logic rules for fields defined in `form_fields_per_document`. + * @param SubFormFieldRule[]|null $form_field_rules conditional Logic rules for fields defined in `form_fields_per_document` * * @return self */ - public function setFormFieldRules($form_field_rules) + public function setFormFieldRules(?array $form_field_rules) { if (is_null($form_field_rules)) { - throw new \InvalidArgumentException('non-nullable form_field_rules cannot be null'); + throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); } $this->container['form_field_rules'] = $form_field_rules; @@ -865,10 +853,10 @@ public function getFormFieldsPerDocument() * * @return self */ - public function setFormFieldsPerDocument($form_fields_per_document) + public function setFormFieldsPerDocument(?array $form_fields_per_document) { if (is_null($form_fields_per_document)) { - throw new \InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); } $this->container['form_fields_per_document'] = $form_fields_per_document; @@ -892,10 +880,10 @@ public function getHideTextTags() * * @return self */ - public function setHideTextTags($hide_text_tags) + public function setHideTextTags(?bool $hide_text_tags) { if (is_null($hide_text_tags)) { - throw new \InvalidArgumentException('non-nullable hide_text_tags cannot be null'); + throw new InvalidArgumentException('non-nullable hide_text_tags cannot be null'); } $this->container['hide_text_tags'] = $hide_text_tags; @@ -921,10 +909,10 @@ public function getIsQualifiedSignature() * @return self * @deprecated */ - public function setIsQualifiedSignature($is_qualified_signature) + public function setIsQualifiedSignature(?bool $is_qualified_signature) { if (is_null($is_qualified_signature)) { - throw new \InvalidArgumentException('non-nullable is_qualified_signature cannot be null'); + throw new InvalidArgumentException('non-nullable is_qualified_signature cannot be null'); } $this->container['is_qualified_signature'] = $is_qualified_signature; @@ -948,10 +936,10 @@ public function getIsEid() * * @return self */ - public function setIsEid($is_eid) + public function setIsEid(?bool $is_eid) { if (is_null($is_eid)) { - throw new \InvalidArgumentException('non-nullable is_eid cannot be null'); + throw new InvalidArgumentException('non-nullable is_eid cannot be null'); } $this->container['is_eid'] = $is_eid; @@ -971,17 +959,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message The custom message in the email that will be sent to the signers. + * @param string|null $message the custom message in the email that will be sent to the signers * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + throw new InvalidArgumentException('non-nullable message cannot be null'); } - if ((mb_strlen($message) > 5000)) { - throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestSendRequest., must be smaller than or equal to 5000.'); + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestSendRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -1006,13 +994,12 @@ public function getMetadata() * * @return self */ - public function setMetadata($metadata) + public function setMetadata(?array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } - $this->container['metadata'] = $metadata; return $this; @@ -1035,10 +1022,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions($signing_options) + public function setSigningOptions(?SubSigningOptions $signing_options) { if (is_null($signing_options)) { - throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -1058,14 +1045,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. + * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign * * @return self */ - public function setSigningRedirectUrl($signing_redirect_url) + public function setSigningRedirectUrl(?string $signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -1085,17 +1072,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject The subject in the email that will be sent to the signers. + * @param string|null $subject the subject in the email that will be sent to the signers * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { - throw new \InvalidArgumentException('non-nullable subject cannot be null'); + throw new InvalidArgumentException('non-nullable subject cannot be null'); } - if ((mb_strlen($subject) > 255)) { - throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestSendRequest., must be smaller than or equal to 255.'); + if (mb_strlen($subject) > 255) { + throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestSendRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -1120,10 +1107,10 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -1143,17 +1130,17 @@ public function getTitle() /** * Sets title * - * @param string|null $title The title you want to assign to the SignatureRequest. + * @param string|null $title the title you want to assign to the SignatureRequest * * @return self */ - public function setTitle($title) + public function setTitle(?string $title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + throw new InvalidArgumentException('non-nullable title cannot be null'); } - if ((mb_strlen($title) > 255)) { - throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestSendRequest., must be smaller than or equal to 255.'); + if (mb_strlen($title) > 255) { + throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestSendRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; @@ -1178,10 +1165,10 @@ public function getUseTextTags() * * @return self */ - public function setUseTextTags($use_text_tags) + public function setUseTextTags(?bool $use_text_tags) { if (is_null($use_text_tags)) { - throw new \InvalidArgumentException('non-nullable use_text_tags cannot be null'); + throw new InvalidArgumentException('non-nullable use_text_tags cannot be null'); } $this->container['use_text_tags'] = $use_text_tags; @@ -1205,13 +1192,13 @@ public function getExpiresAt() * * @return self */ - public function setExpiresAt($expires_at) + public function setExpiresAt(?int $expires_at) { if (is_null($expires_at)) { array_push($this->openAPINullablesSetToNull, 'expires_at'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('expires_at', $nullablesSetToNull, true); + $index = array_search('expires_at', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1221,14 +1208,13 @@ public function setExpiresAt($expires_at) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1237,11 +1223,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1252,10 +1238,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1268,11 +1252,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1280,12 +1262,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1314,5 +1296,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestSendWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestSendWithTemplateRequest.php index 27b2ed4e9..6f4cd28ff 100644 --- a/sdks/php/src/Model/SignatureRequestSendWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestSendWithTemplateRequest.php @@ -1,14 +1,11 @@ */ -class SignatureRequestSendWithTemplateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestSendWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestSendWithTemplateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template_ids' => 'string[]', 'signers' => '\Dropbox\Sign\Model\SubSignatureRequestTemplateSigner[]', @@ -76,16 +75,16 @@ class SignatureRequestSendWithTemplateRequest implements ModelInterface, ArrayAc 'signing_redirect_url' => 'string', 'subject' => 'string', 'test_mode' => 'bool', - 'title' => 'string' + 'title' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template_ids' => null, 'signers' => null, @@ -103,14 +102,14 @@ class SignatureRequestSendWithTemplateRequest implements ModelInterface, ArrayAc 'signing_redirect_url' => null, 'subject' => null, 'test_mode' => null, - 'title' => null + 'title' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'template_ids' => false, 'signers' => false, @@ -128,14 +127,14 @@ class SignatureRequestSendWithTemplateRequest implements ModelInterface, ArrayAc 'signing_redirect_url' => false, 'subject' => false, 'test_mode' => false, - 'title' => false + 'title' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -160,8 +159,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -171,7 +168,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -181,7 +178,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -190,9 +187,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -201,9 +195,6 @@ 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 { @@ -233,7 +224,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'signing_redirect_url', 'subject' => 'subject', 'test_mode' => 'test_mode', - 'title' => 'title' + 'title' => 'title', ]; /** @@ -258,7 +249,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'setSigningRedirectUrl', 'subject' => 'setSubject', 'test_mode' => 'setTestMode', - 'title' => 'setTitle' + 'title' => 'setTitle', ]; /** @@ -283,7 +274,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'getSigningRedirectUrl', 'subject' => 'getSubject', 'test_mode' => 'getTestMode', - 'title' => 'getTitle' + 'title' => 'getTitle', ]; /** @@ -327,7 +318,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -339,7 +329,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -362,34 +352,33 @@ public function __construct(?array $data = null) $this->setIfExists('title', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestSendWithTemplateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestSendWithTemplateRequest { /** @var SignatureRequestSendWithTemplateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestSendWithTemplateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -440,7 +429,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets template_ids * @@ -454,14 +442,14 @@ public function getTemplateIds() /** * Sets template_ids * - * @param string[] $template_ids Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + * @param string[] $template_ids use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used * * @return self */ - public function setTemplateIds($template_ids) + public function setTemplateIds(array $template_ids) { if (is_null($template_ids)) { - throw new \InvalidArgumentException('non-nullable template_ids cannot be null'); + throw new InvalidArgumentException('non-nullable template_ids cannot be null'); } $this->container['template_ids'] = $template_ids; @@ -481,14 +469,14 @@ public function getSigners() /** * Sets signers * - * @param SubSignatureRequestTemplateSigner[] $signers Add Signers to your Templated-based Signature Request. + * @param SubSignatureRequestTemplateSigner[] $signers add Signers to your Templated-based Signature Request * * @return self */ - public function setSigners($signers) + public function setSigners(array $signers) { if (is_null($signers)) { - throw new \InvalidArgumentException('non-nullable signers cannot be null'); + throw new InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -512,10 +500,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline($allow_decline) + public function setAllowDecline(?bool $allow_decline) { if (is_null($allow_decline)) { - throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -539,10 +527,10 @@ public function getCcs() * * @return self */ - public function setCcs($ccs) + public function setCcs(?array $ccs) { if (is_null($ccs)) { - throw new \InvalidArgumentException('non-nullable ccs cannot be null'); + throw new InvalidArgumentException('non-nullable ccs cannot be null'); } $this->container['ccs'] = $ccs; @@ -566,10 +554,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(?string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -593,10 +581,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields($custom_fields) + public function setCustomFields(?array $custom_fields) { if (is_null($custom_fields)) { - throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -606,7 +594,7 @@ public function setCustomFields($custom_fields) /** * Gets files * - * @return \SplFileObject[]|null + * @return SplFileObject[]|null */ public function getFiles() { @@ -616,14 +604,14 @@ public function getFiles() /** * Sets files * - * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles($files) + public function setFiles(?array $files) { if (is_null($files)) { - throw new \InvalidArgumentException('non-nullable files cannot be null'); + throw new InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -647,10 +635,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls($file_urls) + public function setFileUrls(?array $file_urls) { if (is_null($file_urls)) { - throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -676,10 +664,10 @@ public function getIsQualifiedSignature() * @return self * @deprecated */ - public function setIsQualifiedSignature($is_qualified_signature) + public function setIsQualifiedSignature(?bool $is_qualified_signature) { if (is_null($is_qualified_signature)) { - throw new \InvalidArgumentException('non-nullable is_qualified_signature cannot be null'); + throw new InvalidArgumentException('non-nullable is_qualified_signature cannot be null'); } $this->container['is_qualified_signature'] = $is_qualified_signature; @@ -703,10 +691,10 @@ public function getIsEid() * * @return self */ - public function setIsEid($is_eid) + public function setIsEid(?bool $is_eid) { if (is_null($is_eid)) { - throw new \InvalidArgumentException('non-nullable is_eid cannot be null'); + throw new InvalidArgumentException('non-nullable is_eid cannot be null'); } $this->container['is_eid'] = $is_eid; @@ -726,17 +714,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message The custom message in the email that will be sent to the signers. + * @param string|null $message the custom message in the email that will be sent to the signers * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + throw new InvalidArgumentException('non-nullable message cannot be null'); } - if ((mb_strlen($message) > 5000)) { - throw new \InvalidArgumentException('invalid length for $message when calling SignatureRequestSendWithTemplateRequest., must be smaller than or equal to 5000.'); + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestSendWithTemplateRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -761,13 +749,12 @@ public function getMetadata() * * @return self */ - public function setMetadata($metadata) + public function setMetadata(?array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } - $this->container['metadata'] = $metadata; return $this; @@ -790,10 +777,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions($signing_options) + public function setSigningOptions(?SubSigningOptions $signing_options) { if (is_null($signing_options)) { - throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -813,14 +800,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. + * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign * * @return self */ - public function setSigningRedirectUrl($signing_redirect_url) + public function setSigningRedirectUrl(?string $signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -840,17 +827,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject The subject in the email that will be sent to the signers. + * @param string|null $subject the subject in the email that will be sent to the signers * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { - throw new \InvalidArgumentException('non-nullable subject cannot be null'); + throw new InvalidArgumentException('non-nullable subject cannot be null'); } - if ((mb_strlen($subject) > 255)) { - throw new \InvalidArgumentException('invalid length for $subject when calling SignatureRequestSendWithTemplateRequest., must be smaller than or equal to 255.'); + if (mb_strlen($subject) > 255) { + throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestSendWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -875,10 +862,10 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -898,31 +885,30 @@ public function getTitle() /** * Sets title * - * @param string|null $title The title you want to assign to the SignatureRequest. + * @param string|null $title the title you want to assign to the SignatureRequest * * @return self */ - public function setTitle($title) + public function setTitle(?string $title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + throw new InvalidArgumentException('non-nullable title cannot be null'); } - if ((mb_strlen($title) > 255)) { - throw new \InvalidArgumentException('invalid length for $title when calling SignatureRequestSendWithTemplateRequest., must be smaller than or equal to 255.'); + if (mb_strlen($title) > 255) { + throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestSendWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -931,11 +917,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -946,10 +932,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -962,11 +946,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -974,12 +956,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1008,5 +990,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SignatureRequestUpdateRequest.php b/sdks/php/src/Model/SignatureRequestUpdateRequest.php index dbc1d7be8..c946720ca 100644 --- a/sdks/php/src/Model/SignatureRequestUpdateRequest.php +++ b/sdks/php/src/Model/SignatureRequestUpdateRequest.php @@ -1,14 +1,11 @@ */ -class SignatureRequestUpdateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class SignatureRequestUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignatureRequestUpdateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'signature_id' => 'string', 'email_address' => 'string', 'name' => 'string', - 'expires_at' => 'int' + 'expires_at' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'signature_id' => null, 'email_address' => 'email', 'name' => null, - 'expires_at' => null + 'expires_at' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'signature_id' => false, 'email_address' => false, 'name' => false, - 'expires_at' => true + 'expires_at' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -120,8 +118,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -131,7 +127,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -141,7 +137,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -150,9 +146,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -161,9 +154,6 @@ 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 { @@ -180,7 +170,7 @@ public function isNullableSetToNull(string $property): bool 'signature_id' => 'signature_id', 'email_address' => 'email_address', 'name' => 'name', - 'expires_at' => 'expires_at' + 'expires_at' => 'expires_at', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool 'signature_id' => 'setSignatureId', 'email_address' => 'setEmailAddress', 'name' => 'setName', - 'expires_at' => 'setExpiresAt' + 'expires_at' => 'setExpiresAt', ]; /** @@ -204,7 +194,7 @@ public function isNullableSetToNull(string $property): bool 'signature_id' => 'getSignatureId', 'email_address' => 'getEmailAddress', 'name' => 'getName', - 'expires_at' => 'getExpiresAt' + 'expires_at' => 'getExpiresAt', ]; /** @@ -248,7 +238,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -260,7 +249,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -270,34 +259,33 @@ public function __construct(?array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestUpdateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestUpdateRequest { /** @var SignatureRequestUpdateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SignatureRequestUpdateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -333,7 +321,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets signature_id * @@ -347,14 +334,14 @@ public function getSignatureId() /** * Sets signature_id * - * @param string $signature_id The signature ID for the recipient. + * @param string $signature_id the signature ID for the recipient * * @return self */ - public function setSignatureId($signature_id) + public function setSignatureId(string $signature_id) { if (is_null($signature_id)) { - throw new \InvalidArgumentException('non-nullable signature_id cannot be null'); + throw new InvalidArgumentException('non-nullable signature_id cannot be null'); } $this->container['signature_id'] = $signature_id; @@ -378,10 +365,10 @@ public function getEmailAddress() * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(?string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -405,10 +392,10 @@ public function getName() * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -432,13 +419,13 @@ public function getExpiresAt() * * @return self */ - public function setExpiresAt($expires_at) + public function setExpiresAt(?int $expires_at) { if (is_null($expires_at)) { array_push($this->openAPINullablesSetToNull, 'expires_at'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('expires_at', $nullablesSetToNull, true); + $index = array_search('expires_at', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -448,14 +435,13 @@ public function setExpiresAt($expires_at) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -464,11 +450,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -479,10 +465,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -495,11 +479,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -507,12 +489,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -541,5 +523,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubAttachment.php b/sdks/php/src/Model/SubAttachment.php index b76000840..ab6bfb504 100644 --- a/sdks/php/src/Model/SubAttachment.php +++ b/sdks/php/src/Model/SubAttachment.php @@ -1,14 +1,11 @@ */ -class SubAttachment implements ModelInterface, ArrayAccess, \JsonSerializable +class SubAttachment implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubAttachment'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', 'signer_index' => 'int', 'instructions' => 'string', - 'required' => 'bool' + 'required' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, 'signer_index' => null, 'instructions' => null, - 'required' => null + 'required' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'name' => false, 'signer_index' => false, 'instructions' => false, - 'required' => false + 'required' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -120,8 +118,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -131,7 +127,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -141,7 +137,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -150,9 +146,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -161,9 +154,6 @@ 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 { @@ -180,7 +170,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'name', 'signer_index' => 'signer_index', 'instructions' => 'instructions', - 'required' => 'required' + 'required' => 'required', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'setName', 'signer_index' => 'setSignerIndex', 'instructions' => 'setInstructions', - 'required' => 'setRequired' + 'required' => 'setRequired', ]; /** @@ -204,7 +194,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'getName', 'signer_index' => 'getSignerIndex', 'instructions' => 'getInstructions', - 'required' => 'getRequired' + 'required' => 'getRequired', ]; /** @@ -248,7 +238,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -260,7 +249,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -270,34 +259,33 @@ public function __construct(?array $data = null) $this->setIfExists('required', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubAttachment { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubAttachment { /** @var SubAttachment */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubAttachment::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -336,7 +324,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets name * @@ -350,14 +337,14 @@ public function getName() /** * Sets name * - * @param string $name The name of attachment. + * @param string $name the name of attachment * * @return self */ - public function setName($name) + public function setName(string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -381,10 +368,10 @@ public function getSignerIndex() * * @return self */ - public function setSignerIndex($signer_index) + public function setSignerIndex(int $signer_index) { if (is_null($signer_index)) { - throw new \InvalidArgumentException('non-nullable signer_index cannot be null'); + throw new InvalidArgumentException('non-nullable signer_index cannot be null'); } $this->container['signer_index'] = $signer_index; @@ -404,14 +391,14 @@ public function getInstructions() /** * Sets instructions * - * @param string|null $instructions The instructions for uploading the attachment. + * @param string|null $instructions the instructions for uploading the attachment * * @return self */ - public function setInstructions($instructions) + public function setInstructions(?string $instructions) { if (is_null($instructions)) { - throw new \InvalidArgumentException('non-nullable instructions cannot be null'); + throw new InvalidArgumentException('non-nullable instructions cannot be null'); } $this->container['instructions'] = $instructions; @@ -431,27 +418,26 @@ public function getRequired() /** * Sets required * - * @param bool|null $required Determines if the attachment must be uploaded. + * @param bool|null $required determines if the attachment must be uploaded * * @return self */ - public function setRequired($required) + public function setRequired(?bool $required) { if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + throw new InvalidArgumentException('non-nullable required cannot be null'); } $this->container['required'] = $required; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -460,11 +446,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -475,10 +461,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -491,11 +475,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -503,12 +485,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -537,5 +519,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubBulkSignerList.php b/sdks/php/src/Model/SubBulkSignerList.php index 8d0c68c4c..1ac8d7818 100644 --- a/sdks/php/src/Model/SubBulkSignerList.php +++ b/sdks/php/src/Model/SubBulkSignerList.php @@ -1,14 +1,11 @@ */ -class SubBulkSignerList implements ModelInterface, ArrayAccess, \JsonSerializable +class SubBulkSignerList implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubBulkSignerList'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'custom_fields' => '\Dropbox\Sign\Model\SubBulkSignerListCustomField[]', - 'signers' => '\Dropbox\Sign\Model\SubSignatureRequestTemplateSigner[]' + 'signers' => '\Dropbox\Sign\Model\SubSignatureRequestTemplateSigner[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'custom_fields' => null, - 'signers' => null + 'signers' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'custom_fields' => false, - 'signers' => false + 'signers' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'custom_fields' => 'custom_fields', - 'signers' => 'signers' + 'signers' => 'signers', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'custom_fields' => 'setCustomFields', - 'signers' => 'setSigners' + 'signers' => 'setSigners', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'custom_fields' => 'getCustomFields', - 'signers' => 'getSigners' + 'signers' => 'getSigners', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('signers', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubBulkSignerList { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubBulkSignerList { /** @var SubBulkSignerList */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubBulkSignerList::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -300,9 +288,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -316,7 +302,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets custom_fields * @@ -330,14 +315,14 @@ public function getCustomFields() /** * Sets custom_fields * - * @param SubBulkSignerListCustomField[]|null $custom_fields An array of custom field values. + * @param SubBulkSignerListCustomField[]|null $custom_fields an array of custom field values * * @return self */ - public function setCustomFields($custom_fields) + public function setCustomFields(?array $custom_fields) { if (is_null($custom_fields)) { - throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -361,23 +346,22 @@ public function getSigners() * * @return self */ - public function setSigners($signers) + public function setSigners(?array $signers) { if (is_null($signers)) { - throw new \InvalidArgumentException('non-nullable signers cannot be null'); + throw new InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -386,11 +370,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -401,10 +385,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -417,11 +399,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -429,12 +409,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -463,5 +443,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubBulkSignerListCustomField.php b/sdks/php/src/Model/SubBulkSignerListCustomField.php index 397903419..1f1580517 100644 --- a/sdks/php/src/Model/SubBulkSignerListCustomField.php +++ b/sdks/php/src/Model/SubBulkSignerListCustomField.php @@ -1,14 +1,11 @@ */ -class SubBulkSignerListCustomField implements ModelInterface, ArrayAccess, \JsonSerializable +class SubBulkSignerListCustomField implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubBulkSignerListCustomField'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', - 'value' => 'string' + 'value' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, - 'value' => null + 'value' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'name' => false, - 'value' => false + 'value' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'name' => 'name', - 'value' => 'value' + 'value' => 'value', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'name' => 'setName', - 'value' => 'setValue' + 'value' => 'setValue', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'name' => 'getName', - 'value' => 'getValue' + 'value' => 'getValue', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubBulkSignerListCustomField { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubBulkSignerListCustomField { /** @var SubBulkSignerListCustomField */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubBulkSignerListCustomField::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -322,7 +310,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets name * @@ -340,10 +327,10 @@ public function getName() * * @return self */ - public function setName($name) + public function setName(string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -363,27 +350,26 @@ public function getValue() /** * Sets value * - * @param string $value The value of the custom field. + * @param string $value the value of the custom field * * @return self */ - public function setValue($value) + public function setValue(string $value) { if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + throw new InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -392,11 +378,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -407,10 +393,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -423,11 +407,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -435,12 +417,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -469,5 +451,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubCC.php b/sdks/php/src/Model/SubCC.php index 56a7d14bd..2febcebb2 100644 --- a/sdks/php/src/Model/SubCC.php +++ b/sdks/php/src/Model/SubCC.php @@ -1,14 +1,11 @@ */ -class SubCC implements ModelInterface, ArrayAccess, \JsonSerializable +class SubCC implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubCC'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'role' => 'string', - 'email_address' => 'string' + 'email_address' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'role' => null, - 'email_address' => 'email' + 'email_address' => 'email', ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'role' => false, - 'email_address' => false + 'email_address' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'role' => 'role', - 'email_address' => 'email_address' + 'email_address' => 'email_address', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'role' => 'setRole', - 'email_address' => 'setEmailAddress' + 'email_address' => 'setEmailAddress', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'role' => 'getRole', - 'email_address' => 'getEmailAddress' + 'email_address' => 'getEmailAddress', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('email_address', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubCC { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubCC { /** @var SubCC */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubCC::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -322,7 +310,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets role * @@ -340,10 +327,10 @@ public function getRole() * * @return self */ - public function setRole($role) + public function setRole(string $role) { if (is_null($role)) { - throw new \InvalidArgumentException('non-nullable role cannot be null'); + throw new InvalidArgumentException('non-nullable role cannot be null'); } $this->container['role'] = $role; @@ -363,27 +350,26 @@ public function getEmailAddress() /** * Sets email_address * - * @param string $email_address The email address of the CC recipient. + * @param string $email_address the email address of the CC recipient * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -392,11 +378,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -407,10 +393,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -423,11 +407,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -435,12 +417,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -469,5 +451,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubCustomField.php b/sdks/php/src/Model/SubCustomField.php index 3084f80d4..4cf6dddee 100644 --- a/sdks/php/src/Model/SubCustomField.php +++ b/sdks/php/src/Model/SubCustomField.php @@ -1,14 +1,11 @@ */ -class SubCustomField implements ModelInterface, ArrayAccess, \JsonSerializable +class SubCustomField implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubCustomField'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', 'editor' => 'string', 'required' => 'bool', - 'value' => 'string' + 'value' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, 'editor' => null, 'required' => null, - 'value' => null + 'value' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'name' => false, 'editor' => false, 'required' => false, - 'value' => false + 'value' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -121,8 +119,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -132,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -142,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -151,9 +147,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -162,9 +155,6 @@ 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 { @@ -181,7 +171,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'name', 'editor' => 'editor', 'required' => 'required', - 'value' => 'value' + 'value' => 'value', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'setName', 'editor' => 'setEditor', 'required' => 'setRequired', - 'value' => 'setValue' + 'value' => 'setValue', ]; /** @@ -205,7 +195,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'getName', 'editor' => 'getEditor', 'required' => 'getRequired', - 'value' => 'getValue' + 'value' => 'getValue', ]; /** @@ -249,7 +239,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -261,7 +250,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -271,34 +260,33 @@ public function __construct(?array $data = null) $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubCustomField { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubCustomField { /** @var SubCustomField */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubCustomField::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -334,7 +322,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets name * @@ -352,10 +339,10 @@ public function getName() * * @return self */ - public function setName($name) + public function setName(string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -379,10 +366,10 @@ public function getEditor() * * @return self */ - public function setEditor($editor) + public function setEditor(?string $editor) { if (is_null($editor)) { - throw new \InvalidArgumentException('non-nullable editor cannot be null'); + throw new InvalidArgumentException('non-nullable editor cannot be null'); } $this->container['editor'] = $editor; @@ -406,10 +393,10 @@ public function getRequired() * * @return self */ - public function setRequired($required) + public function setRequired(?bool $required) { if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + throw new InvalidArgumentException('non-nullable required cannot be null'); } $this->container['required'] = $required; @@ -429,27 +416,26 @@ public function getValue() /** * Sets value * - * @param string|null $value The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing. + * @param string|null $value the string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing * * @return self */ - public function setValue($value) + public function setValue(?string $value) { if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + throw new InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -458,11 +444,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -473,10 +459,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -489,11 +473,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -501,12 +483,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -535,5 +517,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubEditorOptions.php b/sdks/php/src/Model/SubEditorOptions.php index d0cf50dbb..dc6d1e59a 100644 --- a/sdks/php/src/Model/SubEditorOptions.php +++ b/sdks/php/src/Model/SubEditorOptions.php @@ -1,14 +1,11 @@ */ -class SubEditorOptions implements ModelInterface, ArrayAccess, \JsonSerializable +class SubEditorOptions implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubEditorOptions'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'allow_edit_signers' => 'bool', - 'allow_edit_documents' => 'bool' + 'allow_edit_documents' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'allow_edit_signers' => null, - 'allow_edit_documents' => null + 'allow_edit_documents' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'allow_edit_signers' => false, - 'allow_edit_documents' => false + 'allow_edit_documents' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,8 +113,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -126,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -136,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -145,9 +141,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -156,9 +149,6 @@ 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 { @@ -173,7 +163,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'allow_edit_signers' => 'allow_edit_signers', - 'allow_edit_documents' => 'allow_edit_documents' + 'allow_edit_documents' => 'allow_edit_documents', ]; /** @@ -183,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'allow_edit_signers' => 'setAllowEditSigners', - 'allow_edit_documents' => 'setAllowEditDocuments' + 'allow_edit_documents' => 'setAllowEditDocuments', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'allow_edit_signers' => 'getAllowEditSigners', - 'allow_edit_documents' => 'getAllowEditDocuments' + 'allow_edit_documents' => 'getAllowEditDocuments', ]; /** @@ -237,7 +227,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -249,7 +238,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -257,34 +246,33 @@ public function __construct(?array $data = null) $this->setIfExists('allow_edit_documents', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubEditorOptions { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubEditorOptions { /** @var SubEditorOptions */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubEditorOptions::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -301,9 +289,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -317,7 +303,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets allow_edit_signers * @@ -335,10 +320,10 @@ public function getAllowEditSigners() * * @return self */ - public function setAllowEditSigners($allow_edit_signers) + public function setAllowEditSigners(?bool $allow_edit_signers) { if (is_null($allow_edit_signers)) { - throw new \InvalidArgumentException('non-nullable allow_edit_signers cannot be null'); + throw new InvalidArgumentException('non-nullable allow_edit_signers cannot be null'); } $this->container['allow_edit_signers'] = $allow_edit_signers; @@ -362,23 +347,22 @@ public function getAllowEditDocuments() * * @return self */ - public function setAllowEditDocuments($allow_edit_documents) + public function setAllowEditDocuments(?bool $allow_edit_documents) { if (is_null($allow_edit_documents)) { - throw new \InvalidArgumentException('non-nullable allow_edit_documents cannot be null'); + throw new InvalidArgumentException('non-nullable allow_edit_documents cannot be null'); } $this->container['allow_edit_documents'] = $allow_edit_documents; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -387,11 +371,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -402,10 +386,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -418,11 +400,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -430,12 +410,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -464,5 +444,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubFieldOptions.php b/sdks/php/src/Model/SubFieldOptions.php index eac5b169d..a74afbd7b 100644 --- a/sdks/php/src/Model/SubFieldOptions.php +++ b/sdks/php/src/Model/SubFieldOptions.php @@ -1,14 +1,11 @@ */ -class SubFieldOptions implements ModelInterface, ArrayAccess, \JsonSerializable +class SubFieldOptions implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFieldOptions'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'date_format' => 'string' + 'date_format' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'date_format' => null + 'date_format' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'date_format' => false + 'date_format' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,8 +110,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -123,7 +119,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -133,7 +129,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -142,9 +138,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -153,9 +146,6 @@ 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 { @@ -169,7 +159,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'date_format' => 'date_format' + 'date_format' => 'date_format', ]; /** @@ -178,7 +168,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'date_format' => 'setDateFormat' + 'date_format' => 'setDateFormat', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'date_format' => 'getDateFormat' + 'date_format' => 'getDateFormat', ]; /** @@ -266,41 +256,40 @@ public function getDateFormatAllowableValues() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { $this->setIfExists('date_format', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFieldOptions { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFieldOptions { /** @var SubFieldOptions */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubFieldOptions::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -345,7 +334,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets date_format * @@ -359,18 +347,18 @@ public function getDateFormat() /** * Sets date_format * - * @param string $date_format Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher. + * @param string $date_format allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher * * @return self */ - public function setDateFormat($date_format) + public function setDateFormat(string $date_format) { if (is_null($date_format)) { - throw new \InvalidArgumentException('non-nullable date_format cannot be null'); + throw new InvalidArgumentException('non-nullable date_format cannot be null'); } $allowedValues = $this->getDateFormatAllowableValues(); if (!in_array($date_format, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'date_format', must be one of '%s'", $date_format, @@ -382,14 +370,13 @@ public function setDateFormat($date_format) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -398,11 +385,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -413,10 +400,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -429,11 +414,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -441,12 +424,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -475,5 +458,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubFormFieldGroup.php b/sdks/php/src/Model/SubFormFieldGroup.php index da649762e..ba06d9be9 100644 --- a/sdks/php/src/Model/SubFormFieldGroup.php +++ b/sdks/php/src/Model/SubFormFieldGroup.php @@ -1,14 +1,11 @@ */ -class SubFormFieldGroup implements ModelInterface, ArrayAccess, \JsonSerializable +class SubFormFieldGroup implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldGroup'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'group_id' => 'string', 'group_label' => 'string', - 'requirement' => 'string' + 'requirement' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'group_id' => null, 'group_label' => null, - 'requirement' => null + 'requirement' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'group_id' => false, 'group_label' => false, - 'requirement' => false + 'requirement' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'group_id' => 'group_id', 'group_label' => 'group_label', - 'requirement' => 'requirement' + 'requirement' => 'requirement', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'group_id' => 'setGroupId', 'group_label' => 'setGroupLabel', - 'requirement' => 'setRequirement' + 'requirement' => 'setRequirement', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'group_id' => 'getGroupId', 'group_label' => 'getGroupLabel', - 'requirement' => 'getRequirement' + 'requirement' => 'getRequirement', ]; /** @@ -242,7 +232,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -254,7 +243,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -263,34 +252,33 @@ public function __construct(?array $data = null) $this->setIfExists('requirement', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldGroup { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldGroup { /** @var SubFormFieldGroup */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubFormFieldGroup::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -332,7 +320,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets group_id * @@ -350,10 +337,10 @@ public function getGroupId() * * @return self */ - public function setGroupId($group_id) + public function setGroupId(string $group_id) { if (is_null($group_id)) { - throw new \InvalidArgumentException('non-nullable group_id cannot be null'); + throw new InvalidArgumentException('non-nullable group_id cannot be null'); } $this->container['group_id'] = $group_id; @@ -377,10 +364,10 @@ public function getGroupLabel() * * @return self */ - public function setGroupLabel($group_label) + public function setGroupLabel(string $group_label) { if (is_null($group_label)) { - throw new \InvalidArgumentException('non-nullable group_label cannot be null'); + throw new InvalidArgumentException('non-nullable group_label cannot be null'); } $this->container['group_label'] = $group_label; @@ -404,23 +391,22 @@ public function getRequirement() * * @return self */ - public function setRequirement($requirement) + public function setRequirement(string $requirement) { if (is_null($requirement)) { - throw new \InvalidArgumentException('non-nullable requirement cannot be null'); + throw new InvalidArgumentException('non-nullable requirement cannot be null'); } $this->container['requirement'] = $requirement; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -429,11 +415,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -444,10 +430,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -460,11 +444,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -472,12 +454,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -506,5 +488,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubFormFieldRule.php b/sdks/php/src/Model/SubFormFieldRule.php index 5da8f60f8..41c47e642 100644 --- a/sdks/php/src/Model/SubFormFieldRule.php +++ b/sdks/php/src/Model/SubFormFieldRule.php @@ -1,14 +1,11 @@ */ -class SubFormFieldRule implements ModelInterface, ArrayAccess, \JsonSerializable +class SubFormFieldRule implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldRule'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'trigger_operator' => 'string', 'triggers' => '\Dropbox\Sign\Model\SubFormFieldRuleTrigger[]', - 'actions' => '\Dropbox\Sign\Model\SubFormFieldRuleAction[]' + 'actions' => '\Dropbox\Sign\Model\SubFormFieldRuleAction[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'id' => null, 'trigger_operator' => null, 'triggers' => null, - 'actions' => null + 'actions' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'id' => false, 'trigger_operator' => false, 'triggers' => false, - 'actions' => false + 'actions' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -120,8 +118,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -131,7 +127,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -141,7 +137,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -150,9 +146,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -161,9 +154,6 @@ 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 { @@ -180,7 +170,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'id', 'trigger_operator' => 'trigger_operator', 'triggers' => 'triggers', - 'actions' => 'actions' + 'actions' => 'actions', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'setId', 'trigger_operator' => 'setTriggerOperator', 'triggers' => 'setTriggers', - 'actions' => 'setActions' + 'actions' => 'setActions', ]; /** @@ -204,7 +194,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'getId', 'trigger_operator' => 'getTriggerOperator', 'triggers' => 'getTriggers', - 'actions' => 'getActions' + 'actions' => 'getActions', ]; /** @@ -248,7 +238,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -260,7 +249,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -270,34 +259,33 @@ public function __construct(?array $data = null) $this->setIfExists('actions', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldRule { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldRule { /** @var SubFormFieldRule */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubFormFieldRule::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -325,18 +313,18 @@ public function listInvalidProperties() if ($this->container['triggers'] === null) { $invalidProperties[] = "'triggers' can't be null"; } - if ((count($this->container['triggers']) > 1)) { + if (count($this->container['triggers']) > 1) { $invalidProperties[] = "invalid value for 'triggers', number of items must be less than or equal to 1."; } - if ((count($this->container['triggers']) < 1)) { + if (count($this->container['triggers']) < 1) { $invalidProperties[] = "invalid value for 'triggers', number of items must be greater than or equal to 1."; } if ($this->container['actions'] === null) { $invalidProperties[] = "'actions' can't be null"; } - if ((count($this->container['actions']) < 1)) { + if (count($this->container['actions']) < 1) { $invalidProperties[] = "invalid value for 'actions', number of items must be greater than or equal to 1."; } @@ -354,7 +342,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets id * @@ -368,14 +355,14 @@ public function getId() /** * Sets id * - * @param string $id Must be unique across all defined rules. + * @param string $id must be unique across all defined rules * * @return self */ - public function setId($id) + public function setId(string $id) { if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + throw new InvalidArgumentException('non-nullable id cannot be null'); } $this->container['id'] = $id; @@ -399,10 +386,10 @@ public function getTriggerOperator() * * @return self */ - public function setTriggerOperator($trigger_operator) + public function setTriggerOperator(string $trigger_operator) { if (is_null($trigger_operator)) { - throw new \InvalidArgumentException('non-nullable trigger_operator cannot be null'); + throw new InvalidArgumentException('non-nullable trigger_operator cannot be null'); } $this->container['trigger_operator'] = $trigger_operator; @@ -426,17 +413,17 @@ public function getTriggers() * * @return self */ - public function setTriggers($triggers) + public function setTriggers(array $triggers) { if (is_null($triggers)) { - throw new \InvalidArgumentException('non-nullable triggers cannot be null'); + throw new InvalidArgumentException('non-nullable triggers cannot be null'); } - if ((count($triggers) > 1)) { - throw new \InvalidArgumentException('invalid value for $triggers when calling SubFormFieldRule., number of items must be less than or equal to 1.'); + if (count($triggers) > 1) { + throw new InvalidArgumentException('invalid value for $triggers when calling SubFormFieldRule., number of items must be less than or equal to 1.'); } - if ((count($triggers) < 1)) { - throw new \InvalidArgumentException('invalid length for $triggers when calling SubFormFieldRule., number of items must be greater than or equal to 1.'); + if (count($triggers) < 1) { + throw new InvalidArgumentException('invalid length for $triggers when calling SubFormFieldRule., number of items must be greater than or equal to 1.'); } $this->container['triggers'] = $triggers; @@ -460,28 +447,26 @@ public function getActions() * * @return self */ - public function setActions($actions) + public function setActions(array $actions) { if (is_null($actions)) { - throw new \InvalidArgumentException('non-nullable actions cannot be null'); + throw new InvalidArgumentException('non-nullable actions cannot be null'); } - - if ((count($actions) < 1)) { - throw new \InvalidArgumentException('invalid length for $actions when calling SubFormFieldRule., number of items must be greater than or equal to 1.'); + if (count($actions) < 1) { + throw new InvalidArgumentException('invalid length for $actions when calling SubFormFieldRule., number of items must be greater than or equal to 1.'); } $this->container['actions'] = $actions; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -490,11 +475,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -505,10 +490,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -521,11 +504,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -533,12 +514,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -567,5 +548,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubFormFieldRuleAction.php b/sdks/php/src/Model/SubFormFieldRuleAction.php index 49b0c305a..3ec8988e9 100644 --- a/sdks/php/src/Model/SubFormFieldRuleAction.php +++ b/sdks/php/src/Model/SubFormFieldRuleAction.php @@ -1,14 +1,11 @@ */ -class SubFormFieldRuleAction implements ModelInterface, ArrayAccess, \JsonSerializable +class SubFormFieldRuleAction implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldRuleAction'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'hidden' => 'bool', 'type' => 'string', 'field_id' => 'string', - 'group_id' => 'string' + 'group_id' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'hidden' => null, 'type' => null, 'field_id' => null, - 'group_id' => null + 'group_id' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'hidden' => false, 'type' => false, 'field_id' => false, - 'group_id' => false + 'group_id' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -120,8 +118,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -131,7 +127,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -141,7 +137,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -150,9 +146,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -161,9 +154,6 @@ 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 { @@ -180,7 +170,7 @@ public function isNullableSetToNull(string $property): bool 'hidden' => 'hidden', 'type' => 'type', 'field_id' => 'field_id', - 'group_id' => 'group_id' + 'group_id' => 'group_id', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool 'hidden' => 'setHidden', 'type' => 'setType', 'field_id' => 'setFieldId', - 'group_id' => 'setGroupId' + 'group_id' => 'setGroupId', ]; /** @@ -204,7 +194,7 @@ public function isNullableSetToNull(string $property): bool 'hidden' => 'getHidden', 'type' => 'getType', 'field_id' => 'getFieldId', - 'group_id' => 'getGroupId' + 'group_id' => 'getGroupId', ]; /** @@ -275,7 +265,7 @@ public function getTypeAllowableValues() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -285,34 +275,33 @@ public function __construct(?array $data = null) $this->setIfExists('group_id', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldRuleAction { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldRuleAction { /** @var SubFormFieldRuleAction */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubFormFieldRuleAction::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -360,7 +349,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets hidden * @@ -374,14 +362,14 @@ public function getHidden() /** * Sets hidden * - * @param bool $hidden `true` to hide the target field when rule is satisfied, otherwise `false`. + * @param bool $hidden `true` to hide the target field when rule is satisfied, otherwise `false` * * @return self */ - public function setHidden($hidden) + public function setHidden(bool $hidden) { if (is_null($hidden)) { - throw new \InvalidArgumentException('non-nullable hidden cannot be null'); + throw new InvalidArgumentException('non-nullable hidden cannot be null'); } $this->container['hidden'] = $hidden; @@ -405,14 +393,14 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'type', must be one of '%s'", $type, @@ -442,10 +430,10 @@ public function getFieldId() * * @return self */ - public function setFieldId($field_id) + public function setFieldId(?string $field_id) { if (is_null($field_id)) { - throw new \InvalidArgumentException('non-nullable field_id cannot be null'); + throw new InvalidArgumentException('non-nullable field_id cannot be null'); } $this->container['field_id'] = $field_id; @@ -469,23 +457,22 @@ public function getGroupId() * * @return self */ - public function setGroupId($group_id) + public function setGroupId(?string $group_id) { if (is_null($group_id)) { - throw new \InvalidArgumentException('non-nullable group_id cannot be null'); + throw new InvalidArgumentException('non-nullable group_id cannot be null'); } $this->container['group_id'] = $group_id; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -494,11 +481,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -509,10 +496,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -525,11 +510,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -537,12 +520,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -571,5 +554,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubFormFieldRuleTrigger.php b/sdks/php/src/Model/SubFormFieldRuleTrigger.php index 3e42258fd..75fecd35c 100644 --- a/sdks/php/src/Model/SubFormFieldRuleTrigger.php +++ b/sdks/php/src/Model/SubFormFieldRuleTrigger.php @@ -1,14 +1,11 @@ */ -class SubFormFieldRuleTrigger implements ModelInterface, ArrayAccess, \JsonSerializable +class SubFormFieldRuleTrigger implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldRuleTrigger'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'operator' => 'string', 'value' => 'string', - 'values' => 'string[]' + 'values' => 'string[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'id' => null, 'operator' => null, 'value' => null, - 'values' => null + 'values' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'id' => false, 'operator' => false, 'value' => false, - 'values' => false + 'values' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -120,8 +118,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -131,7 +127,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -141,7 +137,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -150,9 +146,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -161,9 +154,6 @@ 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 { @@ -180,7 +170,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'id', 'operator' => 'operator', 'value' => 'value', - 'values' => 'values' + 'values' => 'values', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'setId', 'operator' => 'setOperator', 'value' => 'setValue', - 'values' => 'setValues' + 'values' => 'setValues', ]; /** @@ -204,7 +194,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'getId', 'operator' => 'getOperator', 'value' => 'getValue', - 'values' => 'getValues' + 'values' => 'getValues', ]; /** @@ -281,7 +271,7 @@ public function getOperatorAllowableValues() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -291,34 +281,33 @@ public function __construct(?array $data = null) $this->setIfExists('values', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldRuleTrigger { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldRuleTrigger { /** @var SubFormFieldRuleTrigger */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubFormFieldRuleTrigger::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -366,7 +355,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets id * @@ -384,10 +372,10 @@ public function getId() * * @return self */ - public function setId($id) + public function setId(string $id) { if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + throw new InvalidArgumentException('non-nullable id cannot be null'); } $this->container['id'] = $id; @@ -411,14 +399,14 @@ public function getOperator() * * @return self */ - public function setOperator($operator) + public function setOperator(string $operator) { if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); + throw new InvalidArgumentException('non-nullable operator cannot be null'); } $allowedValues = $this->getOperatorAllowableValues(); if (!in_array($operator, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'operator', must be one of '%s'", $operator, @@ -448,10 +436,10 @@ public function getValue() * * @return self */ - public function setValue($value) + public function setValue(?string $value) { if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + throw new InvalidArgumentException('non-nullable value cannot be null'); } $this->container['value'] = $value; @@ -475,23 +463,22 @@ public function getValues() * * @return self */ - public function setValues($values) + public function setValues(?array $values) { if (is_null($values)) { - throw new \InvalidArgumentException('non-nullable values cannot be null'); + throw new InvalidArgumentException('non-nullable values cannot be null'); } $this->container['values'] = $values; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -500,11 +487,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -515,10 +502,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -531,11 +516,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -543,12 +526,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -577,5 +560,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentBase.php b/sdks/php/src/Model/SubFormFieldsPerDocumentBase.php index e1f048ce9..085791ea9 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentBase.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentBase.php @@ -1,14 +1,11 @@ */ -class SubFormFieldsPerDocumentBase implements ModelInterface, ArrayAccess, \JsonSerializable +class SubFormFieldsPerDocumentBase implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = 'type'; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentBase'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'document_index' => 'int', 'api_id' => 'string', @@ -70,16 +68,16 @@ class SubFormFieldsPerDocumentBase implements ModelInterface, ArrayAccess, \Json 'x' => 'int', 'y' => 'int', 'name' => 'string', - 'page' => 'int' + 'page' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'document_index' => null, 'api_id' => null, @@ -91,14 +89,14 @@ class SubFormFieldsPerDocumentBase implements ModelInterface, ArrayAccess, \Json 'x' => null, 'y' => null, 'name' => null, - 'page' => null + 'page' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'document_index' => false, 'api_id' => false, @@ -110,14 +108,14 @@ class SubFormFieldsPerDocumentBase implements ModelInterface, ArrayAccess, \Json 'x' => false, 'y' => false, 'name' => false, - 'page' => true + 'page' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -142,8 +140,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -153,7 +149,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -163,7 +159,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -172,9 +168,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -183,9 +176,6 @@ 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 { @@ -209,7 +199,7 @@ public function isNullableSetToNull(string $property): bool 'x' => 'x', 'y' => 'y', 'name' => 'name', - 'page' => 'page' + 'page' => 'page', ]; /** @@ -228,7 +218,7 @@ public function isNullableSetToNull(string $property): bool 'x' => 'setX', 'y' => 'setY', 'name' => 'setName', - 'page' => 'setPage' + 'page' => 'setPage', ]; /** @@ -247,7 +237,7 @@ public function isNullableSetToNull(string $property): bool 'x' => 'getX', 'y' => 'getY', 'name' => 'getName', - 'page' => 'getPage' + 'page' => 'getPage', ]; /** @@ -291,7 +281,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -303,7 +292,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -323,7 +312,6 @@ public function __construct(?array $data = null) $this->container['type'] = static::$openAPIModelName; } - public static function discriminatorClassName(array $data): ?string { if (!array_key_exists('type', $data)) { @@ -365,14 +353,12 @@ public static function discriminatorClassName(array $data): ?string } /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -432,7 +418,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets document_index * @@ -446,14 +431,14 @@ public function getDocumentIndex() /** * Sets document_index * - * @param int $document_index Represents the integer index of the `file` or `file_url` document the field should be attached to. + * @param int $document_index represents the integer index of the `file` or `file_url` document the field should be attached to * * @return self */ - public function setDocumentIndex($document_index) + public function setDocumentIndex(int $document_index) { if (is_null($document_index)) { - throw new \InvalidArgumentException('non-nullable document_index cannot be null'); + throw new InvalidArgumentException('non-nullable document_index cannot be null'); } $this->container['document_index'] = $document_index; @@ -473,14 +458,14 @@ public function getApiId() /** * Sets api_id * - * @param string $api_id An identifier for the field that is unique across all documents in the request. + * @param string $api_id an identifier for the field that is unique across all documents in the request * * @return self */ - public function setApiId($api_id) + public function setApiId(string $api_id) { if (is_null($api_id)) { - throw new \InvalidArgumentException('non-nullable api_id cannot be null'); + throw new InvalidArgumentException('non-nullable api_id cannot be null'); } $this->container['api_id'] = $api_id; @@ -500,14 +485,14 @@ public function getHeight() /** * Sets height * - * @param int $height Size of the field in pixels. + * @param int $height size of the field in pixels * * @return self */ - public function setHeight($height) + public function setHeight(int $height) { if (is_null($height)) { - throw new \InvalidArgumentException('non-nullable height cannot be null'); + throw new InvalidArgumentException('non-nullable height cannot be null'); } $this->container['height'] = $height; @@ -527,14 +512,14 @@ public function getRequired() /** * Sets required * - * @param bool $required Whether this field is required. + * @param bool $required whether this field is required * * @return self */ - public function setRequired($required) + public function setRequired(bool $required) { if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + throw new InvalidArgumentException('non-nullable required cannot be null'); } $this->container['required'] = $required; @@ -558,10 +543,10 @@ public function getSigner() * * @return self */ - public function setSigner($signer) + public function setSigner(string $signer) { if (is_null($signer)) { - throw new \InvalidArgumentException('non-nullable signer cannot be null'); + throw new InvalidArgumentException('non-nullable signer cannot be null'); } $this->container['signer'] = $signer; @@ -585,10 +570,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -608,14 +593,14 @@ public function getWidth() /** * Sets width * - * @param int $width Size of the field in pixels. + * @param int $width size of the field in pixels * * @return self */ - public function setWidth($width) + public function setWidth(int $width) { if (is_null($width)) { - throw new \InvalidArgumentException('non-nullable width cannot be null'); + throw new InvalidArgumentException('non-nullable width cannot be null'); } $this->container['width'] = $width; @@ -635,14 +620,14 @@ public function getX() /** * Sets x * - * @param int $x Location coordinates of the field in pixels. + * @param int $x location coordinates of the field in pixels * * @return self */ - public function setX($x) + public function setX(int $x) { if (is_null($x)) { - throw new \InvalidArgumentException('non-nullable x cannot be null'); + throw new InvalidArgumentException('non-nullable x cannot be null'); } $this->container['x'] = $x; @@ -662,14 +647,14 @@ public function getY() /** * Sets y * - * @param int $y Location coordinates of the field in pixels. + * @param int $y location coordinates of the field in pixels * * @return self */ - public function setY($y) + public function setY(int $y) { if (is_null($y)) { - throw new \InvalidArgumentException('non-nullable y cannot be null'); + throw new InvalidArgumentException('non-nullable y cannot be null'); } $this->container['y'] = $y; @@ -689,14 +674,14 @@ public function getName() /** * Sets name * - * @param string|null $name Display name for the field. + * @param string|null $name display name for the field * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -720,13 +705,13 @@ public function getPage() * * @return self */ - public function setPage($page) + public function setPage(?int $page) { if (is_null($page)) { array_push($this->openAPINullablesSetToNull, 'page'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('page', $nullablesSetToNull, true); + $index = array_search('page', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -736,14 +721,13 @@ public function setPage($page) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -752,11 +736,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -767,10 +751,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -783,11 +765,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -795,12 +775,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -829,5 +809,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentCheckbox.php b/sdks/php/src/Model/SubFormFieldsPerDocumentCheckbox.php index c4a701564..c7610dfe4 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentCheckbox.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentCheckbox.php @@ -1,14 +1,11 @@ */ class SubFormFieldsPerDocumentCheckbox extends SubFormFieldsPerDocumentBase @@ -46,52 +44,52 @@ class SubFormFieldsPerDocumentCheckbox extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentCheckbox'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'is_checked' => 'bool', - 'group' => 'string' + 'group' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'is_checked' => null, - 'group' => null + 'group' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, 'is_checked' => false, - 'group' => false + 'group' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -116,8 +114,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -127,7 +123,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -137,7 +133,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -146,9 +142,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -157,9 +150,6 @@ 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 { @@ -175,7 +165,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'is_checked' => 'is_checked', - 'group' => 'group' + 'group' => 'group', ]; /** @@ -186,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'is_checked' => 'setIsChecked', - 'group' => 'setGroup' + 'group' => 'setGroup', ]; /** @@ -197,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'is_checked' => 'getIsChecked', - 'group' => 'getGroup' + 'group' => 'getGroup', ]; /** @@ -241,13 +231,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -258,34 +246,33 @@ public function __construct(?array $data = null) $this->setIfExists('group', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentCheckbox { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentCheckbox { /** @var SubFormFieldsPerDocumentCheckbox */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentCheckbox::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -324,7 +311,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -342,10 +328,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -365,14 +351,14 @@ public function getIsChecked() /** * Sets is_checked * - * @param bool $is_checked `true` for checking the checkbox field by default, otherwise `false`. + * @param bool $is_checked `true` for checking the checkbox field by default, otherwise `false` * * @return self */ - public function setIsChecked($is_checked) + public function setIsChecked(bool $is_checked) { if (is_null($is_checked)) { - throw new \InvalidArgumentException('non-nullable is_checked cannot be null'); + throw new InvalidArgumentException('non-nullable is_checked cannot be null'); } $this->container['is_checked'] = $is_checked; @@ -392,27 +378,26 @@ public function getGroup() /** * Sets group * - * @param string|null $group String referencing group defined in `form_field_groups` parameter. + * @param string|null $group string referencing group defined in `form_field_groups` parameter * * @return self */ - public function setGroup($group) + public function setGroup(?string $group) { if (is_null($group)) { - throw new \InvalidArgumentException('non-nullable group cannot be null'); + throw new InvalidArgumentException('non-nullable group cannot be null'); } $this->container['group'] = $group; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -421,11 +406,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -436,10 +421,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -452,11 +435,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -464,12 +445,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -498,5 +479,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentCheckboxMerge.php b/sdks/php/src/Model/SubFormFieldsPerDocumentCheckboxMerge.php index c0bb47c58..24ddfbfdd 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentCheckboxMerge.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentCheckboxMerge.php @@ -1,14 +1,11 @@ */ class SubFormFieldsPerDocumentCheckboxMerge extends SubFormFieldsPerDocumentBase @@ -46,46 +44,46 @@ class SubFormFieldsPerDocumentCheckboxMerge extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentCheckboxMerge'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string' + 'type' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null + 'type' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'type' => false + 'type' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,8 +108,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -121,7 +117,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +127,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,9 +136,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -151,9 +144,6 @@ 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 { @@ -167,7 +157,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type' + 'type' => 'type', ]; /** @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType' + 'type' => 'setType', ]; /** @@ -185,7 +175,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType' + 'type' => 'getType', ]; /** @@ -229,13 +219,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -244,34 +232,33 @@ public function __construct(?array $data = null) $this->setIfExists('type', $data ?? [], 'checkbox-merge'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentCheckboxMerge { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentCheckboxMerge { /** @var SubFormFieldsPerDocumentCheckboxMerge */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentCheckboxMerge::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,7 +294,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -325,23 +311,22 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -350,11 +335,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -365,10 +350,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -381,11 +364,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -393,12 +374,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -427,5 +408,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentDateSigned.php b/sdks/php/src/Model/SubFormFieldsPerDocumentDateSigned.php index 8fe168bc6..1e917ae01 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentDateSigned.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentDateSigned.php @@ -1,14 +1,11 @@ */ class SubFormFieldsPerDocumentDateSigned extends SubFormFieldsPerDocumentBase @@ -46,52 +44,52 @@ class SubFormFieldsPerDocumentDateSigned extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentDateSigned'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'font_family' => 'string', - 'font_size' => 'int' + 'font_size' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'font_family' => null, - 'font_size' => null + 'font_size' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, 'font_family' => false, - 'font_size' => false + 'font_size' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -116,8 +114,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -127,7 +123,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -137,7 +133,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -146,9 +142,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -157,9 +150,6 @@ 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 { @@ -175,7 +165,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'font_family' => 'font_family', - 'font_size' => 'font_size' + 'font_size' => 'font_size', ]; /** @@ -186,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'font_family' => 'setFontFamily', - 'font_size' => 'setFontSize' + 'font_size' => 'setFontSize', ]; /** @@ -197,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'font_family' => 'getFontFamily', - 'font_size' => 'getFontSize' + 'font_size' => 'getFontSize', ]; /** @@ -285,12 +275,11 @@ public function getFontFamilyAllowableValues() ]; } - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -301,34 +290,33 @@ public function __construct(?array $data = null) $this->setIfExists('font_size', $data ?? [], 12); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentDateSigned { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentDateSigned { /** @var SubFormFieldsPerDocumentDateSigned */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentDateSigned::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -373,7 +361,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -391,10 +378,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -414,18 +401,18 @@ public function getFontFamily() /** * Sets font_family * - * @param string|null $font_family Font family for the field. + * @param string|null $font_family font family for the field * * @return self */ - public function setFontFamily($font_family) + public function setFontFamily(?string $font_family) { if (is_null($font_family)) { - throw new \InvalidArgumentException('non-nullable font_family cannot be null'); + throw new InvalidArgumentException('non-nullable font_family cannot be null'); } $allowedValues = $this->getFontFamilyAllowableValues(); if (!in_array($font_family, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'font_family', must be one of '%s'", $font_family, @@ -455,23 +442,22 @@ public function getFontSize() * * @return self */ - public function setFontSize($font_size) + public function setFontSize(?int $font_size) { if (is_null($font_size)) { - throw new \InvalidArgumentException('non-nullable font_size cannot be null'); + throw new InvalidArgumentException('non-nullable font_size cannot be null'); } $this->container['font_size'] = $font_size; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -480,11 +466,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -495,10 +481,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -511,11 +495,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -523,12 +505,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -557,5 +539,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentDropdown.php b/sdks/php/src/Model/SubFormFieldsPerDocumentDropdown.php index d17020c31..f26d663f3 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentDropdown.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentDropdown.php @@ -1,14 +1,11 @@ */ class SubFormFieldsPerDocumentDropdown extends SubFormFieldsPerDocumentBase @@ -46,58 +44,58 @@ class SubFormFieldsPerDocumentDropdown extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentDropdown'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'options' => 'string[]', 'content' => 'string', 'font_family' => 'string', - 'font_size' => 'int' + 'font_size' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'options' => null, 'content' => null, 'font_family' => null, - 'font_size' => null + 'font_size' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, 'options' => false, 'content' => false, 'font_family' => false, - 'font_size' => false + 'font_size' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -122,8 +120,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -133,7 +129,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -143,7 +139,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -152,9 +148,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -163,9 +156,6 @@ 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 { @@ -183,7 +173,7 @@ public function isNullableSetToNull(string $property): bool 'options' => 'options', 'content' => 'content', 'font_family' => 'font_family', - 'font_size' => 'font_size' + 'font_size' => 'font_size', ]; /** @@ -196,7 +186,7 @@ public function isNullableSetToNull(string $property): bool 'options' => 'setOptions', 'content' => 'setContent', 'font_family' => 'setFontFamily', - 'font_size' => 'setFontSize' + 'font_size' => 'setFontSize', ]; /** @@ -209,7 +199,7 @@ public function isNullableSetToNull(string $property): bool 'options' => 'getOptions', 'content' => 'getContent', 'font_family' => 'getFontFamily', - 'font_size' => 'getFontSize' + 'font_size' => 'getFontSize', ]; /** @@ -297,12 +287,11 @@ public function getFontFamilyAllowableValues() ]; } - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -315,34 +304,33 @@ public function __construct(?array $data = null) $this->setIfExists('font_size', $data ?? [], 12); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentDropdown { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentDropdown { /** @var SubFormFieldsPerDocumentDropdown */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentDropdown::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -367,7 +355,7 @@ public function listInvalidProperties() if ($this->container['options'] === null) { $invalidProperties[] = "'options' can't be null"; } - if ((count($this->container['options']) < 1)) { + if (count($this->container['options']) < 1) { $invalidProperties[] = "invalid value for 'options', number of items must be greater than or equal to 1."; } @@ -394,7 +382,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -412,10 +399,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -435,19 +422,18 @@ public function getOptions() /** * Sets options * - * @param string[] $options Array of string values representing dropdown values. + * @param string[] $options array of string values representing dropdown values * * @return self */ - public function setOptions($options) + public function setOptions(array $options) { if (is_null($options)) { - throw new \InvalidArgumentException('non-nullable options cannot be null'); + throw new InvalidArgumentException('non-nullable options cannot be null'); } - - if ((count($options) < 1)) { - throw new \InvalidArgumentException('invalid length for $options when calling SubFormFieldsPerDocumentDropdown., number of items must be greater than or equal to 1.'); + if (count($options) < 1) { + throw new InvalidArgumentException('invalid length for $options when calling SubFormFieldsPerDocumentDropdown., number of items must be greater than or equal to 1.'); } $this->container['options'] = $options; @@ -471,10 +457,10 @@ public function getContent() * * @return self */ - public function setContent($content) + public function setContent(?string $content) { if (is_null($content)) { - throw new \InvalidArgumentException('non-nullable content cannot be null'); + throw new InvalidArgumentException('non-nullable content cannot be null'); } $this->container['content'] = $content; @@ -494,18 +480,18 @@ public function getFontFamily() /** * Sets font_family * - * @param string|null $font_family Font family for the field. + * @param string|null $font_family font family for the field * * @return self */ - public function setFontFamily($font_family) + public function setFontFamily(?string $font_family) { if (is_null($font_family)) { - throw new \InvalidArgumentException('non-nullable font_family cannot be null'); + throw new InvalidArgumentException('non-nullable font_family cannot be null'); } $allowedValues = $this->getFontFamilyAllowableValues(); if (!in_array($font_family, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'font_family', must be one of '%s'", $font_family, @@ -535,23 +521,22 @@ public function getFontSize() * * @return self */ - public function setFontSize($font_size) + public function setFontSize(?int $font_size) { if (is_null($font_size)) { - throw new \InvalidArgumentException('non-nullable font_size cannot be null'); + throw new InvalidArgumentException('non-nullable font_size cannot be null'); } $this->container['font_size'] = $font_size; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -560,11 +545,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -575,10 +560,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -591,11 +574,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -603,12 +584,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -637,5 +618,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentFontEnum.php b/sdks/php/src/Model/SubFormFieldsPerDocumentFontEnum.php index 377d7df3a..2e9bb512f 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentFontEnum.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentFontEnum.php @@ -1,14 +1,11 @@ */ class SubFormFieldsPerDocumentHyperlink extends SubFormFieldsPerDocumentBase @@ -46,58 +44,58 @@ class SubFormFieldsPerDocumentHyperlink extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentHyperlink'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'content' => 'string', 'content_url' => 'string', 'font_family' => 'string', - 'font_size' => 'int' + 'font_size' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'content' => null, 'content_url' => null, 'font_family' => null, - 'font_size' => null + 'font_size' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, 'content' => false, 'content_url' => false, 'font_family' => false, - 'font_size' => false + 'font_size' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -122,8 +120,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -133,7 +129,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -143,7 +139,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -152,9 +148,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -163,9 +156,6 @@ 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 { @@ -183,7 +173,7 @@ public function isNullableSetToNull(string $property): bool 'content' => 'content', 'content_url' => 'content_url', 'font_family' => 'font_family', - 'font_size' => 'font_size' + 'font_size' => 'font_size', ]; /** @@ -196,7 +186,7 @@ public function isNullableSetToNull(string $property): bool 'content' => 'setContent', 'content_url' => 'setContentUrl', 'font_family' => 'setFontFamily', - 'font_size' => 'setFontSize' + 'font_size' => 'setFontSize', ]; /** @@ -209,7 +199,7 @@ public function isNullableSetToNull(string $property): bool 'content' => 'getContent', 'content_url' => 'getContentUrl', 'font_family' => 'getFontFamily', - 'font_size' => 'getFontSize' + 'font_size' => 'getFontSize', ]; /** @@ -297,12 +287,11 @@ public function getFontFamilyAllowableValues() ]; } - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -315,34 +304,33 @@ public function __construct(?array $data = null) $this->setIfExists('font_size', $data ?? [], 12); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentHyperlink { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentHyperlink { /** @var SubFormFieldsPerDocumentHyperlink */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentHyperlink::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -393,7 +381,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -411,10 +398,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -434,14 +421,14 @@ public function getContent() /** * Sets content * - * @param string $content Link Text. + * @param string $content link Text * * @return self */ - public function setContent($content) + public function setContent(string $content) { if (is_null($content)) { - throw new \InvalidArgumentException('non-nullable content cannot be null'); + throw new InvalidArgumentException('non-nullable content cannot be null'); } $this->container['content'] = $content; @@ -461,14 +448,14 @@ public function getContentUrl() /** * Sets content_url * - * @param string $content_url Link URL. + * @param string $content_url link URL * * @return self */ - public function setContentUrl($content_url) + public function setContentUrl(string $content_url) { if (is_null($content_url)) { - throw new \InvalidArgumentException('non-nullable content_url cannot be null'); + throw new InvalidArgumentException('non-nullable content_url cannot be null'); } $this->container['content_url'] = $content_url; @@ -488,18 +475,18 @@ public function getFontFamily() /** * Sets font_family * - * @param string|null $font_family Font family for the field. + * @param string|null $font_family font family for the field * * @return self */ - public function setFontFamily($font_family) + public function setFontFamily(?string $font_family) { if (is_null($font_family)) { - throw new \InvalidArgumentException('non-nullable font_family cannot be null'); + throw new InvalidArgumentException('non-nullable font_family cannot be null'); } $allowedValues = $this->getFontFamilyAllowableValues(); if (!in_array($font_family, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'font_family', must be one of '%s'", $font_family, @@ -529,23 +516,22 @@ public function getFontSize() * * @return self */ - public function setFontSize($font_size) + public function setFontSize(?int $font_size) { if (is_null($font_size)) { - throw new \InvalidArgumentException('non-nullable font_size cannot be null'); + throw new InvalidArgumentException('non-nullable font_size cannot be null'); } $this->container['font_size'] = $font_size; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -554,11 +540,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -569,10 +555,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -585,11 +569,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -597,12 +579,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -631,5 +613,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentInitials.php b/sdks/php/src/Model/SubFormFieldsPerDocumentInitials.php index a0a8448bf..d74b4ad1a 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentInitials.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentInitials.php @@ -1,14 +1,11 @@ */ class SubFormFieldsPerDocumentInitials extends SubFormFieldsPerDocumentBase @@ -46,46 +44,46 @@ class SubFormFieldsPerDocumentInitials extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentInitials'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string' + 'type' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null + 'type' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'type' => false + 'type' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,8 +108,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -121,7 +117,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +127,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,9 +136,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -151,9 +144,6 @@ 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 { @@ -167,7 +157,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type' + 'type' => 'type', ]; /** @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType' + 'type' => 'setType', ]; /** @@ -185,7 +175,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType' + 'type' => 'getType', ]; /** @@ -229,13 +219,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -244,34 +232,33 @@ public function __construct(?array $data = null) $this->setIfExists('type', $data ?? [], 'initials'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentInitials { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentInitials { /** @var SubFormFieldsPerDocumentInitials */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentInitials::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,7 +294,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -325,23 +311,22 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -350,11 +335,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -365,10 +350,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -381,11 +364,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -393,12 +374,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -427,5 +408,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentRadio.php b/sdks/php/src/Model/SubFormFieldsPerDocumentRadio.php index 52ee3070f..962382cc2 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentRadio.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentRadio.php @@ -1,14 +1,11 @@ */ class SubFormFieldsPerDocumentRadio extends SubFormFieldsPerDocumentBase @@ -46,52 +44,52 @@ class SubFormFieldsPerDocumentRadio extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentRadio'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'group' => 'string', - 'is_checked' => 'bool' + 'is_checked' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'group' => null, - 'is_checked' => null + 'is_checked' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, 'group' => false, - 'is_checked' => false + 'is_checked' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -116,8 +114,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -127,7 +123,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -137,7 +133,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -146,9 +142,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -157,9 +150,6 @@ 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 { @@ -175,7 +165,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'group' => 'group', - 'is_checked' => 'is_checked' + 'is_checked' => 'is_checked', ]; /** @@ -186,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'group' => 'setGroup', - 'is_checked' => 'setIsChecked' + 'is_checked' => 'setIsChecked', ]; /** @@ -197,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'group' => 'getGroup', - 'is_checked' => 'getIsChecked' + 'is_checked' => 'getIsChecked', ]; /** @@ -241,13 +231,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -258,34 +246,33 @@ public function __construct(?array $data = null) $this->setIfExists('is_checked', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentRadio { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentRadio { /** @var SubFormFieldsPerDocumentRadio */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentRadio::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -327,7 +314,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -345,10 +331,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -368,14 +354,14 @@ public function getGroup() /** * Sets group * - * @param string $group String referencing group defined in `form_field_groups` parameter. + * @param string $group string referencing group defined in `form_field_groups` parameter * * @return self */ - public function setGroup($group) + public function setGroup(string $group) { if (is_null($group)) { - throw new \InvalidArgumentException('non-nullable group cannot be null'); + throw new InvalidArgumentException('non-nullable group cannot be null'); } $this->container['group'] = $group; @@ -399,23 +385,22 @@ public function getIsChecked() * * @return self */ - public function setIsChecked($is_checked) + public function setIsChecked(bool $is_checked) { if (is_null($is_checked)) { - throw new \InvalidArgumentException('non-nullable is_checked cannot be null'); + throw new InvalidArgumentException('non-nullable is_checked cannot be null'); } $this->container['is_checked'] = $is_checked; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -424,11 +409,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -439,10 +424,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -455,11 +438,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -467,12 +448,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -501,5 +482,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentSignature.php b/sdks/php/src/Model/SubFormFieldsPerDocumentSignature.php index 8e88f3de8..b4c228bb6 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentSignature.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentSignature.php @@ -1,14 +1,11 @@ */ class SubFormFieldsPerDocumentSignature extends SubFormFieldsPerDocumentBase @@ -46,46 +44,46 @@ class SubFormFieldsPerDocumentSignature extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentSignature'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string' + 'type' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null + 'type' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'type' => false + 'type' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,8 +108,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -121,7 +117,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +127,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,9 +136,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -151,9 +144,6 @@ 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 { @@ -167,7 +157,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type' + 'type' => 'type', ]; /** @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType' + 'type' => 'setType', ]; /** @@ -185,7 +175,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType' + 'type' => 'getType', ]; /** @@ -229,13 +219,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -244,34 +232,33 @@ public function __construct(?array $data = null) $this->setIfExists('type', $data ?? [], 'signature'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentSignature { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentSignature { /** @var SubFormFieldsPerDocumentSignature */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentSignature::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,7 +294,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -325,23 +311,22 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -350,11 +335,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -365,10 +350,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -381,11 +364,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -393,12 +374,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -427,5 +408,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentText.php b/sdks/php/src/Model/SubFormFieldsPerDocumentText.php index 8ea9623e6..1cb1f6e8f 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentText.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentText.php @@ -1,14 +1,11 @@ */ class SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase @@ -46,17 +44,17 @@ class SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentText'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'placeholder' => 'string', @@ -68,16 +66,16 @@ class SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase 'validation_custom_regex_format_label' => 'string', 'content' => 'string', 'font_family' => 'string', - 'font_size' => 'int' + 'font_size' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'placeholder' => null, @@ -89,14 +87,14 @@ class SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase 'validation_custom_regex_format_label' => null, 'content' => null, 'font_family' => null, - 'font_size' => null + 'font_size' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, 'placeholder' => false, @@ -108,14 +106,14 @@ class SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase 'validation_custom_regex_format_label' => false, 'content' => false, 'font_family' => false, - 'font_size' => false + 'font_size' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -140,8 +138,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -151,7 +147,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -161,7 +157,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -170,9 +166,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -181,9 +174,6 @@ 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 { @@ -207,7 +197,7 @@ public function isNullableSetToNull(string $property): bool 'validation_custom_regex_format_label' => 'validation_custom_regex_format_label', 'content' => 'content', 'font_family' => 'font_family', - 'font_size' => 'font_size' + 'font_size' => 'font_size', ]; /** @@ -226,7 +216,7 @@ public function isNullableSetToNull(string $property): bool 'validation_custom_regex_format_label' => 'setValidationCustomRegexFormatLabel', 'content' => 'setContent', 'font_family' => 'setFontFamily', - 'font_size' => 'setFontSize' + 'font_size' => 'setFontSize', ]; /** @@ -245,7 +235,7 @@ public function isNullableSetToNull(string $property): bool 'validation_custom_regex_format_label' => 'getValidationCustomRegexFormatLabel', 'content' => 'getContent', 'font_family' => 'getFontFamily', - 'font_size' => 'getFontSize' + 'font_size' => 'getFontSize', ]; /** @@ -364,12 +354,11 @@ public function getFontFamilyAllowableValues() ]; } - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -388,34 +377,33 @@ public function __construct(?array $data = null) $this->setIfExists('font_size', $data ?? [], 12); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentText { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentText { /** @var SubFormFieldsPerDocumentText */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentText::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -469,7 +457,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -487,10 +474,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -510,14 +497,14 @@ public function getPlaceholder() /** * Sets placeholder * - * @param string|null $placeholder Placeholder value for text field. + * @param string|null $placeholder placeholder value for text field * * @return self */ - public function setPlaceholder($placeholder) + public function setPlaceholder(?string $placeholder) { if (is_null($placeholder)) { - throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); + throw new InvalidArgumentException('non-nullable placeholder cannot be null'); } $this->container['placeholder'] = $placeholder; @@ -541,10 +528,10 @@ public function getAutoFillType() * * @return self */ - public function setAutoFillType($auto_fill_type) + public function setAutoFillType(?string $auto_fill_type) { if (is_null($auto_fill_type)) { - throw new \InvalidArgumentException('non-nullable auto_fill_type cannot be null'); + throw new InvalidArgumentException('non-nullable auto_fill_type cannot be null'); } $this->container['auto_fill_type'] = $auto_fill_type; @@ -568,10 +555,10 @@ public function getLinkId() * * @return self */ - public function setLinkId($link_id) + public function setLinkId(?string $link_id) { if (is_null($link_id)) { - throw new \InvalidArgumentException('non-nullable link_id cannot be null'); + throw new InvalidArgumentException('non-nullable link_id cannot be null'); } $this->container['link_id'] = $link_id; @@ -595,10 +582,10 @@ public function getMasked() * * @return self */ - public function setMasked($masked) + public function setMasked(?bool $masked) { if (is_null($masked)) { - throw new \InvalidArgumentException('non-nullable masked cannot be null'); + throw new InvalidArgumentException('non-nullable masked cannot be null'); } $this->container['masked'] = $masked; @@ -622,14 +609,14 @@ public function getValidationType() * * @return self */ - public function setValidationType($validation_type) + public function setValidationType(?string $validation_type) { if (is_null($validation_type)) { - throw new \InvalidArgumentException('non-nullable validation_type cannot be null'); + throw new InvalidArgumentException('non-nullable validation_type cannot be null'); } $allowedValues = $this->getValidationTypeAllowableValues(); if (!in_array($validation_type, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'validation_type', must be one of '%s'", $validation_type, @@ -659,10 +646,10 @@ public function getValidationCustomRegex() * * @return self */ - public function setValidationCustomRegex($validation_custom_regex) + public function setValidationCustomRegex(?string $validation_custom_regex) { if (is_null($validation_custom_regex)) { - throw new \InvalidArgumentException('non-nullable validation_custom_regex cannot be null'); + throw new InvalidArgumentException('non-nullable validation_custom_regex cannot be null'); } $this->container['validation_custom_regex'] = $validation_custom_regex; @@ -686,10 +673,10 @@ public function getValidationCustomRegexFormatLabel() * * @return self */ - public function setValidationCustomRegexFormatLabel($validation_custom_regex_format_label) + public function setValidationCustomRegexFormatLabel(?string $validation_custom_regex_format_label) { if (is_null($validation_custom_regex_format_label)) { - throw new \InvalidArgumentException('non-nullable validation_custom_regex_format_label cannot be null'); + throw new InvalidArgumentException('non-nullable validation_custom_regex_format_label cannot be null'); } $this->container['validation_custom_regex_format_label'] = $validation_custom_regex_format_label; @@ -713,10 +700,10 @@ public function getContent() * * @return self */ - public function setContent($content) + public function setContent(?string $content) { if (is_null($content)) { - throw new \InvalidArgumentException('non-nullable content cannot be null'); + throw new InvalidArgumentException('non-nullable content cannot be null'); } $this->container['content'] = $content; @@ -736,18 +723,18 @@ public function getFontFamily() /** * Sets font_family * - * @param string|null $font_family Font family for the field. + * @param string|null $font_family font family for the field * * @return self */ - public function setFontFamily($font_family) + public function setFontFamily(?string $font_family) { if (is_null($font_family)) { - throw new \InvalidArgumentException('non-nullable font_family cannot be null'); + throw new InvalidArgumentException('non-nullable font_family cannot be null'); } $allowedValues = $this->getFontFamilyAllowableValues(); if (!in_array($font_family, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'font_family', must be one of '%s'", $font_family, @@ -777,23 +764,22 @@ public function getFontSize() * * @return self */ - public function setFontSize($font_size) + public function setFontSize(?int $font_size) { if (is_null($font_size)) { - throw new \InvalidArgumentException('non-nullable font_size cannot be null'); + throw new InvalidArgumentException('non-nullable font_size cannot be null'); } $this->container['font_size'] = $font_size; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -802,11 +788,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -817,10 +803,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -833,11 +817,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -845,12 +827,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -879,5 +861,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentTextMerge.php b/sdks/php/src/Model/SubFormFieldsPerDocumentTextMerge.php index 36f5596fc..2f1fb28c4 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentTextMerge.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentTextMerge.php @@ -1,14 +1,11 @@ */ class SubFormFieldsPerDocumentTextMerge extends SubFormFieldsPerDocumentBase @@ -46,52 +44,52 @@ class SubFormFieldsPerDocumentTextMerge extends SubFormFieldsPerDocumentBase public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubFormFieldsPerDocumentTextMerge'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'font_family' => 'string', - 'font_size' => 'int' + 'font_size' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'font_family' => null, - 'font_size' => null + 'font_size' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, 'font_family' => false, - 'font_size' => false + 'font_size' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -116,8 +114,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -127,7 +123,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -137,7 +133,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -146,9 +142,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -157,9 +150,6 @@ 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 { @@ -175,7 +165,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'font_family' => 'font_family', - 'font_size' => 'font_size' + 'font_size' => 'font_size', ]; /** @@ -186,7 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'font_family' => 'setFontFamily', - 'font_size' => 'setFontSize' + 'font_size' => 'setFontSize', ]; /** @@ -197,7 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'font_family' => 'getFontFamily', - 'font_size' => 'getFontSize' + 'font_size' => 'getFontSize', ]; /** @@ -285,12 +275,11 @@ public function getFontFamilyAllowableValues() ]; } - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -301,34 +290,33 @@ public function __construct(?array $data = null) $this->setIfExists('font_size', $data ?? [], 12); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentTextMerge { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentTextMerge { /** @var SubFormFieldsPerDocumentTextMerge */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentTextMerge::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -373,7 +361,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -391,10 +378,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -414,18 +401,18 @@ public function getFontFamily() /** * Sets font_family * - * @param string|null $font_family Font family for the field. + * @param string|null $font_family font family for the field * * @return self */ - public function setFontFamily($font_family) + public function setFontFamily(?string $font_family) { if (is_null($font_family)) { - throw new \InvalidArgumentException('non-nullable font_family cannot be null'); + throw new InvalidArgumentException('non-nullable font_family cannot be null'); } $allowedValues = $this->getFontFamilyAllowableValues(); if (!in_array($font_family, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'font_family', must be one of '%s'", $font_family, @@ -455,23 +442,22 @@ public function getFontSize() * * @return self */ - public function setFontSize($font_size) + public function setFontSize(?int $font_size) { if (is_null($font_size)) { - throw new \InvalidArgumentException('non-nullable font_size cannot be null'); + throw new InvalidArgumentException('non-nullable font_size cannot be null'); } $this->container['font_size'] = $font_size; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -480,11 +466,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -495,10 +481,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -511,11 +495,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -523,12 +505,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -557,5 +539,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentTypeEnum.php b/sdks/php/src/Model/SubFormFieldsPerDocumentTypeEnum.php index fd4acd18b..47c4c1d45 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentTypeEnum.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentTypeEnum.php @@ -1,14 +1,11 @@ */ -class SubMergeField implements ModelInterface, ArrayAccess, \JsonSerializable +class SubMergeField implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubMergeField'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', - 'type' => 'string' + 'type' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, - 'type' => null + 'type' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'name' => false, - 'type' => false + 'type' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'name' => 'name', - 'type' => 'type' + 'type' => 'type', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'name' => 'setName', - 'type' => 'setType' + 'type' => 'setType', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'name' => 'getName', - 'type' => 'getType' + 'type' => 'getType', ]; /** @@ -263,7 +253,7 @@ public function getTypeAllowableValues() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -271,34 +261,33 @@ public function __construct(?array $data = null) $this->setIfExists('type', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubMergeField { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubMergeField { /** @var SubMergeField */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubMergeField::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -346,7 +335,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets name * @@ -364,10 +352,10 @@ public function getName() * * @return self */ - public function setName($name) + public function setName(string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -387,18 +375,18 @@ public function getType() /** * Sets type * - * @param string $type The type of merge field. + * @param string $type the type of merge field * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'type', must be one of '%s'", $type, @@ -410,14 +398,13 @@ public function setType($type) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -426,11 +413,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -441,10 +428,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -457,11 +442,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -469,12 +452,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -503,5 +486,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubOAuth.php b/sdks/php/src/Model/SubOAuth.php index 501ab9d64..39c24d80e 100644 --- a/sdks/php/src/Model/SubOAuth.php +++ b/sdks/php/src/Model/SubOAuth.php @@ -1,14 +1,11 @@ */ -class SubOAuth implements ModelInterface, ArrayAccess, \JsonSerializable +class SubOAuth implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubOAuth'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'callback_url' => 'string', - 'scopes' => 'string[]' + 'scopes' => 'string[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'callback_url' => null, - 'scopes' => null + 'scopes' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'callback_url' => false, - 'scopes' => false + 'scopes' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,8 +113,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -126,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -136,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -145,9 +141,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -156,9 +149,6 @@ 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 { @@ -173,7 +163,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'callback_url' => 'callback_url', - 'scopes' => 'scopes' + 'scopes' => 'scopes', ]; /** @@ -183,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'callback_url' => 'setCallbackUrl', - 'scopes' => 'setScopes' + 'scopes' => 'setScopes', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'callback_url' => 'getCallbackUrl', - 'scopes' => 'getScopes' + 'scopes' => 'getScopes', ]; /** @@ -276,7 +266,7 @@ public function getScopesAllowableValues() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -284,34 +274,33 @@ public function __construct(?array $data = null) $this->setIfExists('scopes', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubOAuth { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubOAuth { /** @var SubOAuth */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubOAuth::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -328,9 +317,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -344,7 +331,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets callback_url * @@ -362,10 +348,10 @@ public function getCallbackUrl() * * @return self */ - public function setCallbackUrl($callback_url) + public function setCallbackUrl(?string $callback_url) { if (is_null($callback_url)) { - throw new \InvalidArgumentException('non-nullable callback_url cannot be null'); + throw new InvalidArgumentException('non-nullable callback_url cannot be null'); } $this->container['callback_url'] = $callback_url; @@ -389,14 +375,14 @@ public function getScopes() * * @return self */ - public function setScopes($scopes) + public function setScopes(?array $scopes) { if (is_null($scopes)) { - throw new \InvalidArgumentException('non-nullable scopes cannot be null'); + throw new InvalidArgumentException('non-nullable scopes cannot be null'); } $allowedValues = $this->getScopesAllowableValues(); if (array_diff($scopes, $allowedValues)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value for 'scopes', must be one of '%s'", implode("', '", $allowedValues) @@ -407,14 +393,13 @@ public function setScopes($scopes) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -423,11 +408,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -438,10 +423,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -454,11 +437,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -466,12 +447,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -500,5 +481,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubOptions.php b/sdks/php/src/Model/SubOptions.php index 5609a909c..4493687d0 100644 --- a/sdks/php/src/Model/SubOptions.php +++ b/sdks/php/src/Model/SubOptions.php @@ -1,14 +1,11 @@ */ -class SubOptions implements ModelInterface, ArrayAccess, \JsonSerializable +class SubOptions implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubOptions'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'can_insert_everywhere' => 'bool' + 'can_insert_everywhere' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'can_insert_everywhere' => null + 'can_insert_everywhere' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'can_insert_everywhere' => false + 'can_insert_everywhere' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,8 +110,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -123,7 +119,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -133,7 +129,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -142,9 +138,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -153,9 +146,6 @@ 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 { @@ -169,7 +159,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'can_insert_everywhere' => 'can_insert_everywhere' + 'can_insert_everywhere' => 'can_insert_everywhere', ]; /** @@ -178,7 +168,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'can_insert_everywhere' => 'setCanInsertEverywhere' + 'can_insert_everywhere' => 'setCanInsertEverywhere', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'can_insert_everywhere' => 'getCanInsertEverywhere' + 'can_insert_everywhere' => 'getCanInsertEverywhere', ]; /** @@ -231,7 +221,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -243,41 +232,40 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { $this->setIfExists('can_insert_everywhere', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubOptions { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubOptions { /** @var SubOptions */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubOptions::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,9 +282,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -310,7 +296,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets can_insert_everywhere * @@ -324,27 +309,26 @@ public function getCanInsertEverywhere() /** * Sets can_insert_everywhere * - * @param bool|null $can_insert_everywhere Determines if signers can use \"Insert Everywhere\" when signing a document. + * @param bool|null $can_insert_everywhere determines if signers can use \"Insert Everywhere\" when signing a document * * @return self */ - public function setCanInsertEverywhere($can_insert_everywhere) + public function setCanInsertEverywhere(?bool $can_insert_everywhere) { if (is_null($can_insert_everywhere)) { - throw new \InvalidArgumentException('non-nullable can_insert_everywhere cannot be null'); + throw new InvalidArgumentException('non-nullable can_insert_everywhere cannot be null'); } $this->container['can_insert_everywhere'] = $can_insert_everywhere; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -353,11 +337,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -368,10 +352,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -384,11 +366,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -396,12 +376,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -430,5 +410,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubSignatureRequestGroupedSigners.php b/sdks/php/src/Model/SubSignatureRequestGroupedSigners.php index f9a095986..5405a1142 100644 --- a/sdks/php/src/Model/SubSignatureRequestGroupedSigners.php +++ b/sdks/php/src/Model/SubSignatureRequestGroupedSigners.php @@ -1,14 +1,11 @@ */ -class SubSignatureRequestGroupedSigners implements ModelInterface, ArrayAccess, \JsonSerializable +class SubSignatureRequestGroupedSigners implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubSignatureRequestGroupedSigners'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'group' => 'string', 'signers' => '\Dropbox\Sign\Model\SubSignatureRequestSigner[]', - 'order' => 'int' + 'order' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'group' => null, 'signers' => null, - 'order' => null + 'order' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'group' => false, 'signers' => false, - 'order' => true + 'order' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'group' => 'group', 'signers' => 'signers', - 'order' => 'order' + 'order' => 'order', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'group' => 'setGroup', 'signers' => 'setSigners', - 'order' => 'setOrder' + 'order' => 'setOrder', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'group' => 'getGroup', 'signers' => 'getSigners', - 'order' => 'getOrder' + 'order' => 'getOrder', ]; /** @@ -242,7 +232,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -254,7 +243,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -263,34 +252,33 @@ public function __construct(?array $data = null) $this->setIfExists('order', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubSignatureRequestGroupedSigners { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubSignatureRequestGroupedSigners { /** @var SubSignatureRequestGroupedSigners */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubSignatureRequestGroupedSigners::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -329,7 +317,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets group * @@ -343,14 +330,14 @@ public function getGroup() /** * Sets group * - * @param string $group The name of the group. + * @param string $group the name of the group * * @return self */ - public function setGroup($group) + public function setGroup(string $group) { if (is_null($group)) { - throw new \InvalidArgumentException('non-nullable group cannot be null'); + throw new InvalidArgumentException('non-nullable group cannot be null'); } $this->container['group'] = $group; @@ -374,10 +361,10 @@ public function getSigners() * * @return self */ - public function setSigners($signers) + public function setSigners(array $signers) { if (is_null($signers)) { - throw new \InvalidArgumentException('non-nullable signers cannot be null'); + throw new InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -401,13 +388,13 @@ public function getOrder() * * @return self */ - public function setOrder($order) + public function setOrder(?int $order) { if (is_null($order)) { array_push($this->openAPINullablesSetToNull, 'order'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('order', $nullablesSetToNull, true); + $index = array_search('order', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -417,14 +404,13 @@ public function setOrder($order) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -433,11 +419,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -448,10 +434,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -464,11 +448,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -476,12 +458,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -510,5 +492,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubSignatureRequestSigner.php b/sdks/php/src/Model/SubSignatureRequestSigner.php index 985b88d91..23043b15a 100644 --- a/sdks/php/src/Model/SubSignatureRequestSigner.php +++ b/sdks/php/src/Model/SubSignatureRequestSigner.php @@ -1,14 +1,11 @@ */ -class SubSignatureRequestSigner implements ModelInterface, ArrayAccess, \JsonSerializable +class SubSignatureRequestSigner implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubSignatureRequestSigner'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', 'email_address' => 'string', 'order' => 'int', 'pin' => 'string', 'sms_phone_number' => 'string', - 'sms_phone_number_type' => 'string' + 'sms_phone_number_type' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, 'email_address' => 'email', 'order' => null, 'pin' => null, 'sms_phone_number' => null, - 'sms_phone_number_type' => null + 'sms_phone_number_type' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'name' => false, 'email_address' => false, 'order' => true, 'pin' => false, 'sms_phone_number' => false, - 'sms_phone_number_type' => false + 'sms_phone_number_type' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -126,8 +124,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -137,7 +133,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -147,7 +143,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -156,9 +152,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -167,9 +160,6 @@ 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 { @@ -188,7 +178,7 @@ public function isNullableSetToNull(string $property): bool 'order' => 'order', 'pin' => 'pin', 'sms_phone_number' => 'sms_phone_number', - 'sms_phone_number_type' => 'sms_phone_number_type' + 'sms_phone_number_type' => 'sms_phone_number_type', ]; /** @@ -202,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'order' => 'setOrder', 'pin' => 'setPin', 'sms_phone_number' => 'setSmsPhoneNumber', - 'sms_phone_number_type' => 'setSmsPhoneNumberType' + 'sms_phone_number_type' => 'setSmsPhoneNumberType', ]; /** @@ -216,7 +206,7 @@ public function isNullableSetToNull(string $property): bool 'order' => 'getOrder', 'pin' => 'getPin', 'sms_phone_number' => 'getSmsPhoneNumber', - 'sms_phone_number_type' => 'getSmsPhoneNumberType' + 'sms_phone_number_type' => 'getSmsPhoneNumberType', ]; /** @@ -287,7 +277,7 @@ public function getSmsPhoneNumberTypeAllowableValues() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -299,34 +289,33 @@ public function __construct(?array $data = null) $this->setIfExists('sms_phone_number_type', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubSignatureRequestSigner { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubSignatureRequestSigner { /** @var SubSignatureRequestSigner */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubSignatureRequestSigner::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -382,7 +371,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets name * @@ -396,14 +384,14 @@ public function getName() /** * Sets name * - * @param string $name The name of the signer. + * @param string $name the name of the signer * * @return self */ - public function setName($name) + public function setName(string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -423,14 +411,14 @@ public function getEmailAddress() /** * Sets email_address * - * @param string $email_address The email address of the signer. + * @param string $email_address the email address of the signer * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -450,17 +438,17 @@ public function getOrder() /** * Sets order * - * @param int|null $order The order the signer is required to sign in. + * @param int|null $order the order the signer is required to sign in * * @return self */ - public function setOrder($order) + public function setOrder(?int $order) { if (is_null($order)) { array_push($this->openAPINullablesSetToNull, 'order'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('order', $nullablesSetToNull, true); + $index = array_search('order', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -484,20 +472,20 @@ public function getPin() /** * Sets pin * - * @param string|null $pin The 4- to 12-character access code that will secure this signer's signature page. + * @param string|null $pin the 4- to 12-character access code that will secure this signer's signature page * * @return self */ - public function setPin($pin) + public function setPin(?string $pin) { if (is_null($pin)) { - throw new \InvalidArgumentException('non-nullable pin cannot be null'); + throw new InvalidArgumentException('non-nullable pin cannot be null'); } - if ((mb_strlen($pin) > 12)) { - throw new \InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestSigner., must be smaller than or equal to 12.'); + if (mb_strlen($pin) > 12) { + throw new InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestSigner., must be smaller than or equal to 12.'); } - if ((mb_strlen($pin) < 4)) { - throw new \InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestSigner., must be bigger than or equal to 4.'); + if (mb_strlen($pin) < 4) { + throw new InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestSigner., must be bigger than or equal to 4.'); } $this->container['pin'] = $pin; @@ -522,10 +510,10 @@ public function getSmsPhoneNumber() * * @return self */ - public function setSmsPhoneNumber($sms_phone_number) + public function setSmsPhoneNumber(?string $sms_phone_number) { if (is_null($sms_phone_number)) { - throw new \InvalidArgumentException('non-nullable sms_phone_number cannot be null'); + throw new InvalidArgumentException('non-nullable sms_phone_number cannot be null'); } $this->container['sms_phone_number'] = $sms_phone_number; @@ -549,14 +537,14 @@ public function getSmsPhoneNumberType() * * @return self */ - public function setSmsPhoneNumberType($sms_phone_number_type) + public function setSmsPhoneNumberType(?string $sms_phone_number_type) { if (is_null($sms_phone_number_type)) { - throw new \InvalidArgumentException('non-nullable sms_phone_number_type cannot be null'); + throw new InvalidArgumentException('non-nullable sms_phone_number_type cannot be null'); } $allowedValues = $this->getSmsPhoneNumberTypeAllowableValues(); if (!in_array($sms_phone_number_type, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'sms_phone_number_type', must be one of '%s'", $sms_phone_number_type, @@ -568,14 +556,13 @@ public function setSmsPhoneNumberType($sms_phone_number_type) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -584,11 +571,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -599,10 +586,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -615,11 +600,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -627,12 +610,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -661,5 +644,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubSignatureRequestTemplateSigner.php b/sdks/php/src/Model/SubSignatureRequestTemplateSigner.php index e97b478b1..caf7d9078 100644 --- a/sdks/php/src/Model/SubSignatureRequestTemplateSigner.php +++ b/sdks/php/src/Model/SubSignatureRequestTemplateSigner.php @@ -1,14 +1,11 @@ */ -class SubSignatureRequestTemplateSigner implements ModelInterface, ArrayAccess, \JsonSerializable +class SubSignatureRequestTemplateSigner implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubSignatureRequestTemplateSigner'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'role' => 'string', 'name' => 'string', 'email_address' => 'string', 'pin' => 'string', 'sms_phone_number' => 'string', - 'sms_phone_number_type' => 'string' + 'sms_phone_number_type' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'role' => null, 'name' => null, 'email_address' => 'email', 'pin' => null, 'sms_phone_number' => null, - 'sms_phone_number_type' => null + 'sms_phone_number_type' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'role' => false, 'name' => false, 'email_address' => false, 'pin' => false, 'sms_phone_number' => false, - 'sms_phone_number_type' => false + 'sms_phone_number_type' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -126,8 +124,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -137,7 +133,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -147,7 +143,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -156,9 +152,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -167,9 +160,6 @@ 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 { @@ -188,7 +178,7 @@ public function isNullableSetToNull(string $property): bool 'email_address' => 'email_address', 'pin' => 'pin', 'sms_phone_number' => 'sms_phone_number', - 'sms_phone_number_type' => 'sms_phone_number_type' + 'sms_phone_number_type' => 'sms_phone_number_type', ]; /** @@ -202,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'email_address' => 'setEmailAddress', 'pin' => 'setPin', 'sms_phone_number' => 'setSmsPhoneNumber', - 'sms_phone_number_type' => 'setSmsPhoneNumberType' + 'sms_phone_number_type' => 'setSmsPhoneNumberType', ]; /** @@ -216,7 +206,7 @@ public function isNullableSetToNull(string $property): bool 'email_address' => 'getEmailAddress', 'pin' => 'getPin', 'sms_phone_number' => 'getSmsPhoneNumber', - 'sms_phone_number_type' => 'getSmsPhoneNumberType' + 'sms_phone_number_type' => 'getSmsPhoneNumberType', ]; /** @@ -287,7 +277,7 @@ public function getSmsPhoneNumberTypeAllowableValues() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -299,34 +289,33 @@ public function __construct(?array $data = null) $this->setIfExists('sms_phone_number_type', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubSignatureRequestTemplateSigner { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubSignatureRequestTemplateSigner { /** @var SubSignatureRequestTemplateSigner */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubSignatureRequestTemplateSigner::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -385,7 +374,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets role * @@ -403,10 +391,10 @@ public function getRole() * * @return self */ - public function setRole($role) + public function setRole(string $role) { if (is_null($role)) { - throw new \InvalidArgumentException('non-nullable role cannot be null'); + throw new InvalidArgumentException('non-nullable role cannot be null'); } $this->container['role'] = $role; @@ -426,14 +414,14 @@ public function getName() /** * Sets name * - * @param string $name The name of the signer. + * @param string $name the name of the signer * * @return self */ - public function setName($name) + public function setName(string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -453,14 +441,14 @@ public function getEmailAddress() /** * Sets email_address * - * @param string $email_address The email address of the signer. + * @param string $email_address the email address of the signer * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -480,20 +468,20 @@ public function getPin() /** * Sets pin * - * @param string|null $pin The 4- to 12-character access code that will secure this signer's signature page. + * @param string|null $pin the 4- to 12-character access code that will secure this signer's signature page * * @return self */ - public function setPin($pin) + public function setPin(?string $pin) { if (is_null($pin)) { - throw new \InvalidArgumentException('non-nullable pin cannot be null'); + throw new InvalidArgumentException('non-nullable pin cannot be null'); } - if ((mb_strlen($pin) > 12)) { - throw new \InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestTemplateSigner., must be smaller than or equal to 12.'); + if (mb_strlen($pin) > 12) { + throw new InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestTemplateSigner., must be smaller than or equal to 12.'); } - if ((mb_strlen($pin) < 4)) { - throw new \InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestTemplateSigner., must be bigger than or equal to 4.'); + if (mb_strlen($pin) < 4) { + throw new InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestTemplateSigner., must be bigger than or equal to 4.'); } $this->container['pin'] = $pin; @@ -518,10 +506,10 @@ public function getSmsPhoneNumber() * * @return self */ - public function setSmsPhoneNumber($sms_phone_number) + public function setSmsPhoneNumber(?string $sms_phone_number) { if (is_null($sms_phone_number)) { - throw new \InvalidArgumentException('non-nullable sms_phone_number cannot be null'); + throw new InvalidArgumentException('non-nullable sms_phone_number cannot be null'); } $this->container['sms_phone_number'] = $sms_phone_number; @@ -545,14 +533,14 @@ public function getSmsPhoneNumberType() * * @return self */ - public function setSmsPhoneNumberType($sms_phone_number_type) + public function setSmsPhoneNumberType(?string $sms_phone_number_type) { if (is_null($sms_phone_number_type)) { - throw new \InvalidArgumentException('non-nullable sms_phone_number_type cannot be null'); + throw new InvalidArgumentException('non-nullable sms_phone_number_type cannot be null'); } $allowedValues = $this->getSmsPhoneNumberTypeAllowableValues(); if (!in_array($sms_phone_number_type, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'sms_phone_number_type', must be one of '%s'", $sms_phone_number_type, @@ -564,14 +552,13 @@ public function setSmsPhoneNumberType($sms_phone_number_type) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -580,11 +567,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -595,10 +582,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -611,11 +596,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -623,12 +606,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -657,5 +640,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubSigningOptions.php b/sdks/php/src/Model/SubSigningOptions.php index 9eeba9e34..bdb9f4ecf 100644 --- a/sdks/php/src/Model/SubSigningOptions.php +++ b/sdks/php/src/Model/SubSigningOptions.php @@ -1,14 +1,11 @@ */ -class SubSigningOptions implements ModelInterface, ArrayAccess, \JsonSerializable +class SubSigningOptions implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubSigningOptions'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'default_type' => 'string', 'draw' => 'bool', 'phone' => 'bool', 'type' => 'bool', - 'upload' => 'bool' + 'upload' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'default_type' => null, 'draw' => null, 'phone' => null, 'type' => null, - 'upload' => null + 'upload' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'default_type' => false, 'draw' => false, 'phone' => false, 'type' => false, - 'upload' => false + 'upload' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -124,8 +122,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -135,7 +131,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -145,7 +141,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -154,9 +150,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -165,9 +158,6 @@ 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 { @@ -185,7 +175,7 @@ public function isNullableSetToNull(string $property): bool 'draw' => 'draw', 'phone' => 'phone', 'type' => 'type', - 'upload' => 'upload' + 'upload' => 'upload', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool 'draw' => 'setDraw', 'phone' => 'setPhone', 'type' => 'setType', - 'upload' => 'setUpload' + 'upload' => 'setUpload', ]; /** @@ -211,7 +201,7 @@ public function isNullableSetToNull(string $property): bool 'draw' => 'getDraw', 'phone' => 'getPhone', 'type' => 'getType', - 'upload' => 'getUpload' + 'upload' => 'getUpload', ]; /** @@ -286,7 +276,7 @@ public function getDefaultTypeAllowableValues() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -297,34 +287,33 @@ public function __construct(?array $data = null) $this->setIfExists('upload', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubSigningOptions { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubSigningOptions { /** @var SubSigningOptions */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubSigningOptions::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -369,7 +358,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets default_type * @@ -387,14 +375,14 @@ public function getDefaultType() * * @return self */ - public function setDefaultType($default_type) + public function setDefaultType(string $default_type) { if (is_null($default_type)) { - throw new \InvalidArgumentException('non-nullable default_type cannot be null'); + throw new InvalidArgumentException('non-nullable default_type cannot be null'); } $allowedValues = $this->getDefaultTypeAllowableValues(); if (!in_array($default_type, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'default_type', must be one of '%s'", $default_type, @@ -424,10 +412,10 @@ public function getDraw() * * @return self */ - public function setDraw($draw) + public function setDraw(?bool $draw) { if (is_null($draw)) { - throw new \InvalidArgumentException('non-nullable draw cannot be null'); + throw new InvalidArgumentException('non-nullable draw cannot be null'); } $this->container['draw'] = $draw; @@ -451,10 +439,10 @@ public function getPhone() * * @return self */ - public function setPhone($phone) + public function setPhone(?bool $phone) { if (is_null($phone)) { - throw new \InvalidArgumentException('non-nullable phone cannot be null'); + throw new InvalidArgumentException('non-nullable phone cannot be null'); } $this->container['phone'] = $phone; @@ -478,10 +466,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(?bool $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -505,23 +493,22 @@ public function getUpload() * * @return self */ - public function setUpload($upload) + public function setUpload(?bool $upload) { if (is_null($upload)) { - throw new \InvalidArgumentException('non-nullable upload cannot be null'); + throw new InvalidArgumentException('non-nullable upload cannot be null'); } $this->container['upload'] = $upload; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -530,11 +517,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -545,10 +532,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -561,11 +546,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -573,12 +556,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -607,5 +590,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubTeamResponse.php b/sdks/php/src/Model/SubTeamResponse.php index 2e1497011..def81afc0 100644 --- a/sdks/php/src/Model/SubTeamResponse.php +++ b/sdks/php/src/Model/SubTeamResponse.php @@ -1,14 +1,11 @@ */ -class SubTeamResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class SubTeamResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubTeamResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'team_id' => 'string', - 'name' => 'string' + 'name' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'team_id' => null, - 'name' => null + 'name' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'team_id' => false, - 'name' => false + 'name' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'team_id' => 'team_id', - 'name' => 'name' + 'name' => 'name', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'team_id' => 'setTeamId', - 'name' => 'setName' + 'name' => 'setName', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'team_id' => 'getTeamId', - 'name' => 'getName' + 'name' => 'getName', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('name', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubTeamResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubTeamResponse { /** @var SubTeamResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubTeamResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -300,9 +288,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -316,7 +302,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets team_id * @@ -334,10 +319,10 @@ public function getTeamId() * * @return self */ - public function setTeamId($team_id) + public function setTeamId(?string $team_id) { if (is_null($team_id)) { - throw new \InvalidArgumentException('non-nullable team_id cannot be null'); + throw new InvalidArgumentException('non-nullable team_id cannot be null'); } $this->container['team_id'] = $team_id; @@ -361,23 +346,22 @@ public function getName() * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -386,11 +370,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -401,10 +385,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -417,11 +399,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -429,12 +409,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -463,5 +443,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubTemplateRole.php b/sdks/php/src/Model/SubTemplateRole.php index 44e4cb4f7..489a376a5 100644 --- a/sdks/php/src/Model/SubTemplateRole.php +++ b/sdks/php/src/Model/SubTemplateRole.php @@ -1,14 +1,11 @@ */ -class SubTemplateRole implements ModelInterface, ArrayAccess, \JsonSerializable +class SubTemplateRole implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubTemplateRole'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', - 'order' => 'int' + 'order' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, - 'order' => null + 'order' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'name' => false, - 'order' => true + 'order' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'name' => 'name', - 'order' => 'order' + 'order' => 'order', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'name' => 'setName', - 'order' => 'setOrder' + 'order' => 'setOrder', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'name' => 'getName', - 'order' => 'getOrder' + 'order' => 'getOrder', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('order', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubTemplateRole { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubTemplateRole { /** @var SubTemplateRole */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubTemplateRole::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -300,9 +288,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -316,7 +302,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets name * @@ -330,14 +315,14 @@ public function getName() /** * Sets name * - * @param string|null $name The role name of the signer that will be displayed when the template is used to create a signature request. + * @param string|null $name the role name of the signer that will be displayed when the template is used to create a signature request * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -357,17 +342,17 @@ public function getOrder() /** * Sets order * - * @param int|null $order The order in which this signer role is required to sign. + * @param int|null $order the order in which this signer role is required to sign * * @return self */ - public function setOrder($order) + public function setOrder(?int $order) { if (is_null($order)) { array_push($this->openAPINullablesSetToNull, 'order'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('order', $nullablesSetToNull, true); + $index = array_search('order', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -377,14 +362,13 @@ public function setOrder($order) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -393,11 +377,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -408,10 +392,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -424,11 +406,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -436,12 +416,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -470,5 +450,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubUnclaimedDraftSigner.php b/sdks/php/src/Model/SubUnclaimedDraftSigner.php index 891554432..4d9b3ec8f 100644 --- a/sdks/php/src/Model/SubUnclaimedDraftSigner.php +++ b/sdks/php/src/Model/SubUnclaimedDraftSigner.php @@ -1,14 +1,11 @@ */ -class SubUnclaimedDraftSigner implements ModelInterface, ArrayAccess, \JsonSerializable +class SubUnclaimedDraftSigner implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubUnclaimedDraftSigner'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'email_address' => 'string', 'name' => 'string', - 'order' => 'int' + 'order' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'email_address' => 'email', 'name' => null, - 'order' => null + 'order' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'email_address' => false, 'name' => false, - 'order' => true + 'order' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'email_address' => 'email_address', 'name' => 'name', - 'order' => 'order' + 'order' => 'order', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'email_address' => 'setEmailAddress', 'name' => 'setName', - 'order' => 'setOrder' + 'order' => 'setOrder', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'email_address' => 'getEmailAddress', 'name' => 'getName', - 'order' => 'getOrder' + 'order' => 'getOrder', ]; /** @@ -242,7 +232,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -254,7 +243,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -263,34 +252,33 @@ public function __construct(?array $data = null) $this->setIfExists('order', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubUnclaimedDraftSigner { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubUnclaimedDraftSigner { /** @var SubUnclaimedDraftSigner */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubUnclaimedDraftSigner::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -329,7 +317,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets email_address * @@ -343,14 +330,14 @@ public function getEmailAddress() /** * Sets email_address * - * @param string $email_address The email address of the signer. + * @param string $email_address the email address of the signer * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -370,14 +357,14 @@ public function getName() /** * Sets name * - * @param string $name The name of the signer. + * @param string $name the name of the signer * * @return self */ - public function setName($name) + public function setName(string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -397,17 +384,17 @@ public function getOrder() /** * Sets order * - * @param int|null $order The order the signer is required to sign in. + * @param int|null $order the order the signer is required to sign in * * @return self */ - public function setOrder($order) + public function setOrder(?int $order) { if (is_null($order)) { array_push($this->openAPINullablesSetToNull, 'order'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('order', $nullablesSetToNull, true); + $index = array_search('order', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -417,14 +404,13 @@ public function setOrder($order) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -433,11 +419,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -448,10 +434,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -464,11 +448,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -476,12 +458,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -510,5 +492,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubUnclaimedDraftTemplateSigner.php b/sdks/php/src/Model/SubUnclaimedDraftTemplateSigner.php index 094f43b3d..52544c118 100644 --- a/sdks/php/src/Model/SubUnclaimedDraftTemplateSigner.php +++ b/sdks/php/src/Model/SubUnclaimedDraftTemplateSigner.php @@ -1,14 +1,11 @@ */ -class SubUnclaimedDraftTemplateSigner implements ModelInterface, ArrayAccess, \JsonSerializable +class SubUnclaimedDraftTemplateSigner implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubUnclaimedDraftTemplateSigner'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'role' => 'string', 'name' => 'string', - 'email_address' => 'string' + 'email_address' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'role' => null, 'name' => null, - 'email_address' => 'email' + 'email_address' => 'email', ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'role' => false, 'name' => false, - 'email_address' => false + 'email_address' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'role' => 'role', 'name' => 'name', - 'email_address' => 'email_address' + 'email_address' => 'email_address', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'role' => 'setRole', 'name' => 'setName', - 'email_address' => 'setEmailAddress' + 'email_address' => 'setEmailAddress', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'role' => 'getRole', 'name' => 'getName', - 'email_address' => 'getEmailAddress' + 'email_address' => 'getEmailAddress', ]; /** @@ -242,7 +232,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -254,7 +243,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -263,34 +252,33 @@ public function __construct(?array $data = null) $this->setIfExists('email_address', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubUnclaimedDraftTemplateSigner { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubUnclaimedDraftTemplateSigner { /** @var SubUnclaimedDraftTemplateSigner */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubUnclaimedDraftTemplateSigner::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -332,7 +320,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets role * @@ -346,14 +333,14 @@ public function getRole() /** * Sets role * - * @param string $role Must match an existing role in chosen Template(s). + * @param string $role must match an existing role in chosen Template(s) * * @return self */ - public function setRole($role) + public function setRole(string $role) { if (is_null($role)) { - throw new \InvalidArgumentException('non-nullable role cannot be null'); + throw new InvalidArgumentException('non-nullable role cannot be null'); } $this->container['role'] = $role; @@ -373,14 +360,14 @@ public function getName() /** * Sets name * - * @param string $name The name of the signer filling the role of `role`. + * @param string $name the name of the signer filling the role of `role` * * @return self */ - public function setName($name) + public function setName(string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -400,27 +387,26 @@ public function getEmailAddress() /** * Sets email_address * - * @param string $email_address The email address of the signer filling the role of `role`. + * @param string $email_address the email address of the signer filling the role of `role` * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -429,11 +415,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -444,10 +430,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -460,11 +444,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -472,12 +454,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -506,5 +488,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/SubWhiteLabelingOptions.php b/sdks/php/src/Model/SubWhiteLabelingOptions.php index 5f1d304a0..5eafd34ad 100644 --- a/sdks/php/src/Model/SubWhiteLabelingOptions.php +++ b/sdks/php/src/Model/SubWhiteLabelingOptions.php @@ -1,14 +1,11 @@ */ -class SubWhiteLabelingOptions implements ModelInterface, ArrayAccess, \JsonSerializable +class SubWhiteLabelingOptions implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubWhiteLabelingOptions'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'header_background_color' => 'string', 'legal_version' => 'string', @@ -74,16 +72,16 @@ class SubWhiteLabelingOptions implements ModelInterface, ArrayAccess, \JsonSeria 'secondary_button_text_color_hover' => 'string', 'text_color1' => 'string', 'text_color2' => 'string', - 'reset_to_default' => 'bool' + 'reset_to_default' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'header_background_color' => null, 'legal_version' => null, @@ -99,14 +97,14 @@ class SubWhiteLabelingOptions implements ModelInterface, ArrayAccess, \JsonSeria 'secondary_button_text_color_hover' => null, 'text_color1' => null, 'text_color2' => null, - 'reset_to_default' => null + 'reset_to_default' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'header_background_color' => false, 'legal_version' => false, @@ -122,14 +120,14 @@ class SubWhiteLabelingOptions implements ModelInterface, ArrayAccess, \JsonSeria 'secondary_button_text_color_hover' => false, 'text_color1' => false, 'text_color2' => false, - 'reset_to_default' => false + 'reset_to_default' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -154,8 +152,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -165,7 +161,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -175,7 +171,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -184,9 +180,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -195,9 +188,6 @@ 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 { @@ -225,7 +215,7 @@ public function isNullableSetToNull(string $property): bool 'secondary_button_text_color_hover' => 'secondary_button_text_color_hover', 'text_color1' => 'text_color1', 'text_color2' => 'text_color2', - 'reset_to_default' => 'reset_to_default' + 'reset_to_default' => 'reset_to_default', ]; /** @@ -248,7 +238,7 @@ public function isNullableSetToNull(string $property): bool 'secondary_button_text_color_hover' => 'setSecondaryButtonTextColorHover', 'text_color1' => 'setTextColor1', 'text_color2' => 'setTextColor2', - 'reset_to_default' => 'setResetToDefault' + 'reset_to_default' => 'setResetToDefault', ]; /** @@ -271,7 +261,7 @@ public function isNullableSetToNull(string $property): bool 'secondary_button_text_color_hover' => 'getSecondaryButtonTextColorHover', 'text_color1' => 'getTextColor1', 'text_color2' => 'getTextColor2', - 'reset_to_default' => 'getResetToDefault' + 'reset_to_default' => 'getResetToDefault', ]; /** @@ -342,7 +332,7 @@ public function getLegalVersionAllowableValues() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -363,34 +353,33 @@ public function __construct(?array $data = null) $this->setIfExists('reset_to_default', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubWhiteLabelingOptions { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubWhiteLabelingOptions { /** @var SubWhiteLabelingOptions */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, SubWhiteLabelingOptions::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -432,7 +421,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets header_background_color * @@ -450,10 +438,10 @@ public function getHeaderBackgroundColor() * * @return self */ - public function setHeaderBackgroundColor($header_background_color) + public function setHeaderBackgroundColor(?string $header_background_color) { if (is_null($header_background_color)) { - throw new \InvalidArgumentException('non-nullable header_background_color cannot be null'); + throw new InvalidArgumentException('non-nullable header_background_color cannot be null'); } $this->container['header_background_color'] = $header_background_color; @@ -477,14 +465,14 @@ public function getLegalVersion() * * @return self */ - public function setLegalVersion($legal_version) + public function setLegalVersion(?string $legal_version) { if (is_null($legal_version)) { - throw new \InvalidArgumentException('non-nullable legal_version cannot be null'); + throw new InvalidArgumentException('non-nullable legal_version cannot be null'); } $allowedValues = $this->getLegalVersionAllowableValues(); if (!in_array($legal_version, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'legal_version', must be one of '%s'", $legal_version, @@ -514,10 +502,10 @@ public function getLinkColor() * * @return self */ - public function setLinkColor($link_color) + public function setLinkColor(?string $link_color) { if (is_null($link_color)) { - throw new \InvalidArgumentException('non-nullable link_color cannot be null'); + throw new InvalidArgumentException('non-nullable link_color cannot be null'); } $this->container['link_color'] = $link_color; @@ -541,10 +529,10 @@ public function getPageBackgroundColor() * * @return self */ - public function setPageBackgroundColor($page_background_color) + public function setPageBackgroundColor(?string $page_background_color) { if (is_null($page_background_color)) { - throw new \InvalidArgumentException('non-nullable page_background_color cannot be null'); + throw new InvalidArgumentException('non-nullable page_background_color cannot be null'); } $this->container['page_background_color'] = $page_background_color; @@ -568,10 +556,10 @@ public function getPrimaryButtonColor() * * @return self */ - public function setPrimaryButtonColor($primary_button_color) + public function setPrimaryButtonColor(?string $primary_button_color) { if (is_null($primary_button_color)) { - throw new \InvalidArgumentException('non-nullable primary_button_color cannot be null'); + throw new InvalidArgumentException('non-nullable primary_button_color cannot be null'); } $this->container['primary_button_color'] = $primary_button_color; @@ -595,10 +583,10 @@ public function getPrimaryButtonColorHover() * * @return self */ - public function setPrimaryButtonColorHover($primary_button_color_hover) + public function setPrimaryButtonColorHover(?string $primary_button_color_hover) { if (is_null($primary_button_color_hover)) { - throw new \InvalidArgumentException('non-nullable primary_button_color_hover cannot be null'); + throw new InvalidArgumentException('non-nullable primary_button_color_hover cannot be null'); } $this->container['primary_button_color_hover'] = $primary_button_color_hover; @@ -622,10 +610,10 @@ public function getPrimaryButtonTextColor() * * @return self */ - public function setPrimaryButtonTextColor($primary_button_text_color) + public function setPrimaryButtonTextColor(?string $primary_button_text_color) { if (is_null($primary_button_text_color)) { - throw new \InvalidArgumentException('non-nullable primary_button_text_color cannot be null'); + throw new InvalidArgumentException('non-nullable primary_button_text_color cannot be null'); } $this->container['primary_button_text_color'] = $primary_button_text_color; @@ -649,10 +637,10 @@ public function getPrimaryButtonTextColorHover() * * @return self */ - public function setPrimaryButtonTextColorHover($primary_button_text_color_hover) + public function setPrimaryButtonTextColorHover(?string $primary_button_text_color_hover) { if (is_null($primary_button_text_color_hover)) { - throw new \InvalidArgumentException('non-nullable primary_button_text_color_hover cannot be null'); + throw new InvalidArgumentException('non-nullable primary_button_text_color_hover cannot be null'); } $this->container['primary_button_text_color_hover'] = $primary_button_text_color_hover; @@ -676,10 +664,10 @@ public function getSecondaryButtonColor() * * @return self */ - public function setSecondaryButtonColor($secondary_button_color) + public function setSecondaryButtonColor(?string $secondary_button_color) { if (is_null($secondary_button_color)) { - throw new \InvalidArgumentException('non-nullable secondary_button_color cannot be null'); + throw new InvalidArgumentException('non-nullable secondary_button_color cannot be null'); } $this->container['secondary_button_color'] = $secondary_button_color; @@ -703,10 +691,10 @@ public function getSecondaryButtonColorHover() * * @return self */ - public function setSecondaryButtonColorHover($secondary_button_color_hover) + public function setSecondaryButtonColorHover(?string $secondary_button_color_hover) { if (is_null($secondary_button_color_hover)) { - throw new \InvalidArgumentException('non-nullable secondary_button_color_hover cannot be null'); + throw new InvalidArgumentException('non-nullable secondary_button_color_hover cannot be null'); } $this->container['secondary_button_color_hover'] = $secondary_button_color_hover; @@ -730,10 +718,10 @@ public function getSecondaryButtonTextColor() * * @return self */ - public function setSecondaryButtonTextColor($secondary_button_text_color) + public function setSecondaryButtonTextColor(?string $secondary_button_text_color) { if (is_null($secondary_button_text_color)) { - throw new \InvalidArgumentException('non-nullable secondary_button_text_color cannot be null'); + throw new InvalidArgumentException('non-nullable secondary_button_text_color cannot be null'); } $this->container['secondary_button_text_color'] = $secondary_button_text_color; @@ -757,10 +745,10 @@ public function getSecondaryButtonTextColorHover() * * @return self */ - public function setSecondaryButtonTextColorHover($secondary_button_text_color_hover) + public function setSecondaryButtonTextColorHover(?string $secondary_button_text_color_hover) { if (is_null($secondary_button_text_color_hover)) { - throw new \InvalidArgumentException('non-nullable secondary_button_text_color_hover cannot be null'); + throw new InvalidArgumentException('non-nullable secondary_button_text_color_hover cannot be null'); } $this->container['secondary_button_text_color_hover'] = $secondary_button_text_color_hover; @@ -784,10 +772,10 @@ public function getTextColor1() * * @return self */ - public function setTextColor1($text_color1) + public function setTextColor1(?string $text_color1) { if (is_null($text_color1)) { - throw new \InvalidArgumentException('non-nullable text_color1 cannot be null'); + throw new InvalidArgumentException('non-nullable text_color1 cannot be null'); } $this->container['text_color1'] = $text_color1; @@ -811,10 +799,10 @@ public function getTextColor2() * * @return self */ - public function setTextColor2($text_color2) + public function setTextColor2(?string $text_color2) { if (is_null($text_color2)) { - throw new \InvalidArgumentException('non-nullable text_color2 cannot be null'); + throw new InvalidArgumentException('non-nullable text_color2 cannot be null'); } $this->container['text_color2'] = $text_color2; @@ -838,23 +826,22 @@ public function getResetToDefault() * * @return self */ - public function setResetToDefault($reset_to_default) + public function setResetToDefault(?bool $reset_to_default) { if (is_null($reset_to_default)) { - throw new \InvalidArgumentException('non-nullable reset_to_default cannot be null'); + throw new InvalidArgumentException('non-nullable reset_to_default cannot be null'); } $this->container['reset_to_default'] = $reset_to_default; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -863,11 +850,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -878,10 +865,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -894,11 +879,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -906,12 +889,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -940,5 +923,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TeamAddMemberRequest.php b/sdks/php/src/Model/TeamAddMemberRequest.php index a584db5f0..c1fbe01a8 100644 --- a/sdks/php/src/Model/TeamAddMemberRequest.php +++ b/sdks/php/src/Model/TeamAddMemberRequest.php @@ -1,14 +1,11 @@ */ -class TeamAddMemberRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class TeamAddMemberRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamAddMemberRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account_id' => 'string', 'email_address' => 'string', - 'role' => 'string' + 'role' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account_id' => null, 'email_address' => 'email', - 'role' => null + 'role' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'account_id' => false, 'email_address' => false, - 'role' => false + 'role' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'account_id' => 'account_id', 'email_address' => 'email_address', - 'role' => 'role' + 'role' => 'role', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'account_id' => 'setAccountId', 'email_address' => 'setEmailAddress', - 'role' => 'setRole' + 'role' => 'setRole', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'account_id' => 'getAccountId', 'email_address' => 'getEmailAddress', - 'role' => 'getRole' + 'role' => 'getRole', ]; /** @@ -273,7 +263,7 @@ public function getRoleAllowableValues() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -282,34 +272,33 @@ public function __construct(?array $data = null) $this->setIfExists('role', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamAddMemberRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamAddMemberRequest { /** @var TeamAddMemberRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TeamAddMemberRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -351,7 +340,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets account_id * @@ -369,10 +357,10 @@ public function getAccountId() * * @return self */ - public function setAccountId($account_id) + public function setAccountId(?string $account_id) { if (is_null($account_id)) { - throw new \InvalidArgumentException('non-nullable account_id cannot be null'); + throw new InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -396,10 +384,10 @@ public function getEmailAddress() * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(?string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -423,14 +411,14 @@ public function getRole() * * @return self */ - public function setRole($role) + public function setRole(?string $role) { if (is_null($role)) { - throw new \InvalidArgumentException('non-nullable role cannot be null'); + throw new InvalidArgumentException('non-nullable role cannot be null'); } $allowedValues = $this->getRoleAllowableValues(); if (!in_array($role, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'role', must be one of '%s'", $role, @@ -442,14 +430,13 @@ public function setRole($role) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -458,11 +445,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -473,10 +460,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -489,11 +474,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -501,12 +484,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -535,5 +518,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TeamCreateRequest.php b/sdks/php/src/Model/TeamCreateRequest.php index 8b59366d8..791ab93b5 100644 --- a/sdks/php/src/Model/TeamCreateRequest.php +++ b/sdks/php/src/Model/TeamCreateRequest.php @@ -1,14 +1,11 @@ */ -class TeamCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class TeamCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamCreateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'name' => 'string' + 'name' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'name' => null + 'name' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'name' => false + 'name' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,8 +109,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -122,7 +118,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +128,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,9 +137,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -152,9 +145,6 @@ 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 { @@ -168,7 +158,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'name' => 'name' + 'name' => 'name', ]; /** @@ -177,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'name' => 'setName' + 'name' => 'setName', ]; /** @@ -186,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'name' => 'getName' + 'name' => 'getName', ]; /** @@ -230,7 +220,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -242,41 +231,40 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], 'Untitled Team'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamCreateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamCreateRequest { /** @var TeamCreateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TeamCreateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -293,9 +281,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -309,7 +295,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets name * @@ -323,27 +308,26 @@ public function getName() /** * Sets name * - * @param string|null $name The name of your Team. + * @param string|null $name the name of your Team * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -352,11 +336,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -367,10 +351,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -383,11 +365,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -395,12 +375,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -429,5 +409,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TeamGetInfoResponse.php b/sdks/php/src/Model/TeamGetInfoResponse.php index 4dfa3ae35..58c58f6dd 100644 --- a/sdks/php/src/Model/TeamGetInfoResponse.php +++ b/sdks/php/src/Model/TeamGetInfoResponse.php @@ -1,14 +1,11 @@ */ -class TeamGetInfoResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class TeamGetInfoResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamGetInfoResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'team' => '\Dropbox\Sign\Model\TeamInfoResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'team' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'team' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'team' => 'team', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'team' => 'setTeam', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'team' => 'getTeam', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamGetInfoResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamGetInfoResponse { /** @var TeamGetInfoResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TeamGetInfoResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,7 +307,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets team * @@ -337,10 +324,10 @@ public function getTeam() * * @return self */ - public function setTeam($team) + public function setTeam(TeamInfoResponse $team) { if (is_null($team)) { - throw new \InvalidArgumentException('non-nullable team cannot be null'); + throw new InvalidArgumentException('non-nullable team cannot be null'); } $this->container['team'] = $team; @@ -360,27 +347,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -389,11 +375,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -404,10 +390,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -420,11 +404,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -432,12 +414,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -466,5 +448,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TeamGetResponse.php b/sdks/php/src/Model/TeamGetResponse.php index e8de3940f..05624a166 100644 --- a/sdks/php/src/Model/TeamGetResponse.php +++ b/sdks/php/src/Model/TeamGetResponse.php @@ -1,14 +1,11 @@ */ -class TeamGetResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class TeamGetResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamGetResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'team' => '\Dropbox\Sign\Model\TeamResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'team' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'team' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'team' => 'team', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'team' => 'setTeam', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'team' => 'getTeam', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamGetResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamGetResponse { /** @var TeamGetResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TeamGetResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,7 +307,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets team * @@ -337,10 +324,10 @@ public function getTeam() * * @return self */ - public function setTeam($team) + public function setTeam(TeamResponse $team) { if (is_null($team)) { - throw new \InvalidArgumentException('non-nullable team cannot be null'); + throw new InvalidArgumentException('non-nullable team cannot be null'); } $this->container['team'] = $team; @@ -360,27 +347,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -389,11 +375,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -404,10 +390,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -420,11 +404,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -432,12 +414,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -466,5 +448,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TeamInfoResponse.php b/sdks/php/src/Model/TeamInfoResponse.php index 8e1353353..7deb94ad8 100644 --- a/sdks/php/src/Model/TeamInfoResponse.php +++ b/sdks/php/src/Model/TeamInfoResponse.php @@ -1,14 +1,11 @@ */ -class TeamInfoResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class TeamInfoResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamInfoResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'team_id' => 'string', 'team_parent' => '\Dropbox\Sign\Model\TeamParentResponse', 'name' => 'string', 'num_members' => 'int', - 'num_sub_teams' => 'int' + 'num_sub_teams' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'team_id' => null, 'team_parent' => null, 'name' => null, 'num_members' => null, - 'num_sub_teams' => null + 'num_sub_teams' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'team_id' => false, 'team_parent' => true, 'name' => false, 'num_members' => false, - 'num_sub_teams' => false + 'num_sub_teams' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -123,8 +121,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -134,7 +130,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -144,7 +140,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -153,9 +149,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -164,9 +157,6 @@ 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 { @@ -184,7 +174,7 @@ public function isNullableSetToNull(string $property): bool 'team_parent' => 'team_parent', 'name' => 'name', 'num_members' => 'num_members', - 'num_sub_teams' => 'num_sub_teams' + 'num_sub_teams' => 'num_sub_teams', ]; /** @@ -197,7 +187,7 @@ public function isNullableSetToNull(string $property): bool 'team_parent' => 'setTeamParent', 'name' => 'setName', 'num_members' => 'setNumMembers', - 'num_sub_teams' => 'setNumSubTeams' + 'num_sub_teams' => 'setNumSubTeams', ]; /** @@ -210,7 +200,7 @@ public function isNullableSetToNull(string $property): bool 'team_parent' => 'getTeamParent', 'name' => 'getName', 'num_members' => 'getNumMembers', - 'num_sub_teams' => 'getNumSubTeams' + 'num_sub_teams' => 'getNumSubTeams', ]; /** @@ -254,7 +244,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -266,7 +255,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -277,34 +266,33 @@ public function __construct(?array $data = null) $this->setIfExists('num_sub_teams', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamInfoResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamInfoResponse { /** @var TeamInfoResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TeamInfoResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -321,9 +309,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -337,7 +323,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets team_id * @@ -355,10 +340,10 @@ public function getTeamId() * * @return self */ - public function setTeamId($team_id) + public function setTeamId(?string $team_id) { if (is_null($team_id)) { - throw new \InvalidArgumentException('non-nullable team_id cannot be null'); + throw new InvalidArgumentException('non-nullable team_id cannot be null'); } $this->container['team_id'] = $team_id; @@ -382,13 +367,13 @@ public function getTeamParent() * * @return self */ - public function setTeamParent($team_parent) + public function setTeamParent(?TeamParentResponse $team_parent) { if (is_null($team_parent)) { array_push($this->openAPINullablesSetToNull, 'team_parent'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('team_parent', $nullablesSetToNull, true); + $index = array_search('team_parent', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -416,10 +401,10 @@ public function getName() * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -443,10 +428,10 @@ public function getNumMembers() * * @return self */ - public function setNumMembers($num_members) + public function setNumMembers(?int $num_members) { if (is_null($num_members)) { - throw new \InvalidArgumentException('non-nullable num_members cannot be null'); + throw new InvalidArgumentException('non-nullable num_members cannot be null'); } $this->container['num_members'] = $num_members; @@ -470,23 +455,22 @@ public function getNumSubTeams() * * @return self */ - public function setNumSubTeams($num_sub_teams) + public function setNumSubTeams(?int $num_sub_teams) { if (is_null($num_sub_teams)) { - throw new \InvalidArgumentException('non-nullable num_sub_teams cannot be null'); + throw new InvalidArgumentException('non-nullable num_sub_teams cannot be null'); } $this->container['num_sub_teams'] = $num_sub_teams; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -495,11 +479,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -510,10 +494,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -526,11 +508,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -538,12 +518,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -572,5 +552,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TeamInviteResponse.php b/sdks/php/src/Model/TeamInviteResponse.php index a1cdc493b..b9d91658c 100644 --- a/sdks/php/src/Model/TeamInviteResponse.php +++ b/sdks/php/src/Model/TeamInviteResponse.php @@ -1,14 +1,11 @@ */ -class TeamInviteResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class TeamInviteResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamInviteResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'email_address' => 'string', 'team_id' => 'string', 'role' => 'string', 'sent_at' => 'int', 'redeemed_at' => 'int', - 'expires_at' => 'int' + 'expires_at' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'email_address' => null, 'team_id' => null, 'role' => null, 'sent_at' => null, 'redeemed_at' => null, - 'expires_at' => null + 'expires_at' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'email_address' => false, 'team_id' => false, 'role' => false, 'sent_at' => false, 'redeemed_at' => false, - 'expires_at' => false + 'expires_at' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -126,8 +124,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -137,7 +133,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -147,7 +143,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -156,9 +152,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -167,9 +160,6 @@ 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 { @@ -188,7 +178,7 @@ public function isNullableSetToNull(string $property): bool 'role' => 'role', 'sent_at' => 'sent_at', 'redeemed_at' => 'redeemed_at', - 'expires_at' => 'expires_at' + 'expires_at' => 'expires_at', ]; /** @@ -202,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'role' => 'setRole', 'sent_at' => 'setSentAt', 'redeemed_at' => 'setRedeemedAt', - 'expires_at' => 'setExpiresAt' + 'expires_at' => 'setExpiresAt', ]; /** @@ -216,7 +206,7 @@ public function isNullableSetToNull(string $property): bool 'role' => 'getRole', 'sent_at' => 'getSentAt', 'redeemed_at' => 'getRedeemedAt', - 'expires_at' => 'getExpiresAt' + 'expires_at' => 'getExpiresAt', ]; /** @@ -260,7 +250,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -272,7 +261,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -284,34 +273,33 @@ public function __construct(?array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamInviteResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamInviteResponse { /** @var TeamInviteResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TeamInviteResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -328,9 +316,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -344,7 +330,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets email_address * @@ -358,14 +343,14 @@ public function getEmailAddress() /** * Sets email_address * - * @param string|null $email_address Email address of the user invited to this team. + * @param string|null $email_address email address of the user invited to this team * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(?string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -385,14 +370,14 @@ public function getTeamId() /** * Sets team_id * - * @param string|null $team_id Id of the team. + * @param string|null $team_id id of the team * * @return self */ - public function setTeamId($team_id) + public function setTeamId(?string $team_id) { if (is_null($team_id)) { - throw new \InvalidArgumentException('non-nullable team_id cannot be null'); + throw new InvalidArgumentException('non-nullable team_id cannot be null'); } $this->container['team_id'] = $team_id; @@ -412,14 +397,14 @@ public function getRole() /** * Sets role * - * @param string|null $role Role of the user invited to this team. + * @param string|null $role role of the user invited to this team * * @return self */ - public function setRole($role) + public function setRole(?string $role) { if (is_null($role)) { - throw new \InvalidArgumentException('non-nullable role cannot be null'); + throw new InvalidArgumentException('non-nullable role cannot be null'); } $this->container['role'] = $role; @@ -439,14 +424,14 @@ public function getSentAt() /** * Sets sent_at * - * @param int|null $sent_at Timestamp when the invitation was sent. + * @param int|null $sent_at timestamp when the invitation was sent * * @return self */ - public function setSentAt($sent_at) + public function setSentAt(?int $sent_at) { if (is_null($sent_at)) { - throw new \InvalidArgumentException('non-nullable sent_at cannot be null'); + throw new InvalidArgumentException('non-nullable sent_at cannot be null'); } $this->container['sent_at'] = $sent_at; @@ -466,14 +451,14 @@ public function getRedeemedAt() /** * Sets redeemed_at * - * @param int|null $redeemed_at Timestamp when the invitation was redeemed. + * @param int|null $redeemed_at timestamp when the invitation was redeemed * * @return self */ - public function setRedeemedAt($redeemed_at) + public function setRedeemedAt(?int $redeemed_at) { if (is_null($redeemed_at)) { - throw new \InvalidArgumentException('non-nullable redeemed_at cannot be null'); + throw new InvalidArgumentException('non-nullable redeemed_at cannot be null'); } $this->container['redeemed_at'] = $redeemed_at; @@ -493,27 +478,26 @@ public function getExpiresAt() /** * Sets expires_at * - * @param int|null $expires_at Timestamp when the invitation is expiring. + * @param int|null $expires_at timestamp when the invitation is expiring * * @return self */ - public function setExpiresAt($expires_at) + public function setExpiresAt(?int $expires_at) { if (is_null($expires_at)) { - throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + throw new InvalidArgumentException('non-nullable expires_at cannot be null'); } $this->container['expires_at'] = $expires_at; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -522,11 +506,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -537,10 +521,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -553,11 +535,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -565,12 +545,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -599,5 +579,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TeamInvitesResponse.php b/sdks/php/src/Model/TeamInvitesResponse.php index 124e5e8eb..5ad2014f0 100644 --- a/sdks/php/src/Model/TeamInvitesResponse.php +++ b/sdks/php/src/Model/TeamInvitesResponse.php @@ -1,14 +1,11 @@ */ -class TeamInvitesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class TeamInvitesResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamInvitesResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'team_invites' => '\Dropbox\Sign\Model\TeamInviteResponse[]', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'team_invites' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'team_invites' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'team_invites' => 'team_invites', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'team_invites' => 'setTeamInvites', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'team_invites' => 'getTeamInvites', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamInvitesResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamInvitesResponse { /** @var TeamInvitesResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TeamInvitesResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,7 +307,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets team_invites * @@ -333,14 +320,14 @@ public function getTeamInvites() /** * Sets team_invites * - * @param TeamInviteResponse[] $team_invites Contains a list of team invites and their roles. + * @param TeamInviteResponse[] $team_invites contains a list of team invites and their roles * * @return self */ - public function setTeamInvites($team_invites) + public function setTeamInvites(array $team_invites) { if (is_null($team_invites)) { - throw new \InvalidArgumentException('non-nullable team_invites cannot be null'); + throw new InvalidArgumentException('non-nullable team_invites cannot be null'); } $this->container['team_invites'] = $team_invites; @@ -364,23 +351,22 @@ public function getWarnings() * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -389,11 +375,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -404,10 +390,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -420,11 +404,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -432,12 +414,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -466,5 +448,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TeamMemberResponse.php b/sdks/php/src/Model/TeamMemberResponse.php index 4c0885de1..89141eb9b 100644 --- a/sdks/php/src/Model/TeamMemberResponse.php +++ b/sdks/php/src/Model/TeamMemberResponse.php @@ -1,14 +1,11 @@ */ -class TeamMemberResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class TeamMemberResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamMemberResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account_id' => 'string', 'email_address' => 'string', - 'role' => 'string' + 'role' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account_id' => null, 'email_address' => null, - 'role' => null + 'role' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'account_id' => false, 'email_address' => false, - 'role' => false + 'role' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'account_id' => 'account_id', 'email_address' => 'email_address', - 'role' => 'role' + 'role' => 'role', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'account_id' => 'setAccountId', 'email_address' => 'setEmailAddress', - 'role' => 'setRole' + 'role' => 'setRole', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'account_id' => 'getAccountId', 'email_address' => 'getEmailAddress', - 'role' => 'getRole' + 'role' => 'getRole', ]; /** @@ -242,7 +232,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -254,7 +243,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -263,34 +252,33 @@ public function __construct(?array $data = null) $this->setIfExists('role', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamMemberResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamMemberResponse { /** @var TeamMemberResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TeamMemberResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,9 +295,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -323,7 +309,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets account_id * @@ -337,14 +322,14 @@ public function getAccountId() /** * Sets account_id * - * @param string|null $account_id Account id of the team member. + * @param string|null $account_id account id of the team member * * @return self */ - public function setAccountId($account_id) + public function setAccountId(?string $account_id) { if (is_null($account_id)) { - throw new \InvalidArgumentException('non-nullable account_id cannot be null'); + throw new InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -364,14 +349,14 @@ public function getEmailAddress() /** * Sets email_address * - * @param string|null $email_address Email address of the team member. + * @param string|null $email_address email address of the team member * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(?string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -391,27 +376,26 @@ public function getRole() /** * Sets role * - * @param string|null $role The specific role a member has on the team. + * @param string|null $role the specific role a member has on the team * * @return self */ - public function setRole($role) + public function setRole(?string $role) { if (is_null($role)) { - throw new \InvalidArgumentException('non-nullable role cannot be null'); + throw new InvalidArgumentException('non-nullable role cannot be null'); } $this->container['role'] = $role; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -420,11 +404,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -435,10 +419,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -451,11 +433,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -463,12 +443,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -497,5 +477,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TeamMembersResponse.php b/sdks/php/src/Model/TeamMembersResponse.php index b0d29b515..87a3fda3f 100644 --- a/sdks/php/src/Model/TeamMembersResponse.php +++ b/sdks/php/src/Model/TeamMembersResponse.php @@ -1,14 +1,11 @@ */ -class TeamMembersResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class TeamMembersResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamMembersResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'team_members' => '\Dropbox\Sign\Model\TeamMemberResponse[]', 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'team_members' => null, 'list_info' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'team_members' => false, 'list_info' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'team_members' => 'team_members', 'list_info' => 'list_info', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'team_members' => 'setTeamMembers', 'list_info' => 'setListInfo', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'team_members' => 'getTeamMembers', 'list_info' => 'getListInfo', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -242,7 +232,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -254,7 +243,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -263,34 +252,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamMembersResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamMembersResponse { /** @var TeamMembersResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TeamMembersResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -329,7 +317,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets team_members * @@ -343,14 +330,14 @@ public function getTeamMembers() /** * Sets team_members * - * @param TeamMemberResponse[] $team_members Contains a list of team members and their roles for a specific team. + * @param TeamMemberResponse[] $team_members contains a list of team members and their roles for a specific team * * @return self */ - public function setTeamMembers($team_members) + public function setTeamMembers(array $team_members) { if (is_null($team_members)) { - throw new \InvalidArgumentException('non-nullable team_members cannot be null'); + throw new InvalidArgumentException('non-nullable team_members cannot be null'); } $this->container['team_members'] = $team_members; @@ -374,10 +361,10 @@ public function getListInfo() * * @return self */ - public function setListInfo($list_info) + public function setListInfo(ListInfoResponse $list_info) { if (is_null($list_info)) { - throw new \InvalidArgumentException('non-nullable list_info cannot be null'); + throw new InvalidArgumentException('non-nullable list_info cannot be null'); } $this->container['list_info'] = $list_info; @@ -401,23 +388,22 @@ public function getWarnings() * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -426,11 +412,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -441,10 +427,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -457,11 +441,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -469,12 +451,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -503,5 +485,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TeamParentResponse.php b/sdks/php/src/Model/TeamParentResponse.php index 4566b7d14..bfd6cc6f8 100644 --- a/sdks/php/src/Model/TeamParentResponse.php +++ b/sdks/php/src/Model/TeamParentResponse.php @@ -1,14 +1,11 @@ */ -class TeamParentResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class TeamParentResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamParentResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'team_id' => 'string', - 'name' => 'string' + 'name' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'team_id' => null, - 'name' => null + 'name' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'team_id' => false, - 'name' => false + 'name' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,8 +113,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -126,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -136,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -145,9 +141,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -156,9 +149,6 @@ 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 { @@ -173,7 +163,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'team_id' => 'team_id', - 'name' => 'name' + 'name' => 'name', ]; /** @@ -183,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'team_id' => 'setTeamId', - 'name' => 'setName' + 'name' => 'setName', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'team_id' => 'getTeamId', - 'name' => 'getName' + 'name' => 'getName', ]; /** @@ -237,7 +227,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -249,7 +238,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -257,34 +246,33 @@ public function __construct(?array $data = null) $this->setIfExists('name', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamParentResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamParentResponse { /** @var TeamParentResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TeamParentResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -301,9 +289,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -317,7 +303,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets team_id * @@ -335,10 +320,10 @@ public function getTeamId() * * @return self */ - public function setTeamId($team_id) + public function setTeamId(?string $team_id) { if (is_null($team_id)) { - throw new \InvalidArgumentException('non-nullable team_id cannot be null'); + throw new InvalidArgumentException('non-nullable team_id cannot be null'); } $this->container['team_id'] = $team_id; @@ -362,23 +347,22 @@ public function getName() * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -387,11 +371,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -402,10 +386,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -418,11 +400,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -430,12 +410,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -464,5 +444,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TeamRemoveMemberRequest.php b/sdks/php/src/Model/TeamRemoveMemberRequest.php index e8e7b9188..6c411d53a 100644 --- a/sdks/php/src/Model/TeamRemoveMemberRequest.php +++ b/sdks/php/src/Model/TeamRemoveMemberRequest.php @@ -1,14 +1,11 @@ */ -class TeamRemoveMemberRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class TeamRemoveMemberRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamRemoveMemberRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account_id' => 'string', 'email_address' => 'string', 'new_owner_email_address' => 'string', 'new_team_id' => 'string', - 'new_role' => 'string' + 'new_role' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account_id' => null, 'email_address' => 'email', 'new_owner_email_address' => 'email', 'new_team_id' => null, - 'new_role' => null + 'new_role' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'account_id' => false, 'email_address' => false, 'new_owner_email_address' => false, 'new_team_id' => false, - 'new_role' => false + 'new_role' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -123,8 +121,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -134,7 +130,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -144,7 +140,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -153,9 +149,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -164,9 +157,6 @@ 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 { @@ -184,7 +174,7 @@ public function isNullableSetToNull(string $property): bool 'email_address' => 'email_address', 'new_owner_email_address' => 'new_owner_email_address', 'new_team_id' => 'new_team_id', - 'new_role' => 'new_role' + 'new_role' => 'new_role', ]; /** @@ -197,7 +187,7 @@ public function isNullableSetToNull(string $property): bool 'email_address' => 'setEmailAddress', 'new_owner_email_address' => 'setNewOwnerEmailAddress', 'new_team_id' => 'setNewTeamId', - 'new_role' => 'setNewRole' + 'new_role' => 'setNewRole', ]; /** @@ -210,7 +200,7 @@ public function isNullableSetToNull(string $property): bool 'email_address' => 'getEmailAddress', 'new_owner_email_address' => 'getNewOwnerEmailAddress', 'new_team_id' => 'getNewTeamId', - 'new_role' => 'getNewRole' + 'new_role' => 'getNewRole', ]; /** @@ -285,7 +275,7 @@ public function getNewRoleAllowableValues() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -296,34 +286,33 @@ public function __construct(?array $data = null) $this->setIfExists('new_role', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamRemoveMemberRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamRemoveMemberRequest { /** @var TeamRemoveMemberRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TeamRemoveMemberRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -365,7 +354,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets account_id * @@ -383,10 +371,10 @@ public function getAccountId() * * @return self */ - public function setAccountId($account_id) + public function setAccountId(?string $account_id) { if (is_null($account_id)) { - throw new \InvalidArgumentException('non-nullable account_id cannot be null'); + throw new InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -410,10 +398,10 @@ public function getEmailAddress() * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(?string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -437,10 +425,10 @@ public function getNewOwnerEmailAddress() * * @return self */ - public function setNewOwnerEmailAddress($new_owner_email_address) + public function setNewOwnerEmailAddress(?string $new_owner_email_address) { if (is_null($new_owner_email_address)) { - throw new \InvalidArgumentException('non-nullable new_owner_email_address cannot be null'); + throw new InvalidArgumentException('non-nullable new_owner_email_address cannot be null'); } $this->container['new_owner_email_address'] = $new_owner_email_address; @@ -460,14 +448,14 @@ public function getNewTeamId() /** * Sets new_team_id * - * @param string|null $new_team_id Id of the new Team. + * @param string|null $new_team_id id of the new Team * * @return self */ - public function setNewTeamId($new_team_id) + public function setNewTeamId(?string $new_team_id) { if (is_null($new_team_id)) { - throw new \InvalidArgumentException('non-nullable new_team_id cannot be null'); + throw new InvalidArgumentException('non-nullable new_team_id cannot be null'); } $this->container['new_team_id'] = $new_team_id; @@ -491,14 +479,14 @@ public function getNewRole() * * @return self */ - public function setNewRole($new_role) + public function setNewRole(?string $new_role) { if (is_null($new_role)) { - throw new \InvalidArgumentException('non-nullable new_role cannot be null'); + throw new InvalidArgumentException('non-nullable new_role cannot be null'); } $allowedValues = $this->getNewRoleAllowableValues(); if (!in_array($new_role, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'new_role', must be one of '%s'", $new_role, @@ -510,14 +498,13 @@ public function setNewRole($new_role) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -526,11 +513,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -541,10 +528,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -557,11 +542,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -569,12 +552,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -603,5 +586,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TeamResponse.php b/sdks/php/src/Model/TeamResponse.php index 7f30850a8..922c408b8 100644 --- a/sdks/php/src/Model/TeamResponse.php +++ b/sdks/php/src/Model/TeamResponse.php @@ -1,14 +1,11 @@ */ -class TeamResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class TeamResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', 'accounts' => '\Dropbox\Sign\Model\AccountResponse[]', 'invited_accounts' => '\Dropbox\Sign\Model\AccountResponse[]', - 'invited_emails' => 'string[]' + 'invited_emails' => 'string[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, 'accounts' => null, 'invited_accounts' => null, - 'invited_emails' => null + 'invited_emails' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'name' => false, 'accounts' => false, 'invited_accounts' => false, - 'invited_emails' => false + 'invited_emails' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -121,8 +119,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -132,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -142,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -151,9 +147,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -162,9 +155,6 @@ 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 { @@ -181,7 +171,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'name', 'accounts' => 'accounts', 'invited_accounts' => 'invited_accounts', - 'invited_emails' => 'invited_emails' + 'invited_emails' => 'invited_emails', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'setName', 'accounts' => 'setAccounts', 'invited_accounts' => 'setInvitedAccounts', - 'invited_emails' => 'setInvitedEmails' + 'invited_emails' => 'setInvitedEmails', ]; /** @@ -205,7 +195,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'getName', 'accounts' => 'getAccounts', 'invited_accounts' => 'getInvitedAccounts', - 'invited_emails' => 'getInvitedEmails' + 'invited_emails' => 'getInvitedEmails', ]; /** @@ -249,7 +239,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -261,7 +250,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -271,34 +260,33 @@ public function __construct(?array $data = null) $this->setIfExists('invited_emails', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamResponse { /** @var TeamResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TeamResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -315,9 +303,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -331,7 +317,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets name * @@ -349,10 +334,10 @@ public function getName() * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -376,10 +361,10 @@ public function getAccounts() * * @return self */ - public function setAccounts($accounts) + public function setAccounts(?array $accounts) { if (is_null($accounts)) { - throw new \InvalidArgumentException('non-nullable accounts cannot be null'); + throw new InvalidArgumentException('non-nullable accounts cannot be null'); } $this->container['accounts'] = $accounts; @@ -403,10 +388,10 @@ public function getInvitedAccounts() * * @return self */ - public function setInvitedAccounts($invited_accounts) + public function setInvitedAccounts(?array $invited_accounts) { if (is_null($invited_accounts)) { - throw new \InvalidArgumentException('non-nullable invited_accounts cannot be null'); + throw new InvalidArgumentException('non-nullable invited_accounts cannot be null'); } $this->container['invited_accounts'] = $invited_accounts; @@ -426,27 +411,26 @@ public function getInvitedEmails() /** * Sets invited_emails * - * @param string[]|null $invited_emails A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account. + * @param string[]|null $invited_emails a list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account * * @return self */ - public function setInvitedEmails($invited_emails) + public function setInvitedEmails(?array $invited_emails) { if (is_null($invited_emails)) { - throw new \InvalidArgumentException('non-nullable invited_emails cannot be null'); + throw new InvalidArgumentException('non-nullable invited_emails cannot be null'); } $this->container['invited_emails'] = $invited_emails; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -455,11 +439,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -470,10 +454,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -486,11 +468,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -498,12 +478,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -532,5 +512,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TeamSubTeamsResponse.php b/sdks/php/src/Model/TeamSubTeamsResponse.php index 7af88b380..367149d34 100644 --- a/sdks/php/src/Model/TeamSubTeamsResponse.php +++ b/sdks/php/src/Model/TeamSubTeamsResponse.php @@ -1,14 +1,11 @@ */ -class TeamSubTeamsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class TeamSubTeamsResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamSubTeamsResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'sub_teams' => '\Dropbox\Sign\Model\SubTeamResponse[]', 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'sub_teams' => null, 'list_info' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'sub_teams' => false, 'list_info' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'sub_teams' => 'sub_teams', 'list_info' => 'list_info', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'sub_teams' => 'setSubTeams', 'list_info' => 'setListInfo', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'sub_teams' => 'getSubTeams', 'list_info' => 'getListInfo', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -242,7 +232,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -254,7 +243,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -263,34 +252,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamSubTeamsResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamSubTeamsResponse { /** @var TeamSubTeamsResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TeamSubTeamsResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -329,7 +317,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets sub_teams * @@ -343,14 +330,14 @@ public function getSubTeams() /** * Sets sub_teams * - * @param SubTeamResponse[] $sub_teams Contains a list with sub teams. + * @param SubTeamResponse[] $sub_teams contains a list with sub teams * * @return self */ - public function setSubTeams($sub_teams) + public function setSubTeams(array $sub_teams) { if (is_null($sub_teams)) { - throw new \InvalidArgumentException('non-nullable sub_teams cannot be null'); + throw new InvalidArgumentException('non-nullable sub_teams cannot be null'); } $this->container['sub_teams'] = $sub_teams; @@ -374,10 +361,10 @@ public function getListInfo() * * @return self */ - public function setListInfo($list_info) + public function setListInfo(ListInfoResponse $list_info) { if (is_null($list_info)) { - throw new \InvalidArgumentException('non-nullable list_info cannot be null'); + throw new InvalidArgumentException('non-nullable list_info cannot be null'); } $this->container['list_info'] = $list_info; @@ -401,23 +388,22 @@ public function getWarnings() * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -426,11 +412,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -441,10 +427,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -457,11 +441,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -469,12 +451,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -503,5 +485,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TeamUpdateRequest.php b/sdks/php/src/Model/TeamUpdateRequest.php index 1f074d9b5..c63114671 100644 --- a/sdks/php/src/Model/TeamUpdateRequest.php +++ b/sdks/php/src/Model/TeamUpdateRequest.php @@ -1,14 +1,11 @@ */ -class TeamUpdateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class TeamUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TeamUpdateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'name' => 'string' + 'name' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'name' => null + 'name' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'name' => false + 'name' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,8 +109,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -122,7 +118,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +128,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,9 +137,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -152,9 +145,6 @@ 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 { @@ -168,7 +158,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'name' => 'name' + 'name' => 'name', ]; /** @@ -177,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'name' => 'setName' + 'name' => 'setName', ]; /** @@ -186,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'name' => 'getName' + 'name' => 'getName', ]; /** @@ -230,7 +220,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -242,41 +231,40 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamUpdateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamUpdateRequest { /** @var TeamUpdateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TeamUpdateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -293,9 +281,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -309,7 +295,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets name * @@ -323,27 +308,26 @@ public function getName() /** * Sets name * - * @param string|null $name The name of your Team. + * @param string|null $name the name of your Team * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -352,11 +336,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -367,10 +351,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -383,11 +365,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -395,12 +375,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -429,5 +409,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateAddUserRequest.php b/sdks/php/src/Model/TemplateAddUserRequest.php index 268cde9a0..fa235f3c8 100644 --- a/sdks/php/src/Model/TemplateAddUserRequest.php +++ b/sdks/php/src/Model/TemplateAddUserRequest.php @@ -1,14 +1,11 @@ */ -class TemplateAddUserRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateAddUserRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateAddUserRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account_id' => 'string', 'email_address' => 'string', - 'skip_notification' => 'bool' + 'skip_notification' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account_id' => null, 'email_address' => 'email', - 'skip_notification' => null + 'skip_notification' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'account_id' => false, 'email_address' => false, - 'skip_notification' => false + 'skip_notification' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'account_id' => 'account_id', 'email_address' => 'email_address', - 'skip_notification' => 'skip_notification' + 'skip_notification' => 'skip_notification', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'account_id' => 'setAccountId', 'email_address' => 'setEmailAddress', - 'skip_notification' => 'setSkipNotification' + 'skip_notification' => 'setSkipNotification', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'account_id' => 'getAccountId', 'email_address' => 'getEmailAddress', - 'skip_notification' => 'getSkipNotification' + 'skip_notification' => 'getSkipNotification', ]; /** @@ -242,7 +232,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -254,7 +243,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -263,34 +252,33 @@ public function __construct(?array $data = null) $this->setIfExists('skip_notification', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateAddUserRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateAddUserRequest { /** @var TemplateAddUserRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateAddUserRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,9 +295,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -323,7 +309,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets account_id * @@ -341,10 +326,10 @@ public function getAccountId() * * @return self */ - public function setAccountId($account_id) + public function setAccountId(?string $account_id) { if (is_null($account_id)) { - throw new \InvalidArgumentException('non-nullable account_id cannot be null'); + throw new InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -368,10 +353,10 @@ public function getEmailAddress() * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(?string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -395,23 +380,22 @@ public function getSkipNotification() * * @return self */ - public function setSkipNotification($skip_notification) + public function setSkipNotification(?bool $skip_notification) { if (is_null($skip_notification)) { - throw new \InvalidArgumentException('non-nullable skip_notification cannot be null'); + throw new InvalidArgumentException('non-nullable skip_notification cannot be null'); } $this->container['skip_notification'] = $skip_notification; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -420,11 +404,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -435,10 +419,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -451,11 +433,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -463,12 +443,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -497,5 +477,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateCreateEmbeddedDraftRequest.php b/sdks/php/src/Model/TemplateCreateEmbeddedDraftRequest.php index 9575759d5..79ce3b26a 100644 --- a/sdks/php/src/Model/TemplateCreateEmbeddedDraftRequest.php +++ b/sdks/php/src/Model/TemplateCreateEmbeddedDraftRequest.php @@ -1,14 +1,11 @@ */ -class TemplateCreateEmbeddedDraftRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateCreateEmbeddedDraftRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateCreateEmbeddedDraftRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'client_id' => 'string', 'files' => '\SplFileObject[]', @@ -83,16 +82,16 @@ class TemplateCreateEmbeddedDraftRequest implements ModelInterface, ArrayAccess, 'subject' => 'string', 'test_mode' => 'bool', 'title' => 'string', - 'use_preexisting_fields' => 'bool' + 'use_preexisting_fields' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'client_id' => null, 'files' => 'binary', @@ -118,14 +117,14 @@ class TemplateCreateEmbeddedDraftRequest implements ModelInterface, ArrayAccess, 'subject' => null, 'test_mode' => null, 'title' => null, - 'use_preexisting_fields' => null + 'use_preexisting_fields' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'client_id' => false, 'files' => false, @@ -151,14 +150,14 @@ class TemplateCreateEmbeddedDraftRequest implements ModelInterface, ArrayAccess, 'subject' => false, 'test_mode' => false, 'title' => false, - 'use_preexisting_fields' => false + 'use_preexisting_fields' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -183,8 +182,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -194,7 +191,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -204,7 +201,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -213,9 +210,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -224,9 +218,6 @@ 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 { @@ -264,7 +255,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'subject', 'test_mode' => 'test_mode', 'title' => 'title', - 'use_preexisting_fields' => 'use_preexisting_fields' + 'use_preexisting_fields' => 'use_preexisting_fields', ]; /** @@ -297,7 +288,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'setSubject', 'test_mode' => 'setTestMode', 'title' => 'setTitle', - 'use_preexisting_fields' => 'setUsePreexistingFields' + 'use_preexisting_fields' => 'setUsePreexistingFields', ]; /** @@ -330,7 +321,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'getSubject', 'test_mode' => 'getTestMode', 'title' => 'getTitle', - 'use_preexisting_fields' => 'getUsePreexistingFields' + 'use_preexisting_fields' => 'getUsePreexistingFields', ]; /** @@ -374,7 +365,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -386,7 +376,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -417,34 +407,33 @@ public function __construct(?array $data = null) $this->setIfExists('use_preexisting_fields', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateCreateEmbeddedDraftRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateCreateEmbeddedDraftRequest { /** @var TemplateCreateEmbeddedDraftRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateCreateEmbeddedDraftRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -488,7 +477,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets client_id * @@ -506,10 +494,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -519,7 +507,7 @@ public function setClientId($client_id) /** * Gets files * - * @return \SplFileObject[]|null + * @return SplFileObject[]|null */ public function getFiles() { @@ -529,14 +517,14 @@ public function getFiles() /** * Sets files * - * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles($files) + public function setFiles(?array $files) { if (is_null($files)) { - throw new \InvalidArgumentException('non-nullable files cannot be null'); + throw new InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -560,10 +548,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls($file_urls) + public function setFileUrls(?array $file_urls) { if (is_null($file_urls)) { - throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -583,14 +571,14 @@ public function getAllowCcs() /** * Sets allow_ccs * - * @param bool|null $allow_ccs This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template. + * @param bool|null $allow_ccs this allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template * * @return self */ - public function setAllowCcs($allow_ccs) + public function setAllowCcs(?bool $allow_ccs) { if (is_null($allow_ccs)) { - throw new \InvalidArgumentException('non-nullable allow_ccs cannot be null'); + throw new InvalidArgumentException('non-nullable allow_ccs cannot be null'); } $this->container['allow_ccs'] = $allow_ccs; @@ -614,10 +602,10 @@ public function getAllowReassign() * * @return self */ - public function setAllowReassign($allow_reassign) + public function setAllowReassign(?bool $allow_reassign) { if (is_null($allow_reassign)) { - throw new \InvalidArgumentException('non-nullable allow_reassign cannot be null'); + throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); } $this->container['allow_reassign'] = $allow_reassign; @@ -641,10 +629,10 @@ public function getAttachments() * * @return self */ - public function setAttachments($attachments) + public function setAttachments(?array $attachments) { if (is_null($attachments)) { - throw new \InvalidArgumentException('non-nullable attachments cannot be null'); + throw new InvalidArgumentException('non-nullable attachments cannot be null'); } $this->container['attachments'] = $attachments; @@ -668,10 +656,10 @@ public function getCcRoles() * * @return self */ - public function setCcRoles($cc_roles) + public function setCcRoles(?array $cc_roles) { if (is_null($cc_roles)) { - throw new \InvalidArgumentException('non-nullable cc_roles cannot be null'); + throw new InvalidArgumentException('non-nullable cc_roles cannot be null'); } $this->container['cc_roles'] = $cc_roles; @@ -695,10 +683,10 @@ public function getEditorOptions() * * @return self */ - public function setEditorOptions($editor_options) + public function setEditorOptions(?SubEditorOptions $editor_options) { if (is_null($editor_options)) { - throw new \InvalidArgumentException('non-nullable editor_options cannot be null'); + throw new InvalidArgumentException('non-nullable editor_options cannot be null'); } $this->container['editor_options'] = $editor_options; @@ -722,10 +710,10 @@ public function getFieldOptions() * * @return self */ - public function setFieldOptions($field_options) + public function setFieldOptions(?SubFieldOptions $field_options) { if (is_null($field_options)) { - throw new \InvalidArgumentException('non-nullable field_options cannot be null'); + throw new InvalidArgumentException('non-nullable field_options cannot be null'); } $this->container['field_options'] = $field_options; @@ -745,14 +733,14 @@ public function getForceSignerRoles() /** * Sets force_signer_roles * - * @param bool|null $force_signer_roles Provide users the ability to review/edit the template signer roles. + * @param bool|null $force_signer_roles provide users the ability to review/edit the template signer roles * * @return self */ - public function setForceSignerRoles($force_signer_roles) + public function setForceSignerRoles(?bool $force_signer_roles) { if (is_null($force_signer_roles)) { - throw new \InvalidArgumentException('non-nullable force_signer_roles cannot be null'); + throw new InvalidArgumentException('non-nullable force_signer_roles cannot be null'); } $this->container['force_signer_roles'] = $force_signer_roles; @@ -772,14 +760,14 @@ public function getForceSubjectMessage() /** * Sets force_subject_message * - * @param bool|null $force_subject_message Provide users the ability to review/edit the template subject and message. + * @param bool|null $force_subject_message provide users the ability to review/edit the template subject and message * * @return self */ - public function setForceSubjectMessage($force_subject_message) + public function setForceSubjectMessage(?bool $force_subject_message) { if (is_null($force_subject_message)) { - throw new \InvalidArgumentException('non-nullable force_subject_message cannot be null'); + throw new InvalidArgumentException('non-nullable force_subject_message cannot be null'); } $this->container['force_subject_message'] = $force_subject_message; @@ -803,10 +791,10 @@ public function getFormFieldGroups() * * @return self */ - public function setFormFieldGroups($form_field_groups) + public function setFormFieldGroups(?array $form_field_groups) { if (is_null($form_field_groups)) { - throw new \InvalidArgumentException('non-nullable form_field_groups cannot be null'); + throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); } $this->container['form_field_groups'] = $form_field_groups; @@ -826,14 +814,14 @@ public function getFormFieldRules() /** * Sets form_field_rules * - * @param SubFormFieldRule[]|null $form_field_rules Conditional Logic rules for fields defined in `form_fields_per_document`. + * @param SubFormFieldRule[]|null $form_field_rules conditional Logic rules for fields defined in `form_fields_per_document` * * @return self */ - public function setFormFieldRules($form_field_rules) + public function setFormFieldRules(?array $form_field_rules) { if (is_null($form_field_rules)) { - throw new \InvalidArgumentException('non-nullable form_field_rules cannot be null'); + throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); } $this->container['form_field_rules'] = $form_field_rules; @@ -857,10 +845,10 @@ public function getFormFieldsPerDocument() * * @return self */ - public function setFormFieldsPerDocument($form_fields_per_document) + public function setFormFieldsPerDocument(?array $form_fields_per_document) { if (is_null($form_fields_per_document)) { - throw new \InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); } $this->container['form_fields_per_document'] = $form_fields_per_document; @@ -884,10 +872,10 @@ public function getMergeFields() * * @return self */ - public function setMergeFields($merge_fields) + public function setMergeFields(?array $merge_fields) { if (is_null($merge_fields)) { - throw new \InvalidArgumentException('non-nullable merge_fields cannot be null'); + throw new InvalidArgumentException('non-nullable merge_fields cannot be null'); } $this->container['merge_fields'] = $merge_fields; @@ -907,17 +895,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message The default template email message. + * @param string|null $message the default template email message * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + throw new InvalidArgumentException('non-nullable message cannot be null'); } - if ((mb_strlen($message) > 5000)) { - throw new \InvalidArgumentException('invalid length for $message when calling TemplateCreateEmbeddedDraftRequest., must be smaller than or equal to 5000.'); + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling TemplateCreateEmbeddedDraftRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -942,13 +930,12 @@ public function getMetadata() * * @return self */ - public function setMetadata($metadata) + public function setMetadata(?array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } - $this->container['metadata'] = $metadata; return $this; @@ -971,10 +958,10 @@ public function getShowPreview() * * @return self */ - public function setShowPreview($show_preview) + public function setShowPreview(?bool $show_preview) { if (is_null($show_preview)) { - throw new \InvalidArgumentException('non-nullable show_preview cannot be null'); + throw new InvalidArgumentException('non-nullable show_preview cannot be null'); } $this->container['show_preview'] = $show_preview; @@ -994,14 +981,14 @@ public function getShowProgressStepper() /** * Sets show_progress_stepper * - * @param bool|null $show_progress_stepper When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. + * @param bool|null $show_progress_stepper when only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden * * @return self */ - public function setShowProgressStepper($show_progress_stepper) + public function setShowProgressStepper(?bool $show_progress_stepper) { if (is_null($show_progress_stepper)) { - throw new \InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); + throw new InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); } $this->container['show_progress_stepper'] = $show_progress_stepper; @@ -1021,14 +1008,14 @@ public function getSignerRoles() /** * Sets signer_roles * - * @param SubTemplateRole[]|null $signer_roles An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. + * @param SubTemplateRole[]|null $signer_roles an array of the designated signer roles that must be specified when sending a SignatureRequest using this Template * * @return self */ - public function setSignerRoles($signer_roles) + public function setSignerRoles(?array $signer_roles) { if (is_null($signer_roles)) { - throw new \InvalidArgumentException('non-nullable signer_roles cannot be null'); + throw new InvalidArgumentException('non-nullable signer_roles cannot be null'); } $this->container['signer_roles'] = $signer_roles; @@ -1052,10 +1039,10 @@ public function getSkipMeNow() * * @return self */ - public function setSkipMeNow($skip_me_now) + public function setSkipMeNow(?bool $skip_me_now) { if (is_null($skip_me_now)) { - throw new \InvalidArgumentException('non-nullable skip_me_now cannot be null'); + throw new InvalidArgumentException('non-nullable skip_me_now cannot be null'); } $this->container['skip_me_now'] = $skip_me_now; @@ -1075,17 +1062,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject The template title (alias). + * @param string|null $subject the template title (alias) * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { - throw new \InvalidArgumentException('non-nullable subject cannot be null'); + throw new InvalidArgumentException('non-nullable subject cannot be null'); } - if ((mb_strlen($subject) > 200)) { - throw new \InvalidArgumentException('invalid length for $subject when calling TemplateCreateEmbeddedDraftRequest., must be smaller than or equal to 200.'); + if (mb_strlen($subject) > 200) { + throw new InvalidArgumentException('invalid length for $subject when calling TemplateCreateEmbeddedDraftRequest., must be smaller than or equal to 200.'); } $this->container['subject'] = $subject; @@ -1110,10 +1097,10 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -1133,14 +1120,14 @@ public function getTitle() /** * Sets title * - * @param string|null $title The title you want to assign to the SignatureRequest. + * @param string|null $title the title you want to assign to the SignatureRequest * * @return self */ - public function setTitle($title) + public function setTitle(?string $title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + throw new InvalidArgumentException('non-nullable title cannot be null'); } $this->container['title'] = $title; @@ -1160,27 +1147,26 @@ public function getUsePreexistingFields() /** * Sets use_preexisting_fields * - * @param bool|null $use_preexisting_fields Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). + * @param bool|null $use_preexisting_fields enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`) * * @return self */ - public function setUsePreexistingFields($use_preexisting_fields) + public function setUsePreexistingFields(?bool $use_preexisting_fields) { if (is_null($use_preexisting_fields)) { - throw new \InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); + throw new InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); } $this->container['use_preexisting_fields'] = $use_preexisting_fields; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1189,11 +1175,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1204,10 +1190,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1220,11 +1204,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1232,12 +1214,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1266,5 +1248,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponse.php b/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponse.php index 7bdf706ac..ca85bf0ad 100644 --- a/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponse.php +++ b/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponse.php @@ -1,14 +1,11 @@ */ -class TemplateCreateEmbeddedDraftResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateCreateEmbeddedDraftResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateCreateEmbeddedDraftResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template' => '\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponseTemplate', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'template' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'template' => 'template', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'template' => 'setTemplate', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'template' => 'getTemplate', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateCreateEmbeddedDraftResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateCreateEmbeddedDraftResponse { /** @var TemplateCreateEmbeddedDraftResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateCreateEmbeddedDraftResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,7 +307,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets template * @@ -337,10 +324,10 @@ public function getTemplate() * * @return self */ - public function setTemplate($template) + public function setTemplate(TemplateCreateEmbeddedDraftResponseTemplate $template) { if (is_null($template)) { - throw new \InvalidArgumentException('non-nullable template cannot be null'); + throw new InvalidArgumentException('non-nullable template cannot be null'); } $this->container['template'] = $template; @@ -360,27 +347,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -389,11 +375,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -404,10 +390,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -420,11 +404,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -432,12 +414,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -466,5 +448,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponseTemplate.php b/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponseTemplate.php index 921ffe8fc..324766d2f 100644 --- a/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponseTemplate.php +++ b/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponseTemplate.php @@ -1,14 +1,11 @@ */ -class TemplateCreateEmbeddedDraftResponseTemplate implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateCreateEmbeddedDraftResponseTemplate implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateCreateEmbeddedDraftResponseTemplate'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template_id' => 'string', 'edit_url' => 'string', 'expires_at' => 'int', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template_id' => null, 'edit_url' => null, 'expires_at' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'template_id' => false, 'edit_url' => false, 'expires_at' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -121,8 +119,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -132,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -142,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -151,9 +147,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -162,9 +155,6 @@ 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 { @@ -181,7 +171,7 @@ public function isNullableSetToNull(string $property): bool 'template_id' => 'template_id', 'edit_url' => 'edit_url', 'expires_at' => 'expires_at', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool 'template_id' => 'setTemplateId', 'edit_url' => 'setEditUrl', 'expires_at' => 'setExpiresAt', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -205,7 +195,7 @@ public function isNullableSetToNull(string $property): bool 'template_id' => 'getTemplateId', 'edit_url' => 'getEditUrl', 'expires_at' => 'getExpiresAt', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -249,7 +239,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -261,7 +250,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -271,34 +260,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateCreateEmbeddedDraftResponseTemplate { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateCreateEmbeddedDraftResponseTemplate { /** @var TemplateCreateEmbeddedDraftResponseTemplate */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateCreateEmbeddedDraftResponseTemplate::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -315,9 +303,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -331,7 +317,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets template_id * @@ -345,14 +330,14 @@ public function getTemplateId() /** * Sets template_id * - * @param string|null $template_id The id of the Template. + * @param string|null $template_id the id of the Template * * @return self */ - public function setTemplateId($template_id) + public function setTemplateId(?string $template_id) { if (is_null($template_id)) { - throw new \InvalidArgumentException('non-nullable template_id cannot be null'); + throw new InvalidArgumentException('non-nullable template_id cannot be null'); } $this->container['template_id'] = $template_id; @@ -372,14 +357,14 @@ public function getEditUrl() /** * Sets edit_url * - * @param string|null $edit_url Link to edit the template. + * @param string|null $edit_url link to edit the template * * @return self */ - public function setEditUrl($edit_url) + public function setEditUrl(?string $edit_url) { if (is_null($edit_url)) { - throw new \InvalidArgumentException('non-nullable edit_url cannot be null'); + throw new InvalidArgumentException('non-nullable edit_url cannot be null'); } $this->container['edit_url'] = $edit_url; @@ -399,14 +384,14 @@ public function getExpiresAt() /** * Sets expires_at * - * @param int|null $expires_at When the link expires. + * @param int|null $expires_at when the link expires * * @return self */ - public function setExpiresAt($expires_at) + public function setExpiresAt(?int $expires_at) { if (is_null($expires_at)) { - throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + throw new InvalidArgumentException('non-nullable expires_at cannot be null'); } $this->container['expires_at'] = $expires_at; @@ -427,28 +412,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self * @deprecated */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -457,11 +441,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -472,10 +456,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -488,11 +470,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -500,12 +480,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -534,5 +514,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateCreateRequest.php b/sdks/php/src/Model/TemplateCreateRequest.php index 52142ce8a..ddeab0295 100644 --- a/sdks/php/src/Model/TemplateCreateRequest.php +++ b/sdks/php/src/Model/TemplateCreateRequest.php @@ -1,14 +1,11 @@ */ -class TemplateCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateCreateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'form_fields_per_document' => '\Dropbox\Sign\Model\SubFormFieldsPerDocumentBase[]', 'signer_roles' => '\Dropbox\Sign\Model\SubTemplateRole[]', @@ -76,16 +75,16 @@ class TemplateCreateRequest implements ModelInterface, ArrayAccess, \JsonSeriali 'subject' => 'string', 'test_mode' => 'bool', 'title' => 'string', - 'use_preexisting_fields' => 'bool' + 'use_preexisting_fields' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'form_fields_per_document' => null, 'signer_roles' => null, @@ -104,14 +103,14 @@ class TemplateCreateRequest implements ModelInterface, ArrayAccess, \JsonSeriali 'subject' => null, 'test_mode' => null, 'title' => null, - 'use_preexisting_fields' => null + 'use_preexisting_fields' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'form_fields_per_document' => false, 'signer_roles' => false, @@ -130,14 +129,14 @@ class TemplateCreateRequest implements ModelInterface, ArrayAccess, \JsonSeriali 'subject' => false, 'test_mode' => false, 'title' => false, - 'use_preexisting_fields' => false + 'use_preexisting_fields' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -162,8 +161,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -173,7 +170,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -183,7 +180,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -192,9 +189,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -203,9 +197,6 @@ 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 { @@ -236,7 +227,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'subject', 'test_mode' => 'test_mode', 'title' => 'title', - 'use_preexisting_fields' => 'use_preexisting_fields' + 'use_preexisting_fields' => 'use_preexisting_fields', ]; /** @@ -262,7 +253,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'setSubject', 'test_mode' => 'setTestMode', 'title' => 'setTitle', - 'use_preexisting_fields' => 'setUsePreexistingFields' + 'use_preexisting_fields' => 'setUsePreexistingFields', ]; /** @@ -288,7 +279,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'getSubject', 'test_mode' => 'getTestMode', 'title' => 'getTitle', - 'use_preexisting_fields' => 'getUsePreexistingFields' + 'use_preexisting_fields' => 'getUsePreexistingFields', ]; /** @@ -332,7 +323,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -344,7 +334,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -368,34 +358,33 @@ public function __construct(?array $data = null) $this->setIfExists('use_preexisting_fields', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateCreateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateCreateRequest { /** @var TemplateCreateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateCreateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -442,7 +431,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets form_fields_per_document * @@ -460,10 +448,10 @@ public function getFormFieldsPerDocument() * * @return self */ - public function setFormFieldsPerDocument($form_fields_per_document) + public function setFormFieldsPerDocument(array $form_fields_per_document) { if (is_null($form_fields_per_document)) { - throw new \InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); } $this->container['form_fields_per_document'] = $form_fields_per_document; @@ -483,14 +471,14 @@ public function getSignerRoles() /** * Sets signer_roles * - * @param SubTemplateRole[] $signer_roles An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. + * @param SubTemplateRole[] $signer_roles an array of the designated signer roles that must be specified when sending a SignatureRequest using this Template * * @return self */ - public function setSignerRoles($signer_roles) + public function setSignerRoles(array $signer_roles) { if (is_null($signer_roles)) { - throw new \InvalidArgumentException('non-nullable signer_roles cannot be null'); + throw new InvalidArgumentException('non-nullable signer_roles cannot be null'); } $this->container['signer_roles'] = $signer_roles; @@ -500,7 +488,7 @@ public function setSignerRoles($signer_roles) /** * Gets files * - * @return \SplFileObject[]|null + * @return SplFileObject[]|null */ public function getFiles() { @@ -510,14 +498,14 @@ public function getFiles() /** * Sets files * - * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles($files) + public function setFiles(?array $files) { if (is_null($files)) { - throw new \InvalidArgumentException('non-nullable files cannot be null'); + throw new InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -541,10 +529,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls($file_urls) + public function setFileUrls(?array $file_urls) { if (is_null($file_urls)) { - throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -568,10 +556,10 @@ public function getAllowReassign() * * @return self */ - public function setAllowReassign($allow_reassign) + public function setAllowReassign(?bool $allow_reassign) { if (is_null($allow_reassign)) { - throw new \InvalidArgumentException('non-nullable allow_reassign cannot be null'); + throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); } $this->container['allow_reassign'] = $allow_reassign; @@ -595,10 +583,10 @@ public function getAttachments() * * @return self */ - public function setAttachments($attachments) + public function setAttachments(?array $attachments) { if (is_null($attachments)) { - throw new \InvalidArgumentException('non-nullable attachments cannot be null'); + throw new InvalidArgumentException('non-nullable attachments cannot be null'); } $this->container['attachments'] = $attachments; @@ -622,10 +610,10 @@ public function getCcRoles() * * @return self */ - public function setCcRoles($cc_roles) + public function setCcRoles(?array $cc_roles) { if (is_null($cc_roles)) { - throw new \InvalidArgumentException('non-nullable cc_roles cannot be null'); + throw new InvalidArgumentException('non-nullable cc_roles cannot be null'); } $this->container['cc_roles'] = $cc_roles; @@ -649,10 +637,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(?string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -676,10 +664,10 @@ public function getFieldOptions() * * @return self */ - public function setFieldOptions($field_options) + public function setFieldOptions(?SubFieldOptions $field_options) { if (is_null($field_options)) { - throw new \InvalidArgumentException('non-nullable field_options cannot be null'); + throw new InvalidArgumentException('non-nullable field_options cannot be null'); } $this->container['field_options'] = $field_options; @@ -703,10 +691,10 @@ public function getFormFieldGroups() * * @return self */ - public function setFormFieldGroups($form_field_groups) + public function setFormFieldGroups(?array $form_field_groups) { if (is_null($form_field_groups)) { - throw new \InvalidArgumentException('non-nullable form_field_groups cannot be null'); + throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); } $this->container['form_field_groups'] = $form_field_groups; @@ -726,14 +714,14 @@ public function getFormFieldRules() /** * Sets form_field_rules * - * @param SubFormFieldRule[]|null $form_field_rules Conditional Logic rules for fields defined in `form_fields_per_document`. + * @param SubFormFieldRule[]|null $form_field_rules conditional Logic rules for fields defined in `form_fields_per_document` * * @return self */ - public function setFormFieldRules($form_field_rules) + public function setFormFieldRules(?array $form_field_rules) { if (is_null($form_field_rules)) { - throw new \InvalidArgumentException('non-nullable form_field_rules cannot be null'); + throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); } $this->container['form_field_rules'] = $form_field_rules; @@ -757,10 +745,10 @@ public function getMergeFields() * * @return self */ - public function setMergeFields($merge_fields) + public function setMergeFields(?array $merge_fields) { if (is_null($merge_fields)) { - throw new \InvalidArgumentException('non-nullable merge_fields cannot be null'); + throw new InvalidArgumentException('non-nullable merge_fields cannot be null'); } $this->container['merge_fields'] = $merge_fields; @@ -780,17 +768,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message The default template email message. + * @param string|null $message the default template email message * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + throw new InvalidArgumentException('non-nullable message cannot be null'); } - if ((mb_strlen($message) > 5000)) { - throw new \InvalidArgumentException('invalid length for $message when calling TemplateCreateRequest., must be smaller than or equal to 5000.'); + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling TemplateCreateRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -815,13 +803,12 @@ public function getMetadata() * * @return self */ - public function setMetadata($metadata) + public function setMetadata(?array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } - $this->container['metadata'] = $metadata; return $this; @@ -840,17 +827,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject The template title (alias). + * @param string|null $subject the template title (alias) * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { - throw new \InvalidArgumentException('non-nullable subject cannot be null'); + throw new InvalidArgumentException('non-nullable subject cannot be null'); } - if ((mb_strlen($subject) > 200)) { - throw new \InvalidArgumentException('invalid length for $subject when calling TemplateCreateRequest., must be smaller than or equal to 200.'); + if (mb_strlen($subject) > 200) { + throw new InvalidArgumentException('invalid length for $subject when calling TemplateCreateRequest., must be smaller than or equal to 200.'); } $this->container['subject'] = $subject; @@ -875,10 +862,10 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -898,14 +885,14 @@ public function getTitle() /** * Sets title * - * @param string|null $title The title you want to assign to the SignatureRequest. + * @param string|null $title the title you want to assign to the SignatureRequest * * @return self */ - public function setTitle($title) + public function setTitle(?string $title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + throw new InvalidArgumentException('non-nullable title cannot be null'); } $this->container['title'] = $title; @@ -925,27 +912,26 @@ public function getUsePreexistingFields() /** * Sets use_preexisting_fields * - * @param bool|null $use_preexisting_fields Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). + * @param bool|null $use_preexisting_fields enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`) * * @return self */ - public function setUsePreexistingFields($use_preexisting_fields) + public function setUsePreexistingFields(?bool $use_preexisting_fields) { if (is_null($use_preexisting_fields)) { - throw new \InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); + throw new InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); } $this->container['use_preexisting_fields'] = $use_preexisting_fields; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -954,11 +940,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -969,10 +955,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -985,11 +969,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -997,12 +979,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1031,5 +1013,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateCreateResponse.php b/sdks/php/src/Model/TemplateCreateResponse.php index 415e51eb0..3fe65f194 100644 --- a/sdks/php/src/Model/TemplateCreateResponse.php +++ b/sdks/php/src/Model/TemplateCreateResponse.php @@ -1,14 +1,11 @@ */ -class TemplateCreateResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateCreateResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateCreateResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template' => '\Dropbox\Sign\Model\TemplateCreateResponseTemplate', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'template' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'template' => 'template', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'template' => 'setTemplate', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'template' => 'getTemplate', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateCreateResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateCreateResponse { /** @var TemplateCreateResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateCreateResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,7 +307,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets template * @@ -337,10 +324,10 @@ public function getTemplate() * * @return self */ - public function setTemplate($template) + public function setTemplate(TemplateCreateResponseTemplate $template) { if (is_null($template)) { - throw new \InvalidArgumentException('non-nullable template cannot be null'); + throw new InvalidArgumentException('non-nullable template cannot be null'); } $this->container['template'] = $template; @@ -360,27 +347,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -389,11 +375,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -404,10 +390,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -420,11 +404,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -432,12 +414,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -466,5 +448,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateCreateResponseTemplate.php b/sdks/php/src/Model/TemplateCreateResponseTemplate.php index 542415f53..7baaf00cb 100644 --- a/sdks/php/src/Model/TemplateCreateResponseTemplate.php +++ b/sdks/php/src/Model/TemplateCreateResponseTemplate.php @@ -1,14 +1,11 @@ */ -class TemplateCreateResponseTemplate implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateCreateResponseTemplate implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateCreateResponseTemplate'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'template_id' => 'string' + 'template_id' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'template_id' => null + 'template_id' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'template_id' => false + 'template_id' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -112,8 +110,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -123,7 +119,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -133,7 +129,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -142,9 +138,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -153,9 +146,6 @@ 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 { @@ -169,7 +159,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'template_id' => 'template_id' + 'template_id' => 'template_id', ]; /** @@ -178,7 +168,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'template_id' => 'setTemplateId' + 'template_id' => 'setTemplateId', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'template_id' => 'getTemplateId' + 'template_id' => 'getTemplateId', ]; /** @@ -231,7 +221,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -243,41 +232,40 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { $this->setIfExists('template_id', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateCreateResponseTemplate { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateCreateResponseTemplate { /** @var TemplateCreateResponseTemplate */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateCreateResponseTemplate::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -294,9 +282,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -310,7 +296,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets template_id * @@ -324,27 +309,26 @@ public function getTemplateId() /** * Sets template_id * - * @param string|null $template_id The id of the Template. + * @param string|null $template_id the id of the Template * * @return self */ - public function setTemplateId($template_id) + public function setTemplateId(?string $template_id) { if (is_null($template_id)) { - throw new \InvalidArgumentException('non-nullable template_id cannot be null'); + throw new InvalidArgumentException('non-nullable template_id cannot be null'); } $this->container['template_id'] = $template_id; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -353,11 +337,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -368,10 +352,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -384,11 +366,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -396,12 +376,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -430,5 +410,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateEditResponse.php b/sdks/php/src/Model/TemplateEditResponse.php index 4874580eb..3374ff2c3 100644 --- a/sdks/php/src/Model/TemplateEditResponse.php +++ b/sdks/php/src/Model/TemplateEditResponse.php @@ -1,14 +1,11 @@ */ -class TemplateEditResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateEditResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateEditResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'template_id' => 'string' + 'template_id' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'template_id' => null + 'template_id' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'template_id' => false + 'template_id' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,8 +109,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -122,7 +118,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +128,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,9 +137,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -152,9 +145,6 @@ 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 { @@ -168,7 +158,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'template_id' => 'template_id' + 'template_id' => 'template_id', ]; /** @@ -177,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'template_id' => 'setTemplateId' + 'template_id' => 'setTemplateId', ]; /** @@ -186,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'template_id' => 'getTemplateId' + 'template_id' => 'getTemplateId', ]; /** @@ -230,7 +220,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -242,41 +231,40 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { $this->setIfExists('template_id', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateEditResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateEditResponse { /** @var TemplateEditResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateEditResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -312,7 +300,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets template_id * @@ -326,27 +313,26 @@ public function getTemplateId() /** * Sets template_id * - * @param string $template_id The id of the Template. + * @param string $template_id the id of the Template * * @return self */ - public function setTemplateId($template_id) + public function setTemplateId(string $template_id) { if (is_null($template_id)) { - throw new \InvalidArgumentException('non-nullable template_id cannot be null'); + throw new InvalidArgumentException('non-nullable template_id cannot be null'); } $this->container['template_id'] = $template_id; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -355,11 +341,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -370,10 +356,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -386,11 +370,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -398,12 +380,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -432,5 +414,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateGetResponse.php b/sdks/php/src/Model/TemplateGetResponse.php index 04c96d08e..321b66702 100644 --- a/sdks/php/src/Model/TemplateGetResponse.php +++ b/sdks/php/src/Model/TemplateGetResponse.php @@ -1,14 +1,11 @@ */ -class TemplateGetResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateGetResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateGetResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template' => '\Dropbox\Sign\Model\TemplateResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'template' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'template' => 'template', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'template' => 'setTemplate', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'template' => 'getTemplate', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateGetResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateGetResponse { /** @var TemplateGetResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateGetResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,7 +307,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets template * @@ -337,10 +324,10 @@ public function getTemplate() * * @return self */ - public function setTemplate($template) + public function setTemplate(TemplateResponse $template) { if (is_null($template)) { - throw new \InvalidArgumentException('non-nullable template cannot be null'); + throw new InvalidArgumentException('non-nullable template cannot be null'); } $this->container['template'] = $template; @@ -360,27 +347,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -389,11 +375,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -404,10 +390,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -420,11 +404,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -432,12 +414,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -466,5 +448,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateListResponse.php b/sdks/php/src/Model/TemplateListResponse.php index 4c64ea3b2..df656f237 100644 --- a/sdks/php/src/Model/TemplateListResponse.php +++ b/sdks/php/src/Model/TemplateListResponse.php @@ -1,14 +1,11 @@ */ -class TemplateListResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateListResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateListResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'templates' => '\Dropbox\Sign\Model\TemplateResponse[]', 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'templates' => null, 'list_info' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'templates' => false, 'list_info' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -117,8 +115,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -128,7 +124,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -138,7 +134,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -147,9 +143,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -158,9 +151,6 @@ 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 { @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'templates' => 'templates', 'list_info' => 'list_info', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'templates' => 'setTemplates', 'list_info' => 'setListInfo', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -198,7 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'templates' => 'getTemplates', 'list_info' => 'getListInfo', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -242,7 +232,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -254,7 +243,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -263,34 +252,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateListResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateListResponse { /** @var TemplateListResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateListResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -329,7 +317,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets templates * @@ -343,14 +330,14 @@ public function getTemplates() /** * Sets templates * - * @param TemplateResponse[] $templates List of templates that the API caller has access to. + * @param TemplateResponse[] $templates list of templates that the API caller has access to * * @return self */ - public function setTemplates($templates) + public function setTemplates(array $templates) { if (is_null($templates)) { - throw new \InvalidArgumentException('non-nullable templates cannot be null'); + throw new InvalidArgumentException('non-nullable templates cannot be null'); } $this->container['templates'] = $templates; @@ -374,10 +361,10 @@ public function getListInfo() * * @return self */ - public function setListInfo($list_info) + public function setListInfo(ListInfoResponse $list_info) { if (is_null($list_info)) { - throw new \InvalidArgumentException('non-nullable list_info cannot be null'); + throw new InvalidArgumentException('non-nullable list_info cannot be null'); } $this->container['list_info'] = $list_info; @@ -397,27 +384,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -426,11 +412,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -441,10 +427,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -457,11 +441,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -469,12 +451,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -503,5 +485,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateRemoveUserRequest.php b/sdks/php/src/Model/TemplateRemoveUserRequest.php index 116cf8d5f..29407ca6d 100644 --- a/sdks/php/src/Model/TemplateRemoveUserRequest.php +++ b/sdks/php/src/Model/TemplateRemoveUserRequest.php @@ -1,14 +1,11 @@ */ -class TemplateRemoveUserRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateRemoveUserRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateRemoveUserRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account_id' => 'string', - 'email_address' => 'string' + 'email_address' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account_id' => null, - 'email_address' => 'email' + 'email_address' => 'email', ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'account_id' => false, - 'email_address' => false + 'email_address' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'account_id' => 'account_id', - 'email_address' => 'email_address' + 'email_address' => 'email_address', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'account_id' => 'setAccountId', - 'email_address' => 'setEmailAddress' + 'email_address' => 'setEmailAddress', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'account_id' => 'getAccountId', - 'email_address' => 'getEmailAddress' + 'email_address' => 'getEmailAddress', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('email_address', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateRemoveUserRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateRemoveUserRequest { /** @var TemplateRemoveUserRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateRemoveUserRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -300,9 +288,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -316,7 +302,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets account_id * @@ -334,10 +319,10 @@ public function getAccountId() * * @return self */ - public function setAccountId($account_id) + public function setAccountId(?string $account_id) { if (is_null($account_id)) { - throw new \InvalidArgumentException('non-nullable account_id cannot be null'); + throw new InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -361,23 +346,22 @@ public function getEmailAddress() * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(?string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -386,11 +370,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -401,10 +385,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -417,11 +399,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -429,12 +409,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -463,5 +443,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponse.php b/sdks/php/src/Model/TemplateResponse.php index e6382e300..69492ed9d 100644 --- a/sdks/php/src/Model/TemplateResponse.php +++ b/sdks/php/src/Model/TemplateResponse.php @@ -1,14 +1,11 @@ */ -class TemplateResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template_id' => 'string', 'title' => 'string', @@ -75,16 +73,16 @@ class TemplateResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'custom_fields' => '\Dropbox\Sign\Model\TemplateResponseDocumentCustomFieldBase[]', 'named_form_fields' => '\Dropbox\Sign\Model\TemplateResponseDocumentFormFieldBase[]', 'accounts' => '\Dropbox\Sign\Model\TemplateResponseAccount[]', - 'attachments' => '\Dropbox\Sign\Model\SignatureRequestResponseAttachment[]' + 'attachments' => '\Dropbox\Sign\Model\SignatureRequestResponseAttachment[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template_id' => null, 'title' => null, @@ -101,14 +99,14 @@ class TemplateResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'custom_fields' => null, 'named_form_fields' => null, 'accounts' => null, - 'attachments' => null + 'attachments' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'template_id' => false, 'title' => false, @@ -125,14 +123,14 @@ class TemplateResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'custom_fields' => true, 'named_form_fields' => true, 'accounts' => false, - 'attachments' => false + 'attachments' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -157,8 +155,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -168,7 +164,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -178,7 +174,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -187,9 +183,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -198,9 +191,6 @@ 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 { @@ -229,7 +219,7 @@ public function isNullableSetToNull(string $property): bool 'custom_fields' => 'custom_fields', 'named_form_fields' => 'named_form_fields', 'accounts' => 'accounts', - 'attachments' => 'attachments' + 'attachments' => 'attachments', ]; /** @@ -253,7 +243,7 @@ public function isNullableSetToNull(string $property): bool 'custom_fields' => 'setCustomFields', 'named_form_fields' => 'setNamedFormFields', 'accounts' => 'setAccounts', - 'attachments' => 'setAttachments' + 'attachments' => 'setAttachments', ]; /** @@ -277,7 +267,7 @@ public function isNullableSetToNull(string $property): bool 'custom_fields' => 'getCustomFields', 'named_form_fields' => 'getNamedFormFields', 'accounts' => 'getAccounts', - 'attachments' => 'getAttachments' + 'attachments' => 'getAttachments', ]; /** @@ -321,7 +311,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -333,7 +322,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -355,34 +344,33 @@ public function __construct(?array $data = null) $this->setIfExists('attachments', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponse { /** @var TemplateResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -399,9 +387,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -415,7 +401,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets template_id * @@ -429,14 +414,14 @@ public function getTemplateId() /** * Sets template_id * - * @param string|null $template_id The id of the Template. + * @param string|null $template_id the id of the Template * * @return self */ - public function setTemplateId($template_id) + public function setTemplateId(?string $template_id) { if (is_null($template_id)) { - throw new \InvalidArgumentException('non-nullable template_id cannot be null'); + throw new InvalidArgumentException('non-nullable template_id cannot be null'); } $this->container['template_id'] = $template_id; @@ -460,10 +445,10 @@ public function getTitle() * * @return self */ - public function setTitle($title) + public function setTitle(?string $title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + throw new InvalidArgumentException('non-nullable title cannot be null'); } $this->container['title'] = $title; @@ -487,10 +472,10 @@ public function getMessage() * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + throw new InvalidArgumentException('non-nullable message cannot be null'); } $this->container['message'] = $message; @@ -510,14 +495,14 @@ public function getUpdatedAt() /** * Sets updated_at * - * @param int|null $updated_at Time the template was last updated. + * @param int|null $updated_at time the template was last updated * * @return self */ - public function setUpdatedAt($updated_at) + public function setUpdatedAt(?int $updated_at) { if (is_null($updated_at)) { - throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + throw new InvalidArgumentException('non-nullable updated_at cannot be null'); } $this->container['updated_at'] = $updated_at; @@ -541,13 +526,13 @@ public function getIsEmbedded() * * @return self */ - public function setIsEmbedded($is_embedded) + public function setIsEmbedded(?bool $is_embedded) { if (is_null($is_embedded)) { array_push($this->openAPINullablesSetToNull, 'is_embedded'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('is_embedded', $nullablesSetToNull, true); + $index = array_search('is_embedded', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -571,14 +556,14 @@ public function getIsCreator() /** * Sets is_creator * - * @param bool|null $is_creator `true` if you are the owner of this template, `false` if it's been shared with you by a team member. + * @param bool|null $is_creator `true` if you are the owner of this template, `false` if it's been shared with you by a team member * * @return self */ - public function setIsCreator($is_creator) + public function setIsCreator(?bool $is_creator) { if (is_null($is_creator)) { - throw new \InvalidArgumentException('non-nullable is_creator cannot be null'); + throw new InvalidArgumentException('non-nullable is_creator cannot be null'); } $this->container['is_creator'] = $is_creator; @@ -598,14 +583,14 @@ public function getCanEdit() /** * Sets can_edit * - * @param bool|null $can_edit Indicates whether edit rights have been granted to you by the owner (always `true` if that's you). + * @param bool|null $can_edit indicates whether edit rights have been granted to you by the owner (always `true` if that's you) * * @return self */ - public function setCanEdit($can_edit) + public function setCanEdit(?bool $can_edit) { if (is_null($can_edit)) { - throw new \InvalidArgumentException('non-nullable can_edit cannot be null'); + throw new InvalidArgumentException('non-nullable can_edit cannot be null'); } $this->container['can_edit'] = $can_edit; @@ -629,10 +614,10 @@ public function getIsLocked() * * @return self */ - public function setIsLocked($is_locked) + public function setIsLocked(?bool $is_locked) { if (is_null($is_locked)) { - throw new \InvalidArgumentException('non-nullable is_locked cannot be null'); + throw new InvalidArgumentException('non-nullable is_locked cannot be null'); } $this->container['is_locked'] = $is_locked; @@ -652,14 +637,14 @@ public function getMetadata() /** * Sets metadata * - * @param array|null $metadata The metadata attached to the template. + * @param array|null $metadata the metadata attached to the template * * @return self */ - public function setMetadata($metadata) + public function setMetadata(?array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } $this->container['metadata'] = $metadata; @@ -679,14 +664,14 @@ public function getSignerRoles() /** * Sets signer_roles * - * @param TemplateResponseSignerRole[]|null $signer_roles An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. + * @param TemplateResponseSignerRole[]|null $signer_roles an array of the designated signer roles that must be specified when sending a SignatureRequest using this Template * * @return self */ - public function setSignerRoles($signer_roles) + public function setSignerRoles(?array $signer_roles) { if (is_null($signer_roles)) { - throw new \InvalidArgumentException('non-nullable signer_roles cannot be null'); + throw new InvalidArgumentException('non-nullable signer_roles cannot be null'); } $this->container['signer_roles'] = $signer_roles; @@ -706,14 +691,14 @@ public function getCcRoles() /** * Sets cc_roles * - * @param TemplateResponseCCRole[]|null $cc_roles An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. + * @param TemplateResponseCCRole[]|null $cc_roles an array of the designated CC roles that must be specified when sending a SignatureRequest using this Template * * @return self */ - public function setCcRoles($cc_roles) + public function setCcRoles(?array $cc_roles) { if (is_null($cc_roles)) { - throw new \InvalidArgumentException('non-nullable cc_roles cannot be null'); + throw new InvalidArgumentException('non-nullable cc_roles cannot be null'); } $this->container['cc_roles'] = $cc_roles; @@ -737,10 +722,10 @@ public function getDocuments() * * @return self */ - public function setDocuments($documents) + public function setDocuments(?array $documents) { if (is_null($documents)) { - throw new \InvalidArgumentException('non-nullable documents cannot be null'); + throw new InvalidArgumentException('non-nullable documents cannot be null'); } $this->container['documents'] = $documents; @@ -766,13 +751,13 @@ public function getCustomFields() * @return self * @deprecated */ - public function setCustomFields($custom_fields) + public function setCustomFields(?array $custom_fields) { if (is_null($custom_fields)) { array_push($this->openAPINullablesSetToNull, 'custom_fields'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('custom_fields', $nullablesSetToNull, true); + $index = array_search('custom_fields', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -802,13 +787,13 @@ public function getNamedFormFields() * @return self * @deprecated */ - public function setNamedFormFields($named_form_fields) + public function setNamedFormFields(?array $named_form_fields) { if (is_null($named_form_fields)) { array_push($this->openAPINullablesSetToNull, 'named_form_fields'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('named_form_fields', $nullablesSetToNull, true); + $index = array_search('named_form_fields', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -832,14 +817,14 @@ public function getAccounts() /** * Sets accounts * - * @param TemplateResponseAccount[]|null $accounts An array of the Accounts that can use this Template. + * @param TemplateResponseAccount[]|null $accounts an array of the Accounts that can use this Template * * @return self */ - public function setAccounts($accounts) + public function setAccounts(?array $accounts) { if (is_null($accounts)) { - throw new \InvalidArgumentException('non-nullable accounts cannot be null'); + throw new InvalidArgumentException('non-nullable accounts cannot be null'); } $this->container['accounts'] = $accounts; @@ -859,27 +844,26 @@ public function getAttachments() /** * Sets attachments * - * @param SignatureRequestResponseAttachment[]|null $attachments Signer attachments. + * @param SignatureRequestResponseAttachment[]|null $attachments signer attachments * * @return self */ - public function setAttachments($attachments) + public function setAttachments(?array $attachments) { if (is_null($attachments)) { - throw new \InvalidArgumentException('non-nullable attachments cannot be null'); + throw new InvalidArgumentException('non-nullable attachments cannot be null'); } $this->container['attachments'] = $attachments; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -888,11 +872,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -903,10 +887,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -919,11 +901,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -931,12 +911,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -965,5 +945,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseAccount.php b/sdks/php/src/Model/TemplateResponseAccount.php index c3061cce1..c2cc5fb9c 100644 --- a/sdks/php/src/Model/TemplateResponseAccount.php +++ b/sdks/php/src/Model/TemplateResponseAccount.php @@ -1,14 +1,11 @@ */ -class TemplateResponseAccount implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateResponseAccount implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseAccount'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'account_id' => 'string', 'email_address' => 'string', 'is_locked' => 'bool', 'is_paid_hs' => 'bool', 'is_paid_hf' => 'bool', - 'quotas' => '\Dropbox\Sign\Model\TemplateResponseAccountQuota' + 'quotas' => '\Dropbox\Sign\Model\TemplateResponseAccountQuota', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'account_id' => null, 'email_address' => null, 'is_locked' => null, 'is_paid_hs' => null, 'is_paid_hf' => null, - 'quotas' => null + 'quotas' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'account_id' => false, 'email_address' => false, 'is_locked' => false, 'is_paid_hs' => false, 'is_paid_hf' => false, - 'quotas' => false + 'quotas' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -126,8 +124,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -137,7 +133,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -147,7 +143,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -156,9 +152,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -167,9 +160,6 @@ 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 { @@ -188,7 +178,7 @@ public function isNullableSetToNull(string $property): bool 'is_locked' => 'is_locked', 'is_paid_hs' => 'is_paid_hs', 'is_paid_hf' => 'is_paid_hf', - 'quotas' => 'quotas' + 'quotas' => 'quotas', ]; /** @@ -202,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'is_locked' => 'setIsLocked', 'is_paid_hs' => 'setIsPaidHs', 'is_paid_hf' => 'setIsPaidHf', - 'quotas' => 'setQuotas' + 'quotas' => 'setQuotas', ]; /** @@ -216,7 +206,7 @@ public function isNullableSetToNull(string $property): bool 'is_locked' => 'getIsLocked', 'is_paid_hs' => 'getIsPaidHs', 'is_paid_hf' => 'getIsPaidHf', - 'quotas' => 'getQuotas' + 'quotas' => 'getQuotas', ]; /** @@ -260,7 +250,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -272,7 +261,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -284,34 +273,33 @@ public function __construct(?array $data = null) $this->setIfExists('quotas', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseAccount { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseAccount { /** @var TemplateResponseAccount */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseAccount::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -328,9 +316,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -344,7 +330,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets account_id * @@ -358,14 +343,14 @@ public function getAccountId() /** * Sets account_id * - * @param string|null $account_id The id of the Account. + * @param string|null $account_id the id of the Account * * @return self */ - public function setAccountId($account_id) + public function setAccountId(?string $account_id) { if (is_null($account_id)) { - throw new \InvalidArgumentException('non-nullable account_id cannot be null'); + throw new InvalidArgumentException('non-nullable account_id cannot be null'); } $this->container['account_id'] = $account_id; @@ -385,14 +370,14 @@ public function getEmailAddress() /** * Sets email_address * - * @param string|null $email_address The email address associated with the Account. + * @param string|null $email_address the email address associated with the Account * * @return self */ - public function setEmailAddress($email_address) + public function setEmailAddress(?string $email_address) { if (is_null($email_address)) { - throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + throw new InvalidArgumentException('non-nullable email_address cannot be null'); } $this->container['email_address'] = $email_address; @@ -412,14 +397,14 @@ public function getIsLocked() /** * Sets is_locked * - * @param bool|null $is_locked Returns `true` if the user has been locked out of their account by a team admin. + * @param bool|null $is_locked returns `true` if the user has been locked out of their account by a team admin * * @return self */ - public function setIsLocked($is_locked) + public function setIsLocked(?bool $is_locked) { if (is_null($is_locked)) { - throw new \InvalidArgumentException('non-nullable is_locked cannot be null'); + throw new InvalidArgumentException('non-nullable is_locked cannot be null'); } $this->container['is_locked'] = $is_locked; @@ -439,14 +424,14 @@ public function getIsPaidHs() /** * Sets is_paid_hs * - * @param bool|null $is_paid_hs Returns `true` if the user has a paid Dropbox Sign account. + * @param bool|null $is_paid_hs returns `true` if the user has a paid Dropbox Sign account * * @return self */ - public function setIsPaidHs($is_paid_hs) + public function setIsPaidHs(?bool $is_paid_hs) { if (is_null($is_paid_hs)) { - throw new \InvalidArgumentException('non-nullable is_paid_hs cannot be null'); + throw new InvalidArgumentException('non-nullable is_paid_hs cannot be null'); } $this->container['is_paid_hs'] = $is_paid_hs; @@ -466,14 +451,14 @@ public function getIsPaidHf() /** * Sets is_paid_hf * - * @param bool|null $is_paid_hf Returns `true` if the user has a paid HelloFax account. + * @param bool|null $is_paid_hf returns `true` if the user has a paid HelloFax account * * @return self */ - public function setIsPaidHf($is_paid_hf) + public function setIsPaidHf(?bool $is_paid_hf) { if (is_null($is_paid_hf)) { - throw new \InvalidArgumentException('non-nullable is_paid_hf cannot be null'); + throw new InvalidArgumentException('non-nullable is_paid_hf cannot be null'); } $this->container['is_paid_hf'] = $is_paid_hf; @@ -497,23 +482,22 @@ public function getQuotas() * * @return self */ - public function setQuotas($quotas) + public function setQuotas(?TemplateResponseAccountQuota $quotas) { if (is_null($quotas)) { - throw new \InvalidArgumentException('non-nullable quotas cannot be null'); + throw new InvalidArgumentException('non-nullable quotas cannot be null'); } $this->container['quotas'] = $quotas; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -522,11 +506,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -537,10 +521,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -553,11 +535,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -565,12 +545,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -599,5 +579,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseAccountQuota.php b/sdks/php/src/Model/TemplateResponseAccountQuota.php index 291aba3c6..f88bd937c 100644 --- a/sdks/php/src/Model/TemplateResponseAccountQuota.php +++ b/sdks/php/src/Model/TemplateResponseAccountQuota.php @@ -1,14 +1,11 @@ */ -class TemplateResponseAccountQuota implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateResponseAccountQuota implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseAccountQuota'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'templates_left' => 'int', 'api_signature_requests_left' => 'int', 'documents_left' => 'int', - 'sms_verifications_left' => 'int' + 'sms_verifications_left' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'templates_left' => null, 'api_signature_requests_left' => null, 'documents_left' => null, - 'sms_verifications_left' => null + 'sms_verifications_left' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'templates_left' => false, 'api_signature_requests_left' => false, 'documents_left' => false, - 'sms_verifications_left' => false + 'sms_verifications_left' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -121,8 +119,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -132,7 +128,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -142,7 +138,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -151,9 +147,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -162,9 +155,6 @@ 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 { @@ -181,7 +171,7 @@ public function isNullableSetToNull(string $property): bool 'templates_left' => 'templates_left', 'api_signature_requests_left' => 'api_signature_requests_left', 'documents_left' => 'documents_left', - 'sms_verifications_left' => 'sms_verifications_left' + 'sms_verifications_left' => 'sms_verifications_left', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool 'templates_left' => 'setTemplatesLeft', 'api_signature_requests_left' => 'setApiSignatureRequestsLeft', 'documents_left' => 'setDocumentsLeft', - 'sms_verifications_left' => 'setSmsVerificationsLeft' + 'sms_verifications_left' => 'setSmsVerificationsLeft', ]; /** @@ -205,7 +195,7 @@ public function isNullableSetToNull(string $property): bool 'templates_left' => 'getTemplatesLeft', 'api_signature_requests_left' => 'getApiSignatureRequestsLeft', 'documents_left' => 'getDocumentsLeft', - 'sms_verifications_left' => 'getSmsVerificationsLeft' + 'sms_verifications_left' => 'getSmsVerificationsLeft', ]; /** @@ -249,7 +239,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -261,7 +250,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -271,34 +260,33 @@ public function __construct(?array $data = null) $this->setIfExists('sms_verifications_left', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseAccountQuota { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseAccountQuota { /** @var TemplateResponseAccountQuota */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseAccountQuota::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -315,9 +303,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -331,7 +317,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets templates_left * @@ -345,14 +330,14 @@ public function getTemplatesLeft() /** * Sets templates_left * - * @param int|null $templates_left API templates remaining. + * @param int|null $templates_left API templates remaining * * @return self */ - public function setTemplatesLeft($templates_left) + public function setTemplatesLeft(?int $templates_left) { if (is_null($templates_left)) { - throw new \InvalidArgumentException('non-nullable templates_left cannot be null'); + throw new InvalidArgumentException('non-nullable templates_left cannot be null'); } $this->container['templates_left'] = $templates_left; @@ -372,14 +357,14 @@ public function getApiSignatureRequestsLeft() /** * Sets api_signature_requests_left * - * @param int|null $api_signature_requests_left API signature requests remaining. + * @param int|null $api_signature_requests_left API signature requests remaining * * @return self */ - public function setApiSignatureRequestsLeft($api_signature_requests_left) + public function setApiSignatureRequestsLeft(?int $api_signature_requests_left) { if (is_null($api_signature_requests_left)) { - throw new \InvalidArgumentException('non-nullable api_signature_requests_left cannot be null'); + throw new InvalidArgumentException('non-nullable api_signature_requests_left cannot be null'); } $this->container['api_signature_requests_left'] = $api_signature_requests_left; @@ -399,14 +384,14 @@ public function getDocumentsLeft() /** * Sets documents_left * - * @param int|null $documents_left Signature requests remaining. + * @param int|null $documents_left signature requests remaining * * @return self */ - public function setDocumentsLeft($documents_left) + public function setDocumentsLeft(?int $documents_left) { if (is_null($documents_left)) { - throw new \InvalidArgumentException('non-nullable documents_left cannot be null'); + throw new InvalidArgumentException('non-nullable documents_left cannot be null'); } $this->container['documents_left'] = $documents_left; @@ -426,27 +411,26 @@ public function getSmsVerificationsLeft() /** * Sets sms_verifications_left * - * @param int|null $sms_verifications_left SMS verifications remaining. + * @param int|null $sms_verifications_left SMS verifications remaining * * @return self */ - public function setSmsVerificationsLeft($sms_verifications_left) + public function setSmsVerificationsLeft(?int $sms_verifications_left) { if (is_null($sms_verifications_left)) { - throw new \InvalidArgumentException('non-nullable sms_verifications_left cannot be null'); + throw new InvalidArgumentException('non-nullable sms_verifications_left cannot be null'); } $this->container['sms_verifications_left'] = $sms_verifications_left; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -455,11 +439,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -470,10 +454,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -486,11 +468,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -498,12 +478,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -532,5 +512,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseCCRole.php b/sdks/php/src/Model/TemplateResponseCCRole.php index d1813c4dc..a9db0181e 100644 --- a/sdks/php/src/Model/TemplateResponseCCRole.php +++ b/sdks/php/src/Model/TemplateResponseCCRole.php @@ -1,14 +1,11 @@ */ -class TemplateResponseCCRole implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateResponseCCRole implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseCCRole'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'name' => 'string' + 'name' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'name' => null + 'name' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'name' => false + 'name' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,8 +109,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -122,7 +118,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +128,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,9 +137,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -152,9 +145,6 @@ 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 { @@ -168,7 +158,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'name' => 'name' + 'name' => 'name', ]; /** @@ -177,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'name' => 'setName' + 'name' => 'setName', ]; /** @@ -186,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'name' => 'getName' + 'name' => 'getName', ]; /** @@ -230,7 +220,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -242,41 +231,40 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseCCRole { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseCCRole { /** @var TemplateResponseCCRole */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseCCRole::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -293,9 +281,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -309,7 +295,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets name * @@ -323,27 +308,26 @@ public function getName() /** * Sets name * - * @param string|null $name The name of the Role. + * @param string|null $name the name of the Role * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -352,11 +336,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -367,10 +351,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -383,11 +365,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -395,12 +375,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -429,5 +409,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocument.php b/sdks/php/src/Model/TemplateResponseDocument.php index 32b46391d..c2f75fcf9 100644 --- a/sdks/php/src/Model/TemplateResponseDocument.php +++ b/sdks/php/src/Model/TemplateResponseDocument.php @@ -1,14 +1,11 @@ */ -class TemplateResponseDocument implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateResponseDocument implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocument'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', 'index' => 'int', 'field_groups' => '\Dropbox\Sign\Model\TemplateResponseDocumentFieldGroup[]', 'form_fields' => '\Dropbox\Sign\Model\TemplateResponseDocumentFormFieldBase[]', 'custom_fields' => '\Dropbox\Sign\Model\TemplateResponseDocumentCustomFieldBase[]', - 'static_fields' => '\Dropbox\Sign\Model\TemplateResponseDocumentStaticFieldBase[]' + 'static_fields' => '\Dropbox\Sign\Model\TemplateResponseDocumentStaticFieldBase[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, 'index' => null, 'field_groups' => null, 'form_fields' => null, 'custom_fields' => null, - 'static_fields' => null + 'static_fields' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'name' => false, 'index' => false, 'field_groups' => false, 'form_fields' => false, 'custom_fields' => false, - 'static_fields' => false + 'static_fields' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -126,8 +124,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -137,7 +133,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -147,7 +143,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -156,9 +152,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -167,9 +160,6 @@ 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 { @@ -188,7 +178,7 @@ public function isNullableSetToNull(string $property): bool 'field_groups' => 'field_groups', 'form_fields' => 'form_fields', 'custom_fields' => 'custom_fields', - 'static_fields' => 'static_fields' + 'static_fields' => 'static_fields', ]; /** @@ -202,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'field_groups' => 'setFieldGroups', 'form_fields' => 'setFormFields', 'custom_fields' => 'setCustomFields', - 'static_fields' => 'setStaticFields' + 'static_fields' => 'setStaticFields', ]; /** @@ -216,7 +206,7 @@ public function isNullableSetToNull(string $property): bool 'field_groups' => 'getFieldGroups', 'form_fields' => 'getFormFields', 'custom_fields' => 'getCustomFields', - 'static_fields' => 'getStaticFields' + 'static_fields' => 'getStaticFields', ]; /** @@ -260,7 +250,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -272,7 +261,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -284,34 +273,33 @@ public function __construct(?array $data = null) $this->setIfExists('static_fields', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocument { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocument { /** @var TemplateResponseDocument */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocument::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -328,9 +316,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -344,7 +330,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets name * @@ -358,14 +343,14 @@ public function getName() /** * Sets name * - * @param string|null $name Name of the associated file. + * @param string|null $name name of the associated file * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -385,14 +370,14 @@ public function getIndex() /** * Sets index * - * @param int|null $index Document ordering, the lowest index is displayed first and the highest last (0-based indexing). + * @param int|null $index document ordering, the lowest index is displayed first and the highest last (0-based indexing) * * @return self */ - public function setIndex($index) + public function setIndex(?int $index) { if (is_null($index)) { - throw new \InvalidArgumentException('non-nullable index cannot be null'); + throw new InvalidArgumentException('non-nullable index cannot be null'); } $this->container['index'] = $index; @@ -412,14 +397,14 @@ public function getFieldGroups() /** * Sets field_groups * - * @param TemplateResponseDocumentFieldGroup[]|null $field_groups An array of Form Field Group objects. + * @param TemplateResponseDocumentFieldGroup[]|null $field_groups an array of Form Field Group objects * * @return self */ - public function setFieldGroups($field_groups) + public function setFieldGroups(?array $field_groups) { if (is_null($field_groups)) { - throw new \InvalidArgumentException('non-nullable field_groups cannot be null'); + throw new InvalidArgumentException('non-nullable field_groups cannot be null'); } $this->container['field_groups'] = $field_groups; @@ -439,14 +424,14 @@ public function getFormFields() /** * Sets form_fields * - * @param TemplateResponseDocumentFormFieldBase[]|null $form_fields An array of Form Field objects containing the name and type of each named field. + * @param TemplateResponseDocumentFormFieldBase[]|null $form_fields an array of Form Field objects containing the name and type of each named field * * @return self */ - public function setFormFields($form_fields) + public function setFormFields(?array $form_fields) { if (is_null($form_fields)) { - throw new \InvalidArgumentException('non-nullable form_fields cannot be null'); + throw new InvalidArgumentException('non-nullable form_fields cannot be null'); } $this->container['form_fields'] = $form_fields; @@ -466,14 +451,14 @@ public function getCustomFields() /** * Sets custom_fields * - * @param TemplateResponseDocumentCustomFieldBase[]|null $custom_fields An array of Form Field objects containing the name and type of each named field. + * @param TemplateResponseDocumentCustomFieldBase[]|null $custom_fields an array of Form Field objects containing the name and type of each named field * * @return self */ - public function setCustomFields($custom_fields) + public function setCustomFields(?array $custom_fields) { if (is_null($custom_fields)) { - throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -497,23 +482,22 @@ public function getStaticFields() * * @return self */ - public function setStaticFields($static_fields) + public function setStaticFields(?array $static_fields) { if (is_null($static_fields)) { - throw new \InvalidArgumentException('non-nullable static_fields cannot be null'); + throw new InvalidArgumentException('non-nullable static_fields cannot be null'); } $this->container['static_fields'] = $static_fields; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -522,11 +506,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -537,10 +521,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -553,11 +535,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -565,12 +545,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -599,5 +579,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentCustomFieldBase.php b/sdks/php/src/Model/TemplateResponseDocumentCustomFieldBase.php index 06772c49f..30dcb7f43 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentCustomFieldBase.php +++ b/sdks/php/src/Model/TemplateResponseDocumentCustomFieldBase.php @@ -1,14 +1,11 @@ */ -class TemplateResponseDocumentCustomFieldBase implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateResponseDocumentCustomFieldBase implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = 'type'; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentCustomFieldBase'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'api_id' => 'string', @@ -69,16 +67,16 @@ class TemplateResponseDocumentCustomFieldBase implements ModelInterface, ArrayAc 'width' => 'int', 'height' => 'int', 'required' => 'bool', - 'group' => 'string' + 'group' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'api_id' => null, @@ -89,14 +87,14 @@ class TemplateResponseDocumentCustomFieldBase implements ModelInterface, ArrayAc 'width' => null, 'height' => null, 'required' => null, - 'group' => null + 'group' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, 'api_id' => false, @@ -107,14 +105,14 @@ class TemplateResponseDocumentCustomFieldBase implements ModelInterface, ArrayAc 'width' => false, 'height' => false, 'required' => false, - 'group' => true + 'group' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -139,8 +137,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -150,7 +146,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -160,7 +156,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -169,9 +165,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -180,9 +173,6 @@ 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 { @@ -205,7 +195,7 @@ public function isNullableSetToNull(string $property): bool 'width' => 'width', 'height' => 'height', 'required' => 'required', - 'group' => 'group' + 'group' => 'group', ]; /** @@ -223,7 +213,7 @@ public function isNullableSetToNull(string $property): bool 'width' => 'setWidth', 'height' => 'setHeight', 'required' => 'setRequired', - 'group' => 'setGroup' + 'group' => 'setGroup', ]; /** @@ -241,7 +231,7 @@ public function isNullableSetToNull(string $property): bool 'width' => 'getWidth', 'height' => 'getHeight', 'required' => 'getRequired', - 'group' => 'getGroup' + 'group' => 'getGroup', ]; /** @@ -285,7 +275,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -297,7 +286,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -316,7 +305,6 @@ public function __construct(?array $data = null) $this->container['type'] = static::$openAPIModelName; } - public static function discriminatorClassName(array $data): ?string { if (!array_key_exists('type', $data)) { @@ -334,14 +322,12 @@ public static function discriminatorClassName(array $data): ?string } /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -377,7 +363,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -395,10 +380,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -418,14 +403,14 @@ public function getApiId() /** * Sets api_id * - * @param string|null $api_id The unique ID for this field. + * @param string|null $api_id the unique ID for this field * * @return self */ - public function setApiId($api_id) + public function setApiId(?string $api_id) { if (is_null($api_id)) { - throw new \InvalidArgumentException('non-nullable api_id cannot be null'); + throw new InvalidArgumentException('non-nullable api_id cannot be null'); } $this->container['api_id'] = $api_id; @@ -445,14 +430,14 @@ public function getName() /** * Sets name * - * @param string|null $name The name of the Custom Field. + * @param string|null $name the name of the Custom Field * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -476,13 +461,13 @@ public function getSigner() * * @return self */ - public function setSigner($signer) + public function setSigner(?string $signer) { if (is_null($signer)) { array_push($this->openAPINullablesSetToNull, 'signer'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signer', $nullablesSetToNull, true); + $index = array_search('signer', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -506,14 +491,14 @@ public function getX() /** * Sets x * - * @param int|null $x The horizontal offset in pixels for this form field. + * @param int|null $x the horizontal offset in pixels for this form field * * @return self */ - public function setX($x) + public function setX(?int $x) { if (is_null($x)) { - throw new \InvalidArgumentException('non-nullable x cannot be null'); + throw new InvalidArgumentException('non-nullable x cannot be null'); } $this->container['x'] = $x; @@ -533,14 +518,14 @@ public function getY() /** * Sets y * - * @param int|null $y The vertical offset in pixels for this form field. + * @param int|null $y the vertical offset in pixels for this form field * * @return self */ - public function setY($y) + public function setY(?int $y) { if (is_null($y)) { - throw new \InvalidArgumentException('non-nullable y cannot be null'); + throw new InvalidArgumentException('non-nullable y cannot be null'); } $this->container['y'] = $y; @@ -560,14 +545,14 @@ public function getWidth() /** * Sets width * - * @param int|null $width The width in pixels of this form field. + * @param int|null $width the width in pixels of this form field * * @return self */ - public function setWidth($width) + public function setWidth(?int $width) { if (is_null($width)) { - throw new \InvalidArgumentException('non-nullable width cannot be null'); + throw new InvalidArgumentException('non-nullable width cannot be null'); } $this->container['width'] = $width; @@ -587,14 +572,14 @@ public function getHeight() /** * Sets height * - * @param int|null $height The height in pixels of this form field. + * @param int|null $height the height in pixels of this form field * * @return self */ - public function setHeight($height) + public function setHeight(?int $height) { if (is_null($height)) { - throw new \InvalidArgumentException('non-nullable height cannot be null'); + throw new InvalidArgumentException('non-nullable height cannot be null'); } $this->container['height'] = $height; @@ -614,14 +599,14 @@ public function getRequired() /** * Sets required * - * @param bool|null $required Boolean showing whether or not this field is required. + * @param bool|null $required boolean showing whether or not this field is required * * @return self */ - public function setRequired($required) + public function setRequired(?bool $required) { if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + throw new InvalidArgumentException('non-nullable required cannot be null'); } $this->container['required'] = $required; @@ -645,13 +630,13 @@ public function getGroup() * * @return self */ - public function setGroup($group) + public function setGroup(?string $group) { if (is_null($group)) { array_push($this->openAPINullablesSetToNull, 'group'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('group', $nullablesSetToNull, true); + $index = array_search('group', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -661,14 +646,13 @@ public function setGroup($group) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -677,11 +661,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -692,10 +676,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -708,11 +690,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -720,12 +700,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -754,5 +734,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentCustomFieldCheckbox.php b/sdks/php/src/Model/TemplateResponseDocumentCustomFieldCheckbox.php index f54eceb0f..28b195cb6 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentCustomFieldCheckbox.php +++ b/sdks/php/src/Model/TemplateResponseDocumentCustomFieldCheckbox.php @@ -1,14 +1,11 @@ */ class TemplateResponseDocumentCustomFieldCheckbox extends TemplateResponseDocumentCustomFieldBase @@ -46,46 +44,46 @@ class TemplateResponseDocumentCustomFieldCheckbox extends TemplateResponseDocume public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentCustomFieldCheckbox'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string' + 'type' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null + 'type' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'type' => false + 'type' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,8 +108,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -121,7 +117,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +127,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,9 +136,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -151,9 +144,6 @@ 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 { @@ -167,7 +157,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type' + 'type' => 'type', ]; /** @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType' + 'type' => 'setType', ]; /** @@ -185,7 +175,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType' + 'type' => 'getType', ]; /** @@ -229,13 +219,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -244,34 +232,33 @@ public function __construct(?array $data = null) $this->setIfExists('type', $data ?? [], 'checkbox'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentCustomFieldCheckbox { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentCustomFieldCheckbox { /** @var TemplateResponseDocumentCustomFieldCheckbox */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentCustomFieldCheckbox::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,7 +294,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -325,23 +311,22 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -350,11 +335,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -365,10 +350,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -381,11 +364,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -393,12 +374,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -427,5 +408,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentCustomFieldText.php b/sdks/php/src/Model/TemplateResponseDocumentCustomFieldText.php index 34bffbce8..84beb6eda 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentCustomFieldText.php +++ b/sdks/php/src/Model/TemplateResponseDocumentCustomFieldText.php @@ -1,14 +1,11 @@ */ class TemplateResponseDocumentCustomFieldText extends TemplateResponseDocumentCustomFieldBase @@ -46,58 +44,58 @@ class TemplateResponseDocumentCustomFieldText extends TemplateResponseDocumentCu public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentCustomFieldText'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'avg_text_length' => '\Dropbox\Sign\Model\TemplateResponseFieldAvgTextLength', 'is_multiline' => 'bool', 'original_font_size' => 'int', - 'font_family' => 'string' + 'font_family' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'avg_text_length' => null, 'is_multiline' => null, 'original_font_size' => null, - 'font_family' => null + 'font_family' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, 'avg_text_length' => false, 'is_multiline' => false, 'original_font_size' => false, - 'font_family' => false + 'font_family' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -122,8 +120,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -133,7 +129,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -143,7 +139,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -152,9 +148,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -163,9 +156,6 @@ 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 { @@ -183,7 +173,7 @@ public function isNullableSetToNull(string $property): bool 'avg_text_length' => 'avg_text_length', 'is_multiline' => 'isMultiline', 'original_font_size' => 'originalFontSize', - 'font_family' => 'fontFamily' + 'font_family' => 'fontFamily', ]; /** @@ -196,7 +186,7 @@ public function isNullableSetToNull(string $property): bool 'avg_text_length' => 'setAvgTextLength', 'is_multiline' => 'setIsMultiline', 'original_font_size' => 'setOriginalFontSize', - 'font_family' => 'setFontFamily' + 'font_family' => 'setFontFamily', ]; /** @@ -209,7 +199,7 @@ public function isNullableSetToNull(string $property): bool 'avg_text_length' => 'getAvgTextLength', 'is_multiline' => 'getIsMultiline', 'original_font_size' => 'getOriginalFontSize', - 'font_family' => 'getFontFamily' + 'font_family' => 'getFontFamily', ]; /** @@ -253,13 +243,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -272,34 +260,33 @@ public function __construct(?array $data = null) $this->setIfExists('font_family', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentCustomFieldText { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentCustomFieldText { /** @var TemplateResponseDocumentCustomFieldText */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentCustomFieldText::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -335,7 +322,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -353,10 +339,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -380,10 +366,10 @@ public function getAvgTextLength() * * @return self */ - public function setAvgTextLength($avg_text_length) + public function setAvgTextLength(?TemplateResponseFieldAvgTextLength $avg_text_length) { if (is_null($avg_text_length)) { - throw new \InvalidArgumentException('non-nullable avg_text_length cannot be null'); + throw new InvalidArgumentException('non-nullable avg_text_length cannot be null'); } $this->container['avg_text_length'] = $avg_text_length; @@ -403,14 +389,14 @@ public function getIsMultiline() /** * Sets is_multiline * - * @param bool|null $is_multiline Whether this form field is multiline text. + * @param bool|null $is_multiline whether this form field is multiline text * * @return self */ - public function setIsMultiline($is_multiline) + public function setIsMultiline(?bool $is_multiline) { if (is_null($is_multiline)) { - throw new \InvalidArgumentException('non-nullable is_multiline cannot be null'); + throw new InvalidArgumentException('non-nullable is_multiline cannot be null'); } $this->container['is_multiline'] = $is_multiline; @@ -430,14 +416,14 @@ public function getOriginalFontSize() /** * Sets original_font_size * - * @param int|null $original_font_size Original font size used in this form field's text. + * @param int|null $original_font_size original font size used in this form field's text * * @return self */ - public function setOriginalFontSize($original_font_size) + public function setOriginalFontSize(?int $original_font_size) { if (is_null($original_font_size)) { - throw new \InvalidArgumentException('non-nullable original_font_size cannot be null'); + throw new InvalidArgumentException('non-nullable original_font_size cannot be null'); } $this->container['original_font_size'] = $original_font_size; @@ -457,27 +443,26 @@ public function getFontFamily() /** * Sets font_family * - * @param string|null $font_family Font family used in this form field's text. + * @param string|null $font_family font family used in this form field's text * * @return self */ - public function setFontFamily($font_family) + public function setFontFamily(?string $font_family) { if (is_null($font_family)) { - throw new \InvalidArgumentException('non-nullable font_family cannot be null'); + throw new InvalidArgumentException('non-nullable font_family cannot be null'); } $this->container['font_family'] = $font_family; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -486,11 +471,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -501,10 +486,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -517,11 +500,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -529,12 +510,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -563,5 +544,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentFieldGroup.php b/sdks/php/src/Model/TemplateResponseDocumentFieldGroup.php index 5cac4e00b..b58429dca 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFieldGroup.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFieldGroup.php @@ -1,14 +1,11 @@ */ -class TemplateResponseDocumentFieldGroup implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateResponseDocumentFieldGroup implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFieldGroup'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', - 'rule' => '\Dropbox\Sign\Model\TemplateResponseDocumentFieldGroupRule' + 'rule' => '\Dropbox\Sign\Model\TemplateResponseDocumentFieldGroupRule', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, - 'rule' => null + 'rule' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'name' => false, - 'rule' => false + 'rule' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'name' => 'name', - 'rule' => 'rule' + 'rule' => 'rule', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'name' => 'setName', - 'rule' => 'setRule' + 'rule' => 'setRule', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'name' => 'getName', - 'rule' => 'getRule' + 'rule' => 'getRule', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('rule', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFieldGroup { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFieldGroup { /** @var TemplateResponseDocumentFieldGroup */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFieldGroup::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -300,9 +288,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -316,7 +302,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets name * @@ -330,14 +315,14 @@ public function getName() /** * Sets name * - * @param string|null $name The name of the form field group. + * @param string|null $name the name of the form field group * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -361,23 +346,22 @@ public function getRule() * * @return self */ - public function setRule($rule) + public function setRule(?TemplateResponseDocumentFieldGroupRule $rule) { if (is_null($rule)) { - throw new \InvalidArgumentException('non-nullable rule cannot be null'); + throw new InvalidArgumentException('non-nullable rule cannot be null'); } $this->container['rule'] = $rule; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -386,11 +370,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -401,10 +385,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -417,11 +399,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -429,12 +409,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -463,5 +443,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentFieldGroupRule.php b/sdks/php/src/Model/TemplateResponseDocumentFieldGroupRule.php index b2001def1..6c9324b54 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFieldGroupRule.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFieldGroupRule.php @@ -1,14 +1,11 @@ */ -class TemplateResponseDocumentFieldGroupRule implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateResponseDocumentFieldGroupRule implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFieldGroupRule'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'requirement' => 'string', - 'group_label' => 'string' + 'group_label' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'requirement' => null, - 'group_label' => null + 'group_label' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'requirement' => false, - 'group_label' => false + 'group_label' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,8 +113,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -126,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -136,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -145,9 +141,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -156,9 +149,6 @@ 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 { @@ -173,7 +163,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'requirement' => 'requirement', - 'group_label' => 'groupLabel' + 'group_label' => 'groupLabel', ]; /** @@ -183,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'requirement' => 'setRequirement', - 'group_label' => 'setGroupLabel' + 'group_label' => 'setGroupLabel', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'requirement' => 'getRequirement', - 'group_label' => 'getGroupLabel' + 'group_label' => 'getGroupLabel', ]; /** @@ -237,7 +227,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -249,7 +238,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -257,34 +246,33 @@ public function __construct(?array $data = null) $this->setIfExists('group_label', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFieldGroupRule { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFieldGroupRule { /** @var TemplateResponseDocumentFieldGroupRule */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFieldGroupRule::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -301,9 +289,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -317,7 +303,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets requirement * @@ -335,10 +320,10 @@ public function getRequirement() * * @return self */ - public function setRequirement($requirement) + public function setRequirement(?string $requirement) { if (is_null($requirement)) { - throw new \InvalidArgumentException('non-nullable requirement cannot be null'); + throw new InvalidArgumentException('non-nullable requirement cannot be null'); } $this->container['requirement'] = $requirement; @@ -362,23 +347,22 @@ public function getGroupLabel() * * @return self */ - public function setGroupLabel($group_label) + public function setGroupLabel(?string $group_label) { if (is_null($group_label)) { - throw new \InvalidArgumentException('non-nullable group_label cannot be null'); + throw new InvalidArgumentException('non-nullable group_label cannot be null'); } $this->container['group_label'] = $group_label; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -387,11 +371,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -402,10 +386,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -418,11 +400,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -430,12 +410,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -464,5 +444,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldBase.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldBase.php index 877f84bdd..2562903cf 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldBase.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldBase.php @@ -1,14 +1,11 @@ */ -class TemplateResponseDocumentFormFieldBase implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateResponseDocumentFormFieldBase implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = 'type'; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFormFieldBase'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'api_id' => 'string', @@ -68,16 +66,16 @@ class TemplateResponseDocumentFormFieldBase implements ModelInterface, ArrayAcce 'y' => 'int', 'width' => 'int', 'height' => 'int', - 'required' => 'bool' + 'required' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'api_id' => null, @@ -87,14 +85,14 @@ class TemplateResponseDocumentFormFieldBase implements ModelInterface, ArrayAcce 'y' => null, 'width' => null, 'height' => null, - 'required' => null + 'required' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, 'api_id' => false, @@ -104,14 +102,14 @@ class TemplateResponseDocumentFormFieldBase implements ModelInterface, ArrayAcce 'y' => false, 'width' => false, 'height' => false, - 'required' => false + 'required' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -136,8 +134,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -147,7 +143,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -157,7 +153,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -166,9 +162,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -177,9 +170,6 @@ 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 { @@ -201,7 +191,7 @@ public function isNullableSetToNull(string $property): bool 'y' => 'y', 'width' => 'width', 'height' => 'height', - 'required' => 'required' + 'required' => 'required', ]; /** @@ -218,7 +208,7 @@ public function isNullableSetToNull(string $property): bool 'y' => 'setY', 'width' => 'setWidth', 'height' => 'setHeight', - 'required' => 'setRequired' + 'required' => 'setRequired', ]; /** @@ -235,7 +225,7 @@ public function isNullableSetToNull(string $property): bool 'y' => 'getY', 'width' => 'getWidth', 'height' => 'getHeight', - 'required' => 'getRequired' + 'required' => 'getRequired', ]; /** @@ -279,7 +269,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -291,7 +280,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -309,7 +298,6 @@ public function __construct(?array $data = null) $this->container['type'] = static::$openAPIModelName; } - public static function discriminatorClassName(array $data): ?string { if (!array_key_exists('type', $data)) { @@ -345,14 +333,12 @@ public static function discriminatorClassName(array $data): ?string } /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -388,7 +374,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -406,10 +391,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -429,14 +414,14 @@ public function getApiId() /** * Sets api_id * - * @param string|null $api_id A unique id for the form field. + * @param string|null $api_id a unique id for the form field * * @return self */ - public function setApiId($api_id) + public function setApiId(?string $api_id) { if (is_null($api_id)) { - throw new \InvalidArgumentException('non-nullable api_id cannot be null'); + throw new InvalidArgumentException('non-nullable api_id cannot be null'); } $this->container['api_id'] = $api_id; @@ -456,14 +441,14 @@ public function getName() /** * Sets name * - * @param string|null $name The name of the form field. + * @param string|null $name the name of the form field * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -483,14 +468,14 @@ public function getSigner() /** * Sets signer * - * @param string|null $signer The signer of the Form Field. + * @param string|null $signer the signer of the Form Field * * @return self */ - public function setSigner($signer) + public function setSigner(?string $signer) { if (is_null($signer)) { - throw new \InvalidArgumentException('non-nullable signer cannot be null'); + throw new InvalidArgumentException('non-nullable signer cannot be null'); } $this->container['signer'] = $signer; @@ -510,14 +495,14 @@ public function getX() /** * Sets x * - * @param int|null $x The horizontal offset in pixels for this form field. + * @param int|null $x the horizontal offset in pixels for this form field * * @return self */ - public function setX($x) + public function setX(?int $x) { if (is_null($x)) { - throw new \InvalidArgumentException('non-nullable x cannot be null'); + throw new InvalidArgumentException('non-nullable x cannot be null'); } $this->container['x'] = $x; @@ -537,14 +522,14 @@ public function getY() /** * Sets y * - * @param int|null $y The vertical offset in pixels for this form field. + * @param int|null $y the vertical offset in pixels for this form field * * @return self */ - public function setY($y) + public function setY(?int $y) { if (is_null($y)) { - throw new \InvalidArgumentException('non-nullable y cannot be null'); + throw new InvalidArgumentException('non-nullable y cannot be null'); } $this->container['y'] = $y; @@ -564,14 +549,14 @@ public function getWidth() /** * Sets width * - * @param int|null $width The width in pixels of this form field. + * @param int|null $width the width in pixels of this form field * * @return self */ - public function setWidth($width) + public function setWidth(?int $width) { if (is_null($width)) { - throw new \InvalidArgumentException('non-nullable width cannot be null'); + throw new InvalidArgumentException('non-nullable width cannot be null'); } $this->container['width'] = $width; @@ -591,14 +576,14 @@ public function getHeight() /** * Sets height * - * @param int|null $height The height in pixels of this form field. + * @param int|null $height the height in pixels of this form field * * @return self */ - public function setHeight($height) + public function setHeight(?int $height) { if (is_null($height)) { - throw new \InvalidArgumentException('non-nullable height cannot be null'); + throw new InvalidArgumentException('non-nullable height cannot be null'); } $this->container['height'] = $height; @@ -618,27 +603,26 @@ public function getRequired() /** * Sets required * - * @param bool|null $required Boolean showing whether or not this field is required. + * @param bool|null $required boolean showing whether or not this field is required * * @return self */ - public function setRequired($required) + public function setRequired(?bool $required) { if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + throw new InvalidArgumentException('non-nullable required cannot be null'); } $this->container['required'] = $required; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -647,11 +631,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -662,10 +646,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -678,11 +660,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -690,12 +670,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -724,5 +704,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldCheckbox.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldCheckbox.php index 59cd4a9f2..3b72e3cc0 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldCheckbox.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldCheckbox.php @@ -1,14 +1,11 @@ */ class TemplateResponseDocumentFormFieldCheckbox extends TemplateResponseDocumentFormFieldBase @@ -46,49 +44,49 @@ class TemplateResponseDocumentFormFieldCheckbox extends TemplateResponseDocument public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFormFieldCheckbox'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'group' => 'string' + 'group' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'group' => null + 'group' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, - 'group' => true + 'group' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,8 +111,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -124,7 +120,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +130,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,9 +139,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -154,9 +147,6 @@ 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 { @@ -171,7 +161,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'group' => 'group' + 'group' => 'group', ]; /** @@ -181,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'group' => 'setGroup' + 'group' => 'setGroup', ]; /** @@ -191,7 +181,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'group' => 'getGroup' + 'group' => 'getGroup', ]; /** @@ -235,13 +225,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -251,34 +239,33 @@ public function __construct(?array $data = null) $this->setIfExists('group', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldCheckbox { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFormFieldCheckbox { /** @var TemplateResponseDocumentFormFieldCheckbox */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldCheckbox::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -314,7 +301,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -332,10 +318,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -359,13 +345,13 @@ public function getGroup() * * @return self */ - public function setGroup($group) + public function setGroup(?string $group) { if (is_null($group)) { array_push($this->openAPINullablesSetToNull, 'group'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('group', $nullablesSetToNull, true); + $index = array_search('group', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -375,14 +361,13 @@ public function setGroup($group) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -391,11 +376,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -406,10 +391,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -422,11 +405,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -434,12 +415,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -468,5 +449,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldDateSigned.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldDateSigned.php index d7f7a2dc4..342281d3c 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldDateSigned.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldDateSigned.php @@ -1,14 +1,11 @@ */ class TemplateResponseDocumentFormFieldDateSigned extends TemplateResponseDocumentFormFieldBase @@ -46,49 +44,49 @@ class TemplateResponseDocumentFormFieldDateSigned extends TemplateResponseDocume public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFormFieldDateSigned'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'group' => 'string' + 'group' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'group' => null + 'group' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, - 'group' => true + 'group' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,8 +111,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -124,7 +120,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +130,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,9 +139,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -154,9 +147,6 @@ 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 { @@ -171,7 +161,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'group' => 'group' + 'group' => 'group', ]; /** @@ -181,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'group' => 'setGroup' + 'group' => 'setGroup', ]; /** @@ -191,7 +181,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'group' => 'getGroup' + 'group' => 'getGroup', ]; /** @@ -235,13 +225,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -251,34 +239,33 @@ public function __construct(?array $data = null) $this->setIfExists('group', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldDateSigned { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFormFieldDateSigned { /** @var TemplateResponseDocumentFormFieldDateSigned */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldDateSigned::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -314,7 +301,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -332,10 +318,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -359,13 +345,13 @@ public function getGroup() * * @return self */ - public function setGroup($group) + public function setGroup(?string $group) { if (is_null($group)) { array_push($this->openAPINullablesSetToNull, 'group'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('group', $nullablesSetToNull, true); + $index = array_search('group', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -375,14 +361,13 @@ public function setGroup($group) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -391,11 +376,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -406,10 +391,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -422,11 +405,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -434,12 +415,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -468,5 +449,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldDropdown.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldDropdown.php index d9ed9a1d7..dd4cfc015 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldDropdown.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldDropdown.php @@ -1,14 +1,11 @@ */ class TemplateResponseDocumentFormFieldDropdown extends TemplateResponseDocumentFormFieldBase @@ -46,49 +44,49 @@ class TemplateResponseDocumentFormFieldDropdown extends TemplateResponseDocument public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFormFieldDropdown'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'group' => 'string' + 'group' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'group' => null + 'group' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, - 'group' => true + 'group' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,8 +111,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -124,7 +120,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +130,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,9 +139,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -154,9 +147,6 @@ 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 { @@ -171,7 +161,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'group' => 'group' + 'group' => 'group', ]; /** @@ -181,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'group' => 'setGroup' + 'group' => 'setGroup', ]; /** @@ -191,7 +181,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'group' => 'getGroup' + 'group' => 'getGroup', ]; /** @@ -235,13 +225,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -251,34 +239,33 @@ public function __construct(?array $data = null) $this->setIfExists('group', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldDropdown { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFormFieldDropdown { /** @var TemplateResponseDocumentFormFieldDropdown */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldDropdown::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -314,7 +301,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -332,10 +318,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -359,13 +345,13 @@ public function getGroup() * * @return self */ - public function setGroup($group) + public function setGroup(?string $group) { if (is_null($group)) { array_push($this->openAPINullablesSetToNull, 'group'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('group', $nullablesSetToNull, true); + $index = array_search('group', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -375,14 +361,13 @@ public function setGroup($group) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -391,11 +376,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -406,10 +391,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -422,11 +405,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -434,12 +415,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -468,5 +449,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldHyperlink.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldHyperlink.php index e69dc9b66..01e3b912c 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldHyperlink.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldHyperlink.php @@ -1,14 +1,11 @@ */ class TemplateResponseDocumentFormFieldHyperlink extends TemplateResponseDocumentFormFieldBase @@ -46,61 +44,61 @@ class TemplateResponseDocumentFormFieldHyperlink extends TemplateResponseDocumen public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFormFieldHyperlink'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'avg_text_length' => '\Dropbox\Sign\Model\TemplateResponseFieldAvgTextLength', 'is_multiline' => 'bool', 'original_font_size' => 'int', 'font_family' => 'string', - 'group' => 'string' + 'group' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'avg_text_length' => null, 'is_multiline' => null, 'original_font_size' => null, 'font_family' => null, - 'group' => null + 'group' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, 'avg_text_length' => false, 'is_multiline' => false, 'original_font_size' => false, 'font_family' => false, - 'group' => true + 'group' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -125,8 +123,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -136,7 +132,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -146,7 +142,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -155,9 +151,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -166,9 +159,6 @@ 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 { @@ -187,7 +177,7 @@ public function isNullableSetToNull(string $property): bool 'is_multiline' => 'isMultiline', 'original_font_size' => 'originalFontSize', 'font_family' => 'fontFamily', - 'group' => 'group' + 'group' => 'group', ]; /** @@ -201,7 +191,7 @@ public function isNullableSetToNull(string $property): bool 'is_multiline' => 'setIsMultiline', 'original_font_size' => 'setOriginalFontSize', 'font_family' => 'setFontFamily', - 'group' => 'setGroup' + 'group' => 'setGroup', ]; /** @@ -215,7 +205,7 @@ public function isNullableSetToNull(string $property): bool 'is_multiline' => 'getIsMultiline', 'original_font_size' => 'getOriginalFontSize', 'font_family' => 'getFontFamily', - 'group' => 'getGroup' + 'group' => 'getGroup', ]; /** @@ -259,13 +249,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -279,34 +267,33 @@ public function __construct(?array $data = null) $this->setIfExists('group', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldHyperlink { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFormFieldHyperlink { /** @var TemplateResponseDocumentFormFieldHyperlink */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldHyperlink::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -342,7 +329,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -360,10 +346,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -387,10 +373,10 @@ public function getAvgTextLength() * * @return self */ - public function setAvgTextLength($avg_text_length) + public function setAvgTextLength(?TemplateResponseFieldAvgTextLength $avg_text_length) { if (is_null($avg_text_length)) { - throw new \InvalidArgumentException('non-nullable avg_text_length cannot be null'); + throw new InvalidArgumentException('non-nullable avg_text_length cannot be null'); } $this->container['avg_text_length'] = $avg_text_length; @@ -410,14 +396,14 @@ public function getIsMultiline() /** * Sets is_multiline * - * @param bool|null $is_multiline Whether this form field is multiline text. + * @param bool|null $is_multiline whether this form field is multiline text * * @return self */ - public function setIsMultiline($is_multiline) + public function setIsMultiline(?bool $is_multiline) { if (is_null($is_multiline)) { - throw new \InvalidArgumentException('non-nullable is_multiline cannot be null'); + throw new InvalidArgumentException('non-nullable is_multiline cannot be null'); } $this->container['is_multiline'] = $is_multiline; @@ -437,14 +423,14 @@ public function getOriginalFontSize() /** * Sets original_font_size * - * @param int|null $original_font_size Original font size used in this form field's text. + * @param int|null $original_font_size original font size used in this form field's text * * @return self */ - public function setOriginalFontSize($original_font_size) + public function setOriginalFontSize(?int $original_font_size) { if (is_null($original_font_size)) { - throw new \InvalidArgumentException('non-nullable original_font_size cannot be null'); + throw new InvalidArgumentException('non-nullable original_font_size cannot be null'); } $this->container['original_font_size'] = $original_font_size; @@ -464,14 +450,14 @@ public function getFontFamily() /** * Sets font_family * - * @param string|null $font_family Font family used in this form field's text. + * @param string|null $font_family font family used in this form field's text * * @return self */ - public function setFontFamily($font_family) + public function setFontFamily(?string $font_family) { if (is_null($font_family)) { - throw new \InvalidArgumentException('non-nullable font_family cannot be null'); + throw new InvalidArgumentException('non-nullable font_family cannot be null'); } $this->container['font_family'] = $font_family; @@ -495,13 +481,13 @@ public function getGroup() * * @return self */ - public function setGroup($group) + public function setGroup(?string $group) { if (is_null($group)) { array_push($this->openAPINullablesSetToNull, 'group'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('group', $nullablesSetToNull, true); + $index = array_search('group', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -511,14 +497,13 @@ public function setGroup($group) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -527,11 +512,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -542,10 +527,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -558,11 +541,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -570,12 +551,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -604,5 +585,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldInitials.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldInitials.php index 6658108c4..f20e10da5 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldInitials.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldInitials.php @@ -1,14 +1,11 @@ */ class TemplateResponseDocumentFormFieldInitials extends TemplateResponseDocumentFormFieldBase @@ -46,49 +44,49 @@ class TemplateResponseDocumentFormFieldInitials extends TemplateResponseDocument public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFormFieldInitials'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'group' => 'string' + 'group' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'group' => null + 'group' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, - 'group' => true + 'group' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,8 +111,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -124,7 +120,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +130,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,9 +139,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -154,9 +147,6 @@ 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 { @@ -171,7 +161,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'group' => 'group' + 'group' => 'group', ]; /** @@ -181,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'group' => 'setGroup' + 'group' => 'setGroup', ]; /** @@ -191,7 +181,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'group' => 'getGroup' + 'group' => 'getGroup', ]; /** @@ -235,13 +225,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -251,34 +239,33 @@ public function __construct(?array $data = null) $this->setIfExists('group', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldInitials { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFormFieldInitials { /** @var TemplateResponseDocumentFormFieldInitials */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldInitials::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -314,7 +301,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -332,10 +318,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -359,13 +345,13 @@ public function getGroup() * * @return self */ - public function setGroup($group) + public function setGroup(?string $group) { if (is_null($group)) { array_push($this->openAPINullablesSetToNull, 'group'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('group', $nullablesSetToNull, true); + $index = array_search('group', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -375,14 +361,13 @@ public function setGroup($group) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -391,11 +376,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -406,10 +391,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -422,11 +405,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -434,12 +415,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -468,5 +449,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldRadio.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldRadio.php index 873d0f328..5052ea63d 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldRadio.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldRadio.php @@ -1,14 +1,11 @@ */ class TemplateResponseDocumentFormFieldRadio extends TemplateResponseDocumentFormFieldBase @@ -46,49 +44,49 @@ class TemplateResponseDocumentFormFieldRadio extends TemplateResponseDocumentFor public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFormFieldRadio'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'group' => 'string' + 'group' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'group' => null + 'group' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, - 'group' => false + 'group' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,8 +111,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -124,7 +120,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +130,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,9 +139,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -154,9 +147,6 @@ 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 { @@ -171,7 +161,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'group' => 'group' + 'group' => 'group', ]; /** @@ -181,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'group' => 'setGroup' + 'group' => 'setGroup', ]; /** @@ -191,7 +181,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'group' => 'getGroup' + 'group' => 'getGroup', ]; /** @@ -235,13 +225,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -251,34 +239,33 @@ public function __construct(?array $data = null) $this->setIfExists('group', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldRadio { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFormFieldRadio { /** @var TemplateResponseDocumentFormFieldRadio */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldRadio::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -317,7 +304,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -335,10 +321,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -362,23 +348,22 @@ public function getGroup() * * @return self */ - public function setGroup($group) + public function setGroup(string $group) { if (is_null($group)) { - throw new \InvalidArgumentException('non-nullable group cannot be null'); + throw new InvalidArgumentException('non-nullable group cannot be null'); } $this->container['group'] = $group; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -387,11 +372,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -402,10 +387,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -418,11 +401,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -430,12 +411,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -464,5 +445,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldSignature.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldSignature.php index 9323e0dff..6ba169c16 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldSignature.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldSignature.php @@ -1,14 +1,11 @@ */ class TemplateResponseDocumentFormFieldSignature extends TemplateResponseDocumentFormFieldBase @@ -46,49 +44,49 @@ class TemplateResponseDocumentFormFieldSignature extends TemplateResponseDocumen public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFormFieldSignature'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', - 'group' => 'string' + 'group' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, - 'group' => null + 'group' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, - 'group' => true + 'group' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -113,8 +111,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -124,7 +120,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -134,7 +130,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -143,9 +139,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -154,9 +147,6 @@ 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 { @@ -171,7 +161,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'group' => 'group' + 'group' => 'group', ]; /** @@ -181,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'group' => 'setGroup' + 'group' => 'setGroup', ]; /** @@ -191,7 +181,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'group' => 'getGroup' + 'group' => 'getGroup', ]; /** @@ -235,13 +225,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -251,34 +239,33 @@ public function __construct(?array $data = null) $this->setIfExists('group', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldSignature { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFormFieldSignature { /** @var TemplateResponseDocumentFormFieldSignature */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldSignature::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -314,7 +301,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -332,10 +318,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -359,13 +345,13 @@ public function getGroup() * * @return self */ - public function setGroup($group) + public function setGroup(?string $group) { if (is_null($group)) { array_push($this->openAPINullablesSetToNull, 'group'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('group', $nullablesSetToNull, true); + $index = array_search('group', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -375,14 +361,13 @@ public function setGroup($group) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -391,11 +376,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -406,10 +391,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -422,11 +405,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -434,12 +415,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -468,5 +449,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldText.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldText.php index f789baa78..afb433174 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldText.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldText.php @@ -1,14 +1,11 @@ */ class TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentFormFieldBase @@ -46,17 +44,17 @@ class TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentForm public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentFormFieldText'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'avg_text_length' => '\Dropbox\Sign\Model\TemplateResponseFieldAvgTextLength', @@ -64,16 +62,16 @@ class TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentForm 'original_font_size' => 'int', 'font_family' => 'string', 'validation_type' => 'string', - 'group' => 'string' + 'group' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'avg_text_length' => null, @@ -81,14 +79,14 @@ class TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentForm 'original_font_size' => null, 'font_family' => null, 'validation_type' => null, - 'group' => null + 'group' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, 'avg_text_length' => false, @@ -96,14 +94,14 @@ class TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentForm 'original_font_size' => false, 'font_family' => false, 'validation_type' => true, - 'group' => true + 'group' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -128,8 +126,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -139,7 +135,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -149,7 +145,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -158,9 +154,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -169,9 +162,6 @@ 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 { @@ -191,7 +181,7 @@ public function isNullableSetToNull(string $property): bool 'original_font_size' => 'originalFontSize', 'font_family' => 'fontFamily', 'validation_type' => 'validation_type', - 'group' => 'group' + 'group' => 'group', ]; /** @@ -206,7 +196,7 @@ public function isNullableSetToNull(string $property): bool 'original_font_size' => 'setOriginalFontSize', 'font_family' => 'setFontFamily', 'validation_type' => 'setValidationType', - 'group' => 'setGroup' + 'group' => 'setGroup', ]; /** @@ -221,7 +211,7 @@ public function isNullableSetToNull(string $property): bool 'original_font_size' => 'getOriginalFontSize', 'font_family' => 'getFontFamily', 'validation_type' => 'getValidationType', - 'group' => 'getGroup' + 'group' => 'getGroup', ]; /** @@ -297,12 +287,11 @@ public function getValidationTypeAllowableValues() ]; } - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -317,34 +306,33 @@ public function __construct(?array $data = null) $this->setIfExists('group', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldText { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFormFieldText { /** @var TemplateResponseDocumentFormFieldText */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldText::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -389,7 +377,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -407,10 +394,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -434,10 +421,10 @@ public function getAvgTextLength() * * @return self */ - public function setAvgTextLength($avg_text_length) + public function setAvgTextLength(?TemplateResponseFieldAvgTextLength $avg_text_length) { if (is_null($avg_text_length)) { - throw new \InvalidArgumentException('non-nullable avg_text_length cannot be null'); + throw new InvalidArgumentException('non-nullable avg_text_length cannot be null'); } $this->container['avg_text_length'] = $avg_text_length; @@ -457,14 +444,14 @@ public function getIsMultiline() /** * Sets is_multiline * - * @param bool|null $is_multiline Whether this form field is multiline text. + * @param bool|null $is_multiline whether this form field is multiline text * * @return self */ - public function setIsMultiline($is_multiline) + public function setIsMultiline(?bool $is_multiline) { if (is_null($is_multiline)) { - throw new \InvalidArgumentException('non-nullable is_multiline cannot be null'); + throw new InvalidArgumentException('non-nullable is_multiline cannot be null'); } $this->container['is_multiline'] = $is_multiline; @@ -484,14 +471,14 @@ public function getOriginalFontSize() /** * Sets original_font_size * - * @param int|null $original_font_size Original font size used in this form field's text. + * @param int|null $original_font_size original font size used in this form field's text * * @return self */ - public function setOriginalFontSize($original_font_size) + public function setOriginalFontSize(?int $original_font_size) { if (is_null($original_font_size)) { - throw new \InvalidArgumentException('non-nullable original_font_size cannot be null'); + throw new InvalidArgumentException('non-nullable original_font_size cannot be null'); } $this->container['original_font_size'] = $original_font_size; @@ -511,14 +498,14 @@ public function getFontFamily() /** * Sets font_family * - * @param string|null $font_family Font family used in this form field's text. + * @param string|null $font_family font family used in this form field's text * * @return self */ - public function setFontFamily($font_family) + public function setFontFamily(?string $font_family) { if (is_null($font_family)) { - throw new \InvalidArgumentException('non-nullable font_family cannot be null'); + throw new InvalidArgumentException('non-nullable font_family cannot be null'); } $this->container['font_family'] = $font_family; @@ -542,13 +529,13 @@ public function getValidationType() * * @return self */ - public function setValidationType($validation_type) + public function setValidationType(?string $validation_type) { if (is_null($validation_type)) { array_push($this->openAPINullablesSetToNull, 'validation_type'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('validation_type', $nullablesSetToNull, true); + $index = array_search('validation_type', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -556,7 +543,7 @@ public function setValidationType($validation_type) } $allowedValues = $this->getValidationTypeAllowableValues(); if (!is_null($validation_type) && !in_array($validation_type, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'validation_type', must be one of '%s'", $validation_type, @@ -586,13 +573,13 @@ public function getGroup() * * @return self */ - public function setGroup($group) + public function setGroup(?string $group) { if (is_null($group)) { array_push($this->openAPINullablesSetToNull, 'group'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('group', $nullablesSetToNull, true); + $index = array_search('group', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -602,14 +589,13 @@ public function setGroup($group) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -618,11 +604,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -633,10 +619,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -649,11 +633,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -661,12 +643,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -695,5 +677,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldBase.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldBase.php index 2aab358c2..fc632b95a 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldBase.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldBase.php @@ -1,14 +1,11 @@ */ -class TemplateResponseDocumentStaticFieldBase implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateResponseDocumentStaticFieldBase implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = 'type'; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentStaticFieldBase'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'api_id' => 'string', @@ -69,16 +67,16 @@ class TemplateResponseDocumentStaticFieldBase implements ModelInterface, ArrayAc 'width' => 'int', 'height' => 'int', 'required' => 'bool', - 'group' => 'string' + 'group' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'api_id' => null, @@ -89,14 +87,14 @@ class TemplateResponseDocumentStaticFieldBase implements ModelInterface, ArrayAc 'width' => null, 'height' => null, 'required' => null, - 'group' => null + 'group' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, 'api_id' => false, @@ -107,14 +105,14 @@ class TemplateResponseDocumentStaticFieldBase implements ModelInterface, ArrayAc 'width' => false, 'height' => false, 'required' => false, - 'group' => true + 'group' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -139,8 +137,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -150,7 +146,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -160,7 +156,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -169,9 +165,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -180,9 +173,6 @@ 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 { @@ -205,7 +195,7 @@ public function isNullableSetToNull(string $property): bool 'width' => 'width', 'height' => 'height', 'required' => 'required', - 'group' => 'group' + 'group' => 'group', ]; /** @@ -223,7 +213,7 @@ public function isNullableSetToNull(string $property): bool 'width' => 'setWidth', 'height' => 'setHeight', 'required' => 'setRequired', - 'group' => 'setGroup' + 'group' => 'setGroup', ]; /** @@ -241,7 +231,7 @@ public function isNullableSetToNull(string $property): bool 'width' => 'getWidth', 'height' => 'getHeight', 'required' => 'getRequired', - 'group' => 'getGroup' + 'group' => 'getGroup', ]; /** @@ -285,7 +275,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -297,7 +286,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -316,7 +305,6 @@ public function __construct(?array $data = null) $this->container['type'] = static::$openAPIModelName; } - public static function discriminatorClassName(array $data): ?string { if (!array_key_exists('type', $data)) { @@ -352,14 +340,12 @@ public static function discriminatorClassName(array $data): ?string } /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -395,7 +381,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -413,10 +398,10 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; @@ -436,14 +421,14 @@ public function getApiId() /** * Sets api_id * - * @param string|null $api_id A unique id for the static field. + * @param string|null $api_id a unique id for the static field * * @return self */ - public function setApiId($api_id) + public function setApiId(?string $api_id) { if (is_null($api_id)) { - throw new \InvalidArgumentException('non-nullable api_id cannot be null'); + throw new InvalidArgumentException('non-nullable api_id cannot be null'); } $this->container['api_id'] = $api_id; @@ -463,14 +448,14 @@ public function getName() /** * Sets name * - * @param string|null $name The name of the static field. + * @param string|null $name the name of the static field * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -490,14 +475,14 @@ public function getSigner() /** * Sets signer * - * @param string|null $signer The signer of the Static Field. + * @param string|null $signer the signer of the Static Field * * @return self */ - public function setSigner($signer) + public function setSigner(?string $signer) { if (is_null($signer)) { - throw new \InvalidArgumentException('non-nullable signer cannot be null'); + throw new InvalidArgumentException('non-nullable signer cannot be null'); } $this->container['signer'] = $signer; @@ -517,14 +502,14 @@ public function getX() /** * Sets x * - * @param int|null $x The horizontal offset in pixels for this static field. + * @param int|null $x the horizontal offset in pixels for this static field * * @return self */ - public function setX($x) + public function setX(?int $x) { if (is_null($x)) { - throw new \InvalidArgumentException('non-nullable x cannot be null'); + throw new InvalidArgumentException('non-nullable x cannot be null'); } $this->container['x'] = $x; @@ -544,14 +529,14 @@ public function getY() /** * Sets y * - * @param int|null $y The vertical offset in pixels for this static field. + * @param int|null $y the vertical offset in pixels for this static field * * @return self */ - public function setY($y) + public function setY(?int $y) { if (is_null($y)) { - throw new \InvalidArgumentException('non-nullable y cannot be null'); + throw new InvalidArgumentException('non-nullable y cannot be null'); } $this->container['y'] = $y; @@ -571,14 +556,14 @@ public function getWidth() /** * Sets width * - * @param int|null $width The width in pixels of this static field. + * @param int|null $width the width in pixels of this static field * * @return self */ - public function setWidth($width) + public function setWidth(?int $width) { if (is_null($width)) { - throw new \InvalidArgumentException('non-nullable width cannot be null'); + throw new InvalidArgumentException('non-nullable width cannot be null'); } $this->container['width'] = $width; @@ -598,14 +583,14 @@ public function getHeight() /** * Sets height * - * @param int|null $height The height in pixels of this static field. + * @param int|null $height the height in pixels of this static field * * @return self */ - public function setHeight($height) + public function setHeight(?int $height) { if (is_null($height)) { - throw new \InvalidArgumentException('non-nullable height cannot be null'); + throw new InvalidArgumentException('non-nullable height cannot be null'); } $this->container['height'] = $height; @@ -625,14 +610,14 @@ public function getRequired() /** * Sets required * - * @param bool|null $required Boolean showing whether or not this field is required. + * @param bool|null $required boolean showing whether or not this field is required * * @return self */ - public function setRequired($required) + public function setRequired(?bool $required) { if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + throw new InvalidArgumentException('non-nullable required cannot be null'); } $this->container['required'] = $required; @@ -656,13 +641,13 @@ public function getGroup() * * @return self */ - public function setGroup($group) + public function setGroup(?string $group) { if (is_null($group)) { array_push($this->openAPINullablesSetToNull, 'group'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('group', $nullablesSetToNull, true); + $index = array_search('group', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -672,14 +657,13 @@ public function setGroup($group) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -688,11 +672,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -703,10 +687,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -719,11 +701,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -731,12 +711,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -765,5 +745,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldCheckbox.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldCheckbox.php index 972c67a11..1f583ce91 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldCheckbox.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldCheckbox.php @@ -1,14 +1,11 @@ */ class TemplateResponseDocumentStaticFieldCheckbox extends TemplateResponseDocumentStaticFieldBase @@ -46,46 +44,46 @@ class TemplateResponseDocumentStaticFieldCheckbox extends TemplateResponseDocume public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentStaticFieldCheckbox'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string' + 'type' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null + 'type' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'type' => false + 'type' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,8 +108,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -121,7 +117,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +127,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,9 +136,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -151,9 +144,6 @@ 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 { @@ -167,7 +157,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type' + 'type' => 'type', ]; /** @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType' + 'type' => 'setType', ]; /** @@ -185,7 +175,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType' + 'type' => 'getType', ]; /** @@ -229,13 +219,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -244,34 +232,33 @@ public function __construct(?array $data = null) $this->setIfExists('type', $data ?? [], 'checkbox'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldCheckbox { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentStaticFieldCheckbox { /** @var TemplateResponseDocumentStaticFieldCheckbox */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldCheckbox::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,7 +294,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -325,23 +311,22 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -350,11 +335,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -365,10 +350,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -381,11 +364,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -393,12 +374,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -427,5 +408,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDateSigned.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDateSigned.php index 1aba44059..5ae56b512 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDateSigned.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDateSigned.php @@ -1,14 +1,11 @@ */ class TemplateResponseDocumentStaticFieldDateSigned extends TemplateResponseDocumentStaticFieldBase @@ -46,46 +44,46 @@ class TemplateResponseDocumentStaticFieldDateSigned extends TemplateResponseDocu public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentStaticFieldDateSigned'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string' + 'type' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null + 'type' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'type' => false + 'type' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,8 +108,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -121,7 +117,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +127,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,9 +136,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -151,9 +144,6 @@ 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 { @@ -167,7 +157,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type' + 'type' => 'type', ]; /** @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType' + 'type' => 'setType', ]; /** @@ -185,7 +175,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType' + 'type' => 'getType', ]; /** @@ -229,13 +219,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -244,34 +232,33 @@ public function __construct(?array $data = null) $this->setIfExists('type', $data ?? [], 'date_signed'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldDateSigned { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentStaticFieldDateSigned { /** @var TemplateResponseDocumentStaticFieldDateSigned */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldDateSigned::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,7 +294,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -325,23 +311,22 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -350,11 +335,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -365,10 +350,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -381,11 +364,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -393,12 +374,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -427,5 +408,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDropdown.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDropdown.php index e58467649..8c424a9b2 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDropdown.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDropdown.php @@ -1,14 +1,11 @@ */ class TemplateResponseDocumentStaticFieldDropdown extends TemplateResponseDocumentStaticFieldBase @@ -46,46 +44,46 @@ class TemplateResponseDocumentStaticFieldDropdown extends TemplateResponseDocume public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentStaticFieldDropdown'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string' + 'type' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null + 'type' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'type' => false + 'type' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,8 +108,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -121,7 +117,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +127,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,9 +136,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -151,9 +144,6 @@ 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 { @@ -167,7 +157,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type' + 'type' => 'type', ]; /** @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType' + 'type' => 'setType', ]; /** @@ -185,7 +175,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType' + 'type' => 'getType', ]; /** @@ -229,13 +219,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -244,34 +232,33 @@ public function __construct(?array $data = null) $this->setIfExists('type', $data ?? [], 'dropdown'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldDropdown { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentStaticFieldDropdown { /** @var TemplateResponseDocumentStaticFieldDropdown */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldDropdown::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,7 +294,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -325,23 +311,22 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -350,11 +335,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -365,10 +350,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -381,11 +364,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -393,12 +374,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -427,5 +408,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldHyperlink.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldHyperlink.php index 94c10d2f9..218bbb068 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldHyperlink.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldHyperlink.php @@ -1,14 +1,11 @@ */ class TemplateResponseDocumentStaticFieldHyperlink extends TemplateResponseDocumentStaticFieldBase @@ -46,46 +44,46 @@ class TemplateResponseDocumentStaticFieldHyperlink extends TemplateResponseDocum public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentStaticFieldHyperlink'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string' + 'type' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null + 'type' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'type' => false + 'type' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,8 +108,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -121,7 +117,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +127,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,9 +136,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -151,9 +144,6 @@ 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 { @@ -167,7 +157,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type' + 'type' => 'type', ]; /** @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType' + 'type' => 'setType', ]; /** @@ -185,7 +175,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType' + 'type' => 'getType', ]; /** @@ -229,13 +219,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -244,34 +232,33 @@ public function __construct(?array $data = null) $this->setIfExists('type', $data ?? [], 'hyperlink'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldHyperlink { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentStaticFieldHyperlink { /** @var TemplateResponseDocumentStaticFieldHyperlink */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldHyperlink::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,7 +294,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -325,23 +311,22 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -350,11 +335,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -365,10 +350,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -381,11 +364,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -393,12 +374,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -427,5 +408,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldInitials.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldInitials.php index 88fb3e103..ce7701354 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldInitials.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldInitials.php @@ -1,14 +1,11 @@ */ class TemplateResponseDocumentStaticFieldInitials extends TemplateResponseDocumentStaticFieldBase @@ -46,46 +44,46 @@ class TemplateResponseDocumentStaticFieldInitials extends TemplateResponseDocume public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentStaticFieldInitials'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string' + 'type' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null + 'type' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'type' => false + 'type' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,8 +108,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -121,7 +117,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +127,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,9 +136,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -151,9 +144,6 @@ 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 { @@ -167,7 +157,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type' + 'type' => 'type', ]; /** @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType' + 'type' => 'setType', ]; /** @@ -185,7 +175,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType' + 'type' => 'getType', ]; /** @@ -229,13 +219,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -244,34 +232,33 @@ public function __construct(?array $data = null) $this->setIfExists('type', $data ?? [], 'initials'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldInitials { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentStaticFieldInitials { /** @var TemplateResponseDocumentStaticFieldInitials */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldInitials::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,7 +294,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -325,23 +311,22 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -350,11 +335,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -365,10 +350,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -381,11 +364,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -393,12 +374,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -427,5 +408,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldRadio.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldRadio.php index 372620d66..ae47e8afb 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldRadio.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldRadio.php @@ -1,14 +1,11 @@ */ class TemplateResponseDocumentStaticFieldRadio extends TemplateResponseDocumentStaticFieldBase @@ -46,46 +44,46 @@ class TemplateResponseDocumentStaticFieldRadio extends TemplateResponseDocumentS public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentStaticFieldRadio'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string' + 'type' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null + 'type' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'type' => false + 'type' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,8 +108,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -121,7 +117,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +127,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,9 +136,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -151,9 +144,6 @@ 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 { @@ -167,7 +157,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type' + 'type' => 'type', ]; /** @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType' + 'type' => 'setType', ]; /** @@ -185,7 +175,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType' + 'type' => 'getType', ]; /** @@ -229,13 +219,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -244,34 +232,33 @@ public function __construct(?array $data = null) $this->setIfExists('type', $data ?? [], 'radio'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldRadio { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentStaticFieldRadio { /** @var TemplateResponseDocumentStaticFieldRadio */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldRadio::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,7 +294,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -325,23 +311,22 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -350,11 +335,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -365,10 +350,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -381,11 +364,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -393,12 +374,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -427,5 +408,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldSignature.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldSignature.php index bcfffe5bc..c0da5a2d5 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldSignature.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldSignature.php @@ -1,14 +1,11 @@ */ class TemplateResponseDocumentStaticFieldSignature extends TemplateResponseDocumentStaticFieldBase @@ -46,46 +44,46 @@ class TemplateResponseDocumentStaticFieldSignature extends TemplateResponseDocum public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentStaticFieldSignature'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string' + 'type' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null + 'type' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'type' => false + 'type' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,8 +108,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -121,7 +117,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +127,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,9 +136,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -151,9 +144,6 @@ 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 { @@ -167,7 +157,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type' + 'type' => 'type', ]; /** @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType' + 'type' => 'setType', ]; /** @@ -185,7 +175,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType' + 'type' => 'getType', ]; /** @@ -229,13 +219,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -244,34 +232,33 @@ public function __construct(?array $data = null) $this->setIfExists('type', $data ?? [], 'signature'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldSignature { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentStaticFieldSignature { /** @var TemplateResponseDocumentStaticFieldSignature */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldSignature::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,7 +294,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -325,23 +311,22 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -350,11 +335,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -365,10 +350,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -381,11 +364,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -393,12 +374,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -427,5 +408,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldText.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldText.php index aaf93f541..246a22dae 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldText.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldText.php @@ -1,14 +1,11 @@ */ class TemplateResponseDocumentStaticFieldText extends TemplateResponseDocumentStaticFieldBase @@ -46,46 +44,46 @@ class TemplateResponseDocumentStaticFieldText extends TemplateResponseDocumentSt public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseDocumentStaticFieldText'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'type' => 'string' + 'type' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'type' => null + 'type' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'type' => false + 'type' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -110,8 +108,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -121,7 +117,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -131,7 +127,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -140,9 +136,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -151,9 +144,6 @@ 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 { @@ -167,7 +157,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type' + 'type' => 'type', ]; /** @@ -176,7 +166,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType' + 'type' => 'setType', ]; /** @@ -185,7 +175,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType' + 'type' => 'getType', ]; /** @@ -229,13 +219,11 @@ public function getModelName() return self::$openAPIModelName; } - - /** * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -244,34 +232,33 @@ public function __construct(?array $data = null) $this->setIfExists('type', $data ?? [], 'text'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldText { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentStaticFieldText { /** @var TemplateResponseDocumentStaticFieldText */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldText::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -307,7 +294,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -325,23 +311,22 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $this->container['type'] = $type; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -350,11 +335,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -365,10 +350,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -381,11 +364,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -393,12 +374,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -427,5 +408,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseFieldAvgTextLength.php b/sdks/php/src/Model/TemplateResponseFieldAvgTextLength.php index 7940f49e4..6fbb12d83 100644 --- a/sdks/php/src/Model/TemplateResponseFieldAvgTextLength.php +++ b/sdks/php/src/Model/TemplateResponseFieldAvgTextLength.php @@ -1,14 +1,11 @@ */ -class TemplateResponseFieldAvgTextLength implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateResponseFieldAvgTextLength implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseFieldAvgTextLength'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'num_lines' => 'int', - 'num_chars_per_line' => 'int' + 'num_chars_per_line' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'num_lines' => null, - 'num_chars_per_line' => null + 'num_chars_per_line' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'num_lines' => false, - 'num_chars_per_line' => false + 'num_chars_per_line' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,8 +113,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -126,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -136,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -145,9 +141,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -156,9 +149,6 @@ 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 { @@ -173,7 +163,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'num_lines' => 'num_lines', - 'num_chars_per_line' => 'num_chars_per_line' + 'num_chars_per_line' => 'num_chars_per_line', ]; /** @@ -183,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'num_lines' => 'setNumLines', - 'num_chars_per_line' => 'setNumCharsPerLine' + 'num_chars_per_line' => 'setNumCharsPerLine', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'num_lines' => 'getNumLines', - 'num_chars_per_line' => 'getNumCharsPerLine' + 'num_chars_per_line' => 'getNumCharsPerLine', ]; /** @@ -237,7 +227,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -249,7 +238,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -257,34 +246,33 @@ public function __construct(?array $data = null) $this->setIfExists('num_chars_per_line', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseFieldAvgTextLength { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseFieldAvgTextLength { /** @var TemplateResponseFieldAvgTextLength */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseFieldAvgTextLength::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -301,9 +289,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -317,7 +303,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets num_lines * @@ -331,14 +316,14 @@ public function getNumLines() /** * Sets num_lines * - * @param int|null $num_lines Number of lines. + * @param int|null $num_lines number of lines * * @return self */ - public function setNumLines($num_lines) + public function setNumLines(?int $num_lines) { if (is_null($num_lines)) { - throw new \InvalidArgumentException('non-nullable num_lines cannot be null'); + throw new InvalidArgumentException('non-nullable num_lines cannot be null'); } $this->container['num_lines'] = $num_lines; @@ -358,27 +343,26 @@ public function getNumCharsPerLine() /** * Sets num_chars_per_line * - * @param int|null $num_chars_per_line Number of characters per line. + * @param int|null $num_chars_per_line number of characters per line * * @return self */ - public function setNumCharsPerLine($num_chars_per_line) + public function setNumCharsPerLine(?int $num_chars_per_line) { if (is_null($num_chars_per_line)) { - throw new \InvalidArgumentException('non-nullable num_chars_per_line cannot be null'); + throw new InvalidArgumentException('non-nullable num_chars_per_line cannot be null'); } $this->container['num_chars_per_line'] = $num_chars_per_line; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -387,11 +371,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -402,10 +386,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -418,11 +400,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -430,12 +410,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -464,5 +444,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateResponseSignerRole.php b/sdks/php/src/Model/TemplateResponseSignerRole.php index 9f00c671e..9d62bf4c7 100644 --- a/sdks/php/src/Model/TemplateResponseSignerRole.php +++ b/sdks/php/src/Model/TemplateResponseSignerRole.php @@ -1,14 +1,11 @@ */ -class TemplateResponseSignerRole implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateResponseSignerRole implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateResponseSignerRole'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', - 'order' => 'int' + 'order' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, - 'order' => null + 'order' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'name' => false, - 'order' => false + 'order' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'name' => 'name', - 'order' => 'order' + 'order' => 'order', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'name' => 'setName', - 'order' => 'setOrder' + 'order' => 'setOrder', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'name' => 'getName', - 'order' => 'getOrder' + 'order' => 'getOrder', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('order', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseSignerRole { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseSignerRole { /** @var TemplateResponseSignerRole */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateResponseSignerRole::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -300,9 +288,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -316,7 +302,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets name * @@ -330,14 +315,14 @@ public function getName() /** * Sets name * - * @param string|null $name The name of the Role. + * @param string|null $name the name of the Role * * @return self */ - public function setName($name) + public function setName(?string $name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + throw new InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; @@ -357,27 +342,26 @@ public function getOrder() /** * Sets order * - * @param int|null $order If signer order is assigned this is the 0-based index for this role. + * @param int|null $order if signer order is assigned this is the 0-based index for this role * * @return self */ - public function setOrder($order) + public function setOrder(?int $order) { if (is_null($order)) { - throw new \InvalidArgumentException('non-nullable order cannot be null'); + throw new InvalidArgumentException('non-nullable order cannot be null'); } $this->container['order'] = $order; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -386,11 +370,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -401,10 +385,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -417,11 +399,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -429,12 +409,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -463,5 +443,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateUpdateFilesRequest.php b/sdks/php/src/Model/TemplateUpdateFilesRequest.php index 6475a935a..2f87773e4 100644 --- a/sdks/php/src/Model/TemplateUpdateFilesRequest.php +++ b/sdks/php/src/Model/TemplateUpdateFilesRequest.php @@ -1,14 +1,11 @@ */ -class TemplateUpdateFilesRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateUpdateFilesRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateUpdateFilesRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'client_id' => 'string', 'files' => '\SplFileObject[]', 'file_urls' => 'string[]', 'message' => 'string', 'subject' => 'string', - 'test_mode' => 'bool' + 'test_mode' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'client_id' => null, 'files' => 'binary', 'file_urls' => null, 'message' => null, 'subject' => null, - 'test_mode' => null + 'test_mode' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'client_id' => false, 'files' => false, 'file_urls' => false, 'message' => false, 'subject' => false, - 'test_mode' => false + 'test_mode' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -126,8 +125,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -137,7 +134,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -147,7 +144,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -156,9 +153,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -167,9 +161,6 @@ 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 { @@ -188,7 +179,7 @@ public function isNullableSetToNull(string $property): bool 'file_urls' => 'file_urls', 'message' => 'message', 'subject' => 'subject', - 'test_mode' => 'test_mode' + 'test_mode' => 'test_mode', ]; /** @@ -202,7 +193,7 @@ public function isNullableSetToNull(string $property): bool 'file_urls' => 'setFileUrls', 'message' => 'setMessage', 'subject' => 'setSubject', - 'test_mode' => 'setTestMode' + 'test_mode' => 'setTestMode', ]; /** @@ -216,7 +207,7 @@ public function isNullableSetToNull(string $property): bool 'file_urls' => 'getFileUrls', 'message' => 'getMessage', 'subject' => 'getSubject', - 'test_mode' => 'getTestMode' + 'test_mode' => 'getTestMode', ]; /** @@ -260,7 +251,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -272,7 +262,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -284,34 +274,33 @@ public function __construct(?array $data = null) $this->setIfExists('test_mode', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateUpdateFilesRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateUpdateFilesRequest { /** @var TemplateUpdateFilesRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateUpdateFilesRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -352,7 +341,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets client_id * @@ -366,14 +354,14 @@ public function getClientId() /** * Sets client_id * - * @param string|null $client_id Client id of the app you're using to update this template. + * @param string|null $client_id client id of the app you're using to update this template * * @return self */ - public function setClientId($client_id) + public function setClientId(?string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -383,7 +371,7 @@ public function setClientId($client_id) /** * Gets files * - * @return \SplFileObject[]|null + * @return SplFileObject[]|null */ public function getFiles() { @@ -393,14 +381,14 @@ public function getFiles() /** * Sets files * - * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles($files) + public function setFiles(?array $files) { if (is_null($files)) { - throw new \InvalidArgumentException('non-nullable files cannot be null'); + throw new InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -424,10 +412,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls($file_urls) + public function setFileUrls(?array $file_urls) { if (is_null($file_urls)) { - throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -447,17 +435,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message The new default template email message. + * @param string|null $message the new default template email message * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + throw new InvalidArgumentException('non-nullable message cannot be null'); } - if ((mb_strlen($message) > 5000)) { - throw new \InvalidArgumentException('invalid length for $message when calling TemplateUpdateFilesRequest., must be smaller than or equal to 5000.'); + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling TemplateUpdateFilesRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -478,17 +466,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject The new default template email subject. + * @param string|null $subject the new default template email subject * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { - throw new \InvalidArgumentException('non-nullable subject cannot be null'); + throw new InvalidArgumentException('non-nullable subject cannot be null'); } - if ((mb_strlen($subject) > 100)) { - throw new \InvalidArgumentException('invalid length for $subject when calling TemplateUpdateFilesRequest., must be smaller than or equal to 100.'); + if (mb_strlen($subject) > 100) { + throw new InvalidArgumentException('invalid length for $subject when calling TemplateUpdateFilesRequest., must be smaller than or equal to 100.'); } $this->container['subject'] = $subject; @@ -513,23 +501,22 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -538,11 +525,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -553,10 +540,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -569,11 +554,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -581,12 +564,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -615,5 +598,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateUpdateFilesResponse.php b/sdks/php/src/Model/TemplateUpdateFilesResponse.php index 5c0880af9..de4fb8bbb 100644 --- a/sdks/php/src/Model/TemplateUpdateFilesResponse.php +++ b/sdks/php/src/Model/TemplateUpdateFilesResponse.php @@ -1,14 +1,11 @@ */ -class TemplateUpdateFilesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateUpdateFilesResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateUpdateFilesResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'template' => '\Dropbox\Sign\Model\TemplateUpdateFilesResponseTemplate' + 'template' => '\Dropbox\Sign\Model\TemplateUpdateFilesResponseTemplate', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'template' => null + 'template' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ - 'template' => false + 'template' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -111,8 +109,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -122,7 +118,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -132,7 +128,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -141,9 +137,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -152,9 +145,6 @@ 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 { @@ -168,7 +158,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'template' => 'template' + 'template' => 'template', ]; /** @@ -177,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'template' => 'setTemplate' + 'template' => 'setTemplate', ]; /** @@ -186,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'template' => 'getTemplate' + 'template' => 'getTemplate', ]; /** @@ -230,7 +220,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -242,41 +231,40 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { $this->setIfExists('template', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateUpdateFilesResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateUpdateFilesResponse { /** @var TemplateUpdateFilesResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateUpdateFilesResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -312,7 +300,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets template * @@ -330,23 +317,22 @@ public function getTemplate() * * @return self */ - public function setTemplate($template) + public function setTemplate(TemplateUpdateFilesResponseTemplate $template) { if (is_null($template)) { - throw new \InvalidArgumentException('non-nullable template cannot be null'); + throw new InvalidArgumentException('non-nullable template cannot be null'); } $this->container['template'] = $template; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -355,11 +341,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -370,10 +356,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -386,11 +370,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -398,12 +380,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -432,5 +414,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/TemplateUpdateFilesResponseTemplate.php b/sdks/php/src/Model/TemplateUpdateFilesResponseTemplate.php index 09674407d..4f112b637 100644 --- a/sdks/php/src/Model/TemplateUpdateFilesResponseTemplate.php +++ b/sdks/php/src/Model/TemplateUpdateFilesResponseTemplate.php @@ -1,14 +1,11 @@ */ -class TemplateUpdateFilesResponseTemplate implements ModelInterface, ArrayAccess, \JsonSerializable +class TemplateUpdateFilesResponseTemplate implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TemplateUpdateFilesResponseTemplate'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'template_id' => 'string', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'template_id' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'template_id' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,8 +113,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -126,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -136,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -145,9 +141,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -156,9 +149,6 @@ 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 { @@ -173,7 +163,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'template_id' => 'template_id', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -183,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'template_id' => 'setTemplateId', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'template_id' => 'getTemplateId', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -237,7 +227,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -249,7 +238,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -257,34 +246,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateUpdateFilesResponseTemplate { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateUpdateFilesResponseTemplate { /** @var TemplateUpdateFilesResponseTemplate */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, TemplateUpdateFilesResponseTemplate::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -301,9 +289,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -317,7 +303,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets template_id * @@ -331,14 +316,14 @@ public function getTemplateId() /** * Sets template_id * - * @param string|null $template_id The id of the Template. + * @param string|null $template_id the id of the Template * * @return self */ - public function setTemplateId($template_id) + public function setTemplateId(?string $template_id) { if (is_null($template_id)) { - throw new \InvalidArgumentException('non-nullable template_id cannot be null'); + throw new InvalidArgumentException('non-nullable template_id cannot be null'); } $this->container['template_id'] = $template_id; @@ -359,28 +344,27 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self * @deprecated */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -389,11 +373,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -404,10 +388,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -420,11 +402,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -432,12 +412,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -466,5 +446,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedRequest.php b/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedRequest.php index 5176ef199..9d42586b0 100644 --- a/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedRequest.php +++ b/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedRequest.php @@ -1,14 +1,11 @@ */ -class UnclaimedDraftCreateEmbeddedRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class UnclaimedDraftCreateEmbeddedRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'UnclaimedDraftCreateEmbeddedRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'client_id' => 'string', 'requester_email_address' => 'string', @@ -95,16 +94,16 @@ class UnclaimedDraftCreateEmbeddedRequest implements ModelInterface, ArrayAccess 'use_preexisting_fields' => 'bool', 'use_text_tags' => 'bool', 'populate_auto_fill_fields' => 'bool', - 'expires_at' => 'int' + 'expires_at' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'client_id' => null, 'requester_email_address' => 'email', @@ -141,14 +140,14 @@ class UnclaimedDraftCreateEmbeddedRequest implements ModelInterface, ArrayAccess 'use_preexisting_fields' => null, 'use_text_tags' => null, 'populate_auto_fill_fields' => null, - 'expires_at' => null + 'expires_at' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'client_id' => false, 'requester_email_address' => false, @@ -185,14 +184,14 @@ class UnclaimedDraftCreateEmbeddedRequest implements ModelInterface, ArrayAccess 'use_preexisting_fields' => false, 'use_text_tags' => false, 'populate_auto_fill_fields' => false, - 'expires_at' => true + 'expires_at' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -217,8 +216,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -228,7 +225,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -238,7 +235,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -247,9 +244,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -258,9 +252,6 @@ 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 { @@ -309,7 +300,7 @@ public function isNullableSetToNull(string $property): bool 'use_preexisting_fields' => 'use_preexisting_fields', 'use_text_tags' => 'use_text_tags', 'populate_auto_fill_fields' => 'populate_auto_fill_fields', - 'expires_at' => 'expires_at' + 'expires_at' => 'expires_at', ]; /** @@ -353,7 +344,7 @@ public function isNullableSetToNull(string $property): bool 'use_preexisting_fields' => 'setUsePreexistingFields', 'use_text_tags' => 'setUseTextTags', 'populate_auto_fill_fields' => 'setPopulateAutoFillFields', - 'expires_at' => 'setExpiresAt' + 'expires_at' => 'setExpiresAt', ]; /** @@ -397,7 +388,7 @@ public function isNullableSetToNull(string $property): bool 'use_preexisting_fields' => 'getUsePreexistingFields', 'use_text_tags' => 'getUseTextTags', 'populate_auto_fill_fields' => 'getPopulateAutoFillFields', - 'expires_at' => 'getExpiresAt' + 'expires_at' => 'getExpiresAt', ]; /** @@ -468,7 +459,7 @@ public function getTypeAllowableValues() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -510,34 +501,33 @@ public function __construct(?array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): UnclaimedDraftCreateEmbeddedRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): UnclaimedDraftCreateEmbeddedRequest { /** @var UnclaimedDraftCreateEmbeddedRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, UnclaimedDraftCreateEmbeddedRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -593,7 +583,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets client_id * @@ -611,10 +600,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -634,14 +623,14 @@ public function getRequesterEmailAddress() /** * Sets requester_email_address * - * @param string $requester_email_address The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. + * @param string $requester_email_address the email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature` * * @return self */ - public function setRequesterEmailAddress($requester_email_address) + public function setRequesterEmailAddress(string $requester_email_address) { if (is_null($requester_email_address)) { - throw new \InvalidArgumentException('non-nullable requester_email_address cannot be null'); + throw new InvalidArgumentException('non-nullable requester_email_address cannot be null'); } $this->container['requester_email_address'] = $requester_email_address; @@ -651,7 +640,7 @@ public function setRequesterEmailAddress($requester_email_address) /** * Gets files * - * @return \SplFileObject[]|null + * @return SplFileObject[]|null */ public function getFiles() { @@ -661,14 +650,14 @@ public function getFiles() /** * Sets files * - * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles($files) + public function setFiles(?array $files) { if (is_null($files)) { - throw new \InvalidArgumentException('non-nullable files cannot be null'); + throw new InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -692,10 +681,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls($file_urls) + public function setFileUrls(?array $file_urls) { if (is_null($file_urls)) { - throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -715,14 +704,14 @@ public function getAllowCcs() /** * Sets allow_ccs * - * @param bool|null $allow_ccs This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. + * @param bool|null $allow_ccs this allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft * * @return self */ - public function setAllowCcs($allow_ccs) + public function setAllowCcs(?bool $allow_ccs) { if (is_null($allow_ccs)) { - throw new \InvalidArgumentException('non-nullable allow_ccs cannot be null'); + throw new InvalidArgumentException('non-nullable allow_ccs cannot be null'); } $this->container['allow_ccs'] = $allow_ccs; @@ -746,10 +735,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline($allow_decline) + public function setAllowDecline(?bool $allow_decline) { if (is_null($allow_decline)) { - throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -773,10 +762,10 @@ public function getAllowReassign() * * @return self */ - public function setAllowReassign($allow_reassign) + public function setAllowReassign(?bool $allow_reassign) { if (is_null($allow_reassign)) { - throw new \InvalidArgumentException('non-nullable allow_reassign cannot be null'); + throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); } $this->container['allow_reassign'] = $allow_reassign; @@ -800,10 +789,10 @@ public function getAttachments() * * @return self */ - public function setAttachments($attachments) + public function setAttachments(?array $attachments) { if (is_null($attachments)) { - throw new \InvalidArgumentException('non-nullable attachments cannot be null'); + throw new InvalidArgumentException('non-nullable attachments cannot be null'); } $this->container['attachments'] = $attachments; @@ -823,14 +812,14 @@ public function getCcEmailAddresses() /** * Sets cc_email_addresses * - * @param string[]|null $cc_email_addresses The email addresses that should be CCed. + * @param string[]|null $cc_email_addresses the email addresses that should be CCed * * @return self */ - public function setCcEmailAddresses($cc_email_addresses) + public function setCcEmailAddresses(?array $cc_email_addresses) { if (is_null($cc_email_addresses)) { - throw new \InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); } $this->container['cc_email_addresses'] = $cc_email_addresses; @@ -854,10 +843,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields($custom_fields) + public function setCustomFields(?array $custom_fields) { if (is_null($custom_fields)) { - throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -881,10 +870,10 @@ public function getEditorOptions() * * @return self */ - public function setEditorOptions($editor_options) + public function setEditorOptions(?SubEditorOptions $editor_options) { if (is_null($editor_options)) { - throw new \InvalidArgumentException('non-nullable editor_options cannot be null'); + throw new InvalidArgumentException('non-nullable editor_options cannot be null'); } $this->container['editor_options'] = $editor_options; @@ -908,10 +897,10 @@ public function getFieldOptions() * * @return self */ - public function setFieldOptions($field_options) + public function setFieldOptions(?SubFieldOptions $field_options) { if (is_null($field_options)) { - throw new \InvalidArgumentException('non-nullable field_options cannot be null'); + throw new InvalidArgumentException('non-nullable field_options cannot be null'); } $this->container['field_options'] = $field_options; @@ -931,14 +920,14 @@ public function getForceSignerPage() /** * Sets force_signer_page * - * @param bool|null $force_signer_page Provide users the ability to review/edit the signers. + * @param bool|null $force_signer_page provide users the ability to review/edit the signers * * @return self */ - public function setForceSignerPage($force_signer_page) + public function setForceSignerPage(?bool $force_signer_page) { if (is_null($force_signer_page)) { - throw new \InvalidArgumentException('non-nullable force_signer_page cannot be null'); + throw new InvalidArgumentException('non-nullable force_signer_page cannot be null'); } $this->container['force_signer_page'] = $force_signer_page; @@ -958,14 +947,14 @@ public function getForceSubjectMessage() /** * Sets force_subject_message * - * @param bool|null $force_subject_message Provide users the ability to review/edit the subject and message. + * @param bool|null $force_subject_message provide users the ability to review/edit the subject and message * * @return self */ - public function setForceSubjectMessage($force_subject_message) + public function setForceSubjectMessage(?bool $force_subject_message) { if (is_null($force_subject_message)) { - throw new \InvalidArgumentException('non-nullable force_subject_message cannot be null'); + throw new InvalidArgumentException('non-nullable force_subject_message cannot be null'); } $this->container['force_subject_message'] = $force_subject_message; @@ -989,10 +978,10 @@ public function getFormFieldGroups() * * @return self */ - public function setFormFieldGroups($form_field_groups) + public function setFormFieldGroups(?array $form_field_groups) { if (is_null($form_field_groups)) { - throw new \InvalidArgumentException('non-nullable form_field_groups cannot be null'); + throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); } $this->container['form_field_groups'] = $form_field_groups; @@ -1012,14 +1001,14 @@ public function getFormFieldRules() /** * Sets form_field_rules * - * @param SubFormFieldRule[]|null $form_field_rules Conditional Logic rules for fields defined in `form_fields_per_document`. + * @param SubFormFieldRule[]|null $form_field_rules conditional Logic rules for fields defined in `form_fields_per_document` * * @return self */ - public function setFormFieldRules($form_field_rules) + public function setFormFieldRules(?array $form_field_rules) { if (is_null($form_field_rules)) { - throw new \InvalidArgumentException('non-nullable form_field_rules cannot be null'); + throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); } $this->container['form_field_rules'] = $form_field_rules; @@ -1043,10 +1032,10 @@ public function getFormFieldsPerDocument() * * @return self */ - public function setFormFieldsPerDocument($form_fields_per_document) + public function setFormFieldsPerDocument(?array $form_fields_per_document) { if (is_null($form_fields_per_document)) { - throw new \InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); } $this->container['form_fields_per_document'] = $form_fields_per_document; @@ -1070,10 +1059,10 @@ public function getHideTextTags() * * @return self */ - public function setHideTextTags($hide_text_tags) + public function setHideTextTags(?bool $hide_text_tags) { if (is_null($hide_text_tags)) { - throw new \InvalidArgumentException('non-nullable hide_text_tags cannot be null'); + throw new InvalidArgumentException('non-nullable hide_text_tags cannot be null'); } $this->container['hide_text_tags'] = $hide_text_tags; @@ -1097,10 +1086,10 @@ public function getHoldRequest() * * @return self */ - public function setHoldRequest($hold_request) + public function setHoldRequest(?bool $hold_request) { if (is_null($hold_request)) { - throw new \InvalidArgumentException('non-nullable hold_request cannot be null'); + throw new InvalidArgumentException('non-nullable hold_request cannot be null'); } $this->container['hold_request'] = $hold_request; @@ -1124,10 +1113,10 @@ public function getIsForEmbeddedSigning() * * @return self */ - public function setIsForEmbeddedSigning($is_for_embedded_signing) + public function setIsForEmbeddedSigning(?bool $is_for_embedded_signing) { if (is_null($is_for_embedded_signing)) { - throw new \InvalidArgumentException('non-nullable is_for_embedded_signing cannot be null'); + throw new InvalidArgumentException('non-nullable is_for_embedded_signing cannot be null'); } $this->container['is_for_embedded_signing'] = $is_for_embedded_signing; @@ -1147,17 +1136,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message The custom message in the email that will be sent to the signers. + * @param string|null $message the custom message in the email that will be sent to the signers * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + throw new InvalidArgumentException('non-nullable message cannot be null'); } - if ((mb_strlen($message) > 5000)) { - throw new \InvalidArgumentException('invalid length for $message when calling UnclaimedDraftCreateEmbeddedRequest., must be smaller than or equal to 5000.'); + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling UnclaimedDraftCreateEmbeddedRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -1182,13 +1171,12 @@ public function getMetadata() * * @return self */ - public function setMetadata($metadata) + public function setMetadata(?array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } - $this->container['metadata'] = $metadata; return $this; @@ -1207,14 +1195,14 @@ public function getRequestingRedirectUrl() /** * Sets requesting_redirect_url * - * @param string|null $requesting_redirect_url The URL you want signers redirected to after they successfully request a signature. + * @param string|null $requesting_redirect_url the URL you want signers redirected to after they successfully request a signature * * @return self */ - public function setRequestingRedirectUrl($requesting_redirect_url) + public function setRequestingRedirectUrl(?string $requesting_redirect_url) { if (is_null($requesting_redirect_url)) { - throw new \InvalidArgumentException('non-nullable requesting_redirect_url cannot be null'); + throw new InvalidArgumentException('non-nullable requesting_redirect_url cannot be null'); } $this->container['requesting_redirect_url'] = $requesting_redirect_url; @@ -1238,10 +1226,10 @@ public function getShowPreview() * * @return self */ - public function setShowPreview($show_preview) + public function setShowPreview(?bool $show_preview) { if (is_null($show_preview)) { - throw new \InvalidArgumentException('non-nullable show_preview cannot be null'); + throw new InvalidArgumentException('non-nullable show_preview cannot be null'); } $this->container['show_preview'] = $show_preview; @@ -1261,14 +1249,14 @@ public function getShowProgressStepper() /** * Sets show_progress_stepper * - * @param bool|null $show_progress_stepper When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. + * @param bool|null $show_progress_stepper when only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden * * @return self */ - public function setShowProgressStepper($show_progress_stepper) + public function setShowProgressStepper(?bool $show_progress_stepper) { if (is_null($show_progress_stepper)) { - throw new \InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); + throw new InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); } $this->container['show_progress_stepper'] = $show_progress_stepper; @@ -1288,14 +1276,14 @@ public function getSigners() /** * Sets signers * - * @param SubUnclaimedDraftSigner[]|null $signers Add Signers to your Unclaimed Draft Signature Request. + * @param SubUnclaimedDraftSigner[]|null $signers add Signers to your Unclaimed Draft Signature Request * * @return self */ - public function setSigners($signers) + public function setSigners(?array $signers) { if (is_null($signers)) { - throw new \InvalidArgumentException('non-nullable signers cannot be null'); + throw new InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -1319,10 +1307,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions($signing_options) + public function setSigningOptions(?SubSigningOptions $signing_options) { if (is_null($signing_options)) { - throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -1342,14 +1330,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. + * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign * * @return self */ - public function setSigningRedirectUrl($signing_redirect_url) + public function setSigningRedirectUrl(?string $signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -1373,10 +1361,10 @@ public function getSkipMeNow() * * @return self */ - public function setSkipMeNow($skip_me_now) + public function setSkipMeNow(?bool $skip_me_now) { if (is_null($skip_me_now)) { - throw new \InvalidArgumentException('non-nullable skip_me_now cannot be null'); + throw new InvalidArgumentException('non-nullable skip_me_now cannot be null'); } $this->container['skip_me_now'] = $skip_me_now; @@ -1396,17 +1384,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject The subject in the email that will be sent to the signers. + * @param string|null $subject the subject in the email that will be sent to the signers * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { - throw new \InvalidArgumentException('non-nullable subject cannot be null'); + throw new InvalidArgumentException('non-nullable subject cannot be null'); } - if ((mb_strlen($subject) > 200)) { - throw new \InvalidArgumentException('invalid length for $subject when calling UnclaimedDraftCreateEmbeddedRequest., must be smaller than or equal to 200.'); + if (mb_strlen($subject) > 200) { + throw new InvalidArgumentException('invalid length for $subject when calling UnclaimedDraftCreateEmbeddedRequest., must be smaller than or equal to 200.'); } $this->container['subject'] = $subject; @@ -1431,10 +1419,10 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -1458,14 +1446,14 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(?string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'type', must be one of '%s'", $type, @@ -1495,10 +1483,10 @@ public function getUsePreexistingFields() * * @return self */ - public function setUsePreexistingFields($use_preexisting_fields) + public function setUsePreexistingFields(?bool $use_preexisting_fields) { if (is_null($use_preexisting_fields)) { - throw new \InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); + throw new InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); } $this->container['use_preexisting_fields'] = $use_preexisting_fields; @@ -1522,10 +1510,10 @@ public function getUseTextTags() * * @return self */ - public function setUseTextTags($use_text_tags) + public function setUseTextTags(?bool $use_text_tags) { if (is_null($use_text_tags)) { - throw new \InvalidArgumentException('non-nullable use_text_tags cannot be null'); + throw new InvalidArgumentException('non-nullable use_text_tags cannot be null'); } $this->container['use_text_tags'] = $use_text_tags; @@ -1549,10 +1537,10 @@ public function getPopulateAutoFillFields() * * @return self */ - public function setPopulateAutoFillFields($populate_auto_fill_fields) + public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) { if (is_null($populate_auto_fill_fields)) { - throw new \InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); + throw new InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); } $this->container['populate_auto_fill_fields'] = $populate_auto_fill_fields; @@ -1576,13 +1564,13 @@ public function getExpiresAt() * * @return self */ - public function setExpiresAt($expires_at) + public function setExpiresAt(?int $expires_at) { if (is_null($expires_at)) { array_push($this->openAPINullablesSetToNull, 'expires_at'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('expires_at', $nullablesSetToNull, true); + $index = array_search('expires_at', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1592,14 +1580,13 @@ public function setExpiresAt($expires_at) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1608,11 +1595,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1623,10 +1610,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1639,11 +1624,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1651,12 +1634,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1685,5 +1668,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.php b/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.php index 265cfdde2..b96ad7c30 100644 --- a/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.php +++ b/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.php @@ -1,14 +1,11 @@ */ -class UnclaimedDraftCreateEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class UnclaimedDraftCreateEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'UnclaimedDraftCreateEmbeddedWithTemplateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'client_id' => 'string', 'requester_email_address' => 'string', @@ -88,16 +87,16 @@ class UnclaimedDraftCreateEmbeddedWithTemplateRequest implements ModelInterface, 'test_mode' => 'bool', 'title' => 'string', 'populate_auto_fill_fields' => 'bool', - 'allow_ccs' => 'bool' + 'allow_ccs' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'client_id' => null, 'requester_email_address' => 'email', @@ -128,14 +127,14 @@ class UnclaimedDraftCreateEmbeddedWithTemplateRequest implements ModelInterface, 'test_mode' => null, 'title' => null, 'populate_auto_fill_fields' => null, - 'allow_ccs' => null + 'allow_ccs' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'client_id' => false, 'requester_email_address' => false, @@ -166,14 +165,14 @@ class UnclaimedDraftCreateEmbeddedWithTemplateRequest implements ModelInterface, 'test_mode' => false, 'title' => false, 'populate_auto_fill_fields' => false, - 'allow_ccs' => false + 'allow_ccs' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -198,8 +197,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -209,7 +206,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -219,7 +216,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -228,9 +225,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -239,9 +233,6 @@ 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 { @@ -284,7 +275,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'test_mode', 'title' => 'title', 'populate_auto_fill_fields' => 'populate_auto_fill_fields', - 'allow_ccs' => 'allow_ccs' + 'allow_ccs' => 'allow_ccs', ]; /** @@ -322,7 +313,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'setTestMode', 'title' => 'setTitle', 'populate_auto_fill_fields' => 'setPopulateAutoFillFields', - 'allow_ccs' => 'setAllowCcs' + 'allow_ccs' => 'setAllowCcs', ]; /** @@ -360,7 +351,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'getTestMode', 'title' => 'getTitle', 'populate_auto_fill_fields' => 'getPopulateAutoFillFields', - 'allow_ccs' => 'getAllowCcs' + 'allow_ccs' => 'getAllowCcs', ]; /** @@ -404,7 +395,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -416,7 +406,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -452,34 +442,33 @@ public function __construct(?array $data = null) $this->setIfExists('allow_ccs', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): UnclaimedDraftCreateEmbeddedWithTemplateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): UnclaimedDraftCreateEmbeddedWithTemplateRequest { /** @var UnclaimedDraftCreateEmbeddedWithTemplateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, UnclaimedDraftCreateEmbeddedWithTemplateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -533,7 +522,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets client_id * @@ -551,10 +539,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -574,14 +562,14 @@ public function getRequesterEmailAddress() /** * Sets requester_email_address * - * @param string $requester_email_address The email address of the user that should be designated as the requester of this draft. + * @param string $requester_email_address the email address of the user that should be designated as the requester of this draft * * @return self */ - public function setRequesterEmailAddress($requester_email_address) + public function setRequesterEmailAddress(string $requester_email_address) { if (is_null($requester_email_address)) { - throw new \InvalidArgumentException('non-nullable requester_email_address cannot be null'); + throw new InvalidArgumentException('non-nullable requester_email_address cannot be null'); } $this->container['requester_email_address'] = $requester_email_address; @@ -601,14 +589,14 @@ public function getTemplateIds() /** * Sets template_ids * - * @param string[] $template_ids Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. + * @param string[] $template_ids use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used * * @return self */ - public function setTemplateIds($template_ids) + public function setTemplateIds(array $template_ids) { if (is_null($template_ids)) { - throw new \InvalidArgumentException('non-nullable template_ids cannot be null'); + throw new InvalidArgumentException('non-nullable template_ids cannot be null'); } $this->container['template_ids'] = $template_ids; @@ -632,10 +620,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline($allow_decline) + public function setAllowDecline(?bool $allow_decline) { if (is_null($allow_decline)) { - throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -659,10 +647,10 @@ public function getAllowReassign() * * @return self */ - public function setAllowReassign($allow_reassign) + public function setAllowReassign(?bool $allow_reassign) { if (is_null($allow_reassign)) { - throw new \InvalidArgumentException('non-nullable allow_reassign cannot be null'); + throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); } $this->container['allow_reassign'] = $allow_reassign; @@ -686,10 +674,10 @@ public function getCcs() * * @return self */ - public function setCcs($ccs) + public function setCcs(?array $ccs) { if (is_null($ccs)) { - throw new \InvalidArgumentException('non-nullable ccs cannot be null'); + throw new InvalidArgumentException('non-nullable ccs cannot be null'); } $this->container['ccs'] = $ccs; @@ -713,10 +701,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields($custom_fields) + public function setCustomFields(?array $custom_fields) { if (is_null($custom_fields)) { - throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -740,10 +728,10 @@ public function getEditorOptions() * * @return self */ - public function setEditorOptions($editor_options) + public function setEditorOptions(?SubEditorOptions $editor_options) { if (is_null($editor_options)) { - throw new \InvalidArgumentException('non-nullable editor_options cannot be null'); + throw new InvalidArgumentException('non-nullable editor_options cannot be null'); } $this->container['editor_options'] = $editor_options; @@ -767,10 +755,10 @@ public function getFieldOptions() * * @return self */ - public function setFieldOptions($field_options) + public function setFieldOptions(?SubFieldOptions $field_options) { if (is_null($field_options)) { - throw new \InvalidArgumentException('non-nullable field_options cannot be null'); + throw new InvalidArgumentException('non-nullable field_options cannot be null'); } $this->container['field_options'] = $field_options; @@ -780,7 +768,7 @@ public function setFieldOptions($field_options) /** * Gets files * - * @return \SplFileObject[]|null + * @return SplFileObject[]|null */ public function getFiles() { @@ -790,14 +778,14 @@ public function getFiles() /** * Sets files * - * @param \SplFileObject[]|null $files Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both. + * @param SplFileObject[]|null $files Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both. * * @return self */ - public function setFiles($files) + public function setFiles(?array $files) { if (is_null($files)) { - throw new \InvalidArgumentException('non-nullable files cannot be null'); + throw new InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -821,10 +809,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls($file_urls) + public function setFileUrls(?array $file_urls) { if (is_null($file_urls)) { - throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -844,14 +832,14 @@ public function getForceSignerRoles() /** * Sets force_signer_roles * - * @param bool|null $force_signer_roles Provide users the ability to review/edit the template signer roles. + * @param bool|null $force_signer_roles provide users the ability to review/edit the template signer roles * * @return self */ - public function setForceSignerRoles($force_signer_roles) + public function setForceSignerRoles(?bool $force_signer_roles) { if (is_null($force_signer_roles)) { - throw new \InvalidArgumentException('non-nullable force_signer_roles cannot be null'); + throw new InvalidArgumentException('non-nullable force_signer_roles cannot be null'); } $this->container['force_signer_roles'] = $force_signer_roles; @@ -871,14 +859,14 @@ public function getForceSubjectMessage() /** * Sets force_subject_message * - * @param bool|null $force_subject_message Provide users the ability to review/edit the template subject and message. + * @param bool|null $force_subject_message provide users the ability to review/edit the template subject and message * * @return self */ - public function setForceSubjectMessage($force_subject_message) + public function setForceSubjectMessage(?bool $force_subject_message) { if (is_null($force_subject_message)) { - throw new \InvalidArgumentException('non-nullable force_subject_message cannot be null'); + throw new InvalidArgumentException('non-nullable force_subject_message cannot be null'); } $this->container['force_subject_message'] = $force_subject_message; @@ -902,10 +890,10 @@ public function getHoldRequest() * * @return self */ - public function setHoldRequest($hold_request) + public function setHoldRequest(?bool $hold_request) { if (is_null($hold_request)) { - throw new \InvalidArgumentException('non-nullable hold_request cannot be null'); + throw new InvalidArgumentException('non-nullable hold_request cannot be null'); } $this->container['hold_request'] = $hold_request; @@ -929,10 +917,10 @@ public function getIsForEmbeddedSigning() * * @return self */ - public function setIsForEmbeddedSigning($is_for_embedded_signing) + public function setIsForEmbeddedSigning(?bool $is_for_embedded_signing) { if (is_null($is_for_embedded_signing)) { - throw new \InvalidArgumentException('non-nullable is_for_embedded_signing cannot be null'); + throw new InvalidArgumentException('non-nullable is_for_embedded_signing cannot be null'); } $this->container['is_for_embedded_signing'] = $is_for_embedded_signing; @@ -952,17 +940,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message The custom message in the email that will be sent to the signers. + * @param string|null $message the custom message in the email that will be sent to the signers * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + throw new InvalidArgumentException('non-nullable message cannot be null'); } - if ((mb_strlen($message) > 5000)) { - throw new \InvalidArgumentException('invalid length for $message when calling UnclaimedDraftCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling UnclaimedDraftCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -987,13 +975,12 @@ public function getMetadata() * * @return self */ - public function setMetadata($metadata) + public function setMetadata(?array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } - $this->container['metadata'] = $metadata; return $this; @@ -1016,10 +1003,10 @@ public function getPreviewOnly() * * @return self */ - public function setPreviewOnly($preview_only) + public function setPreviewOnly(?bool $preview_only) { if (is_null($preview_only)) { - throw new \InvalidArgumentException('non-nullable preview_only cannot be null'); + throw new InvalidArgumentException('non-nullable preview_only cannot be null'); } $this->container['preview_only'] = $preview_only; @@ -1039,14 +1026,14 @@ public function getRequestingRedirectUrl() /** * Sets requesting_redirect_url * - * @param string|null $requesting_redirect_url The URL you want signers redirected to after they successfully request a signature. + * @param string|null $requesting_redirect_url the URL you want signers redirected to after they successfully request a signature * * @return self */ - public function setRequestingRedirectUrl($requesting_redirect_url) + public function setRequestingRedirectUrl(?string $requesting_redirect_url) { if (is_null($requesting_redirect_url)) { - throw new \InvalidArgumentException('non-nullable requesting_redirect_url cannot be null'); + throw new InvalidArgumentException('non-nullable requesting_redirect_url cannot be null'); } $this->container['requesting_redirect_url'] = $requesting_redirect_url; @@ -1070,10 +1057,10 @@ public function getShowPreview() * * @return self */ - public function setShowPreview($show_preview) + public function setShowPreview(?bool $show_preview) { if (is_null($show_preview)) { - throw new \InvalidArgumentException('non-nullable show_preview cannot be null'); + throw new InvalidArgumentException('non-nullable show_preview cannot be null'); } $this->container['show_preview'] = $show_preview; @@ -1093,14 +1080,14 @@ public function getShowProgressStepper() /** * Sets show_progress_stepper * - * @param bool|null $show_progress_stepper When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. + * @param bool|null $show_progress_stepper when only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden * * @return self */ - public function setShowProgressStepper($show_progress_stepper) + public function setShowProgressStepper(?bool $show_progress_stepper) { if (is_null($show_progress_stepper)) { - throw new \InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); + throw new InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); } $this->container['show_progress_stepper'] = $show_progress_stepper; @@ -1120,14 +1107,14 @@ public function getSigners() /** * Sets signers * - * @param SubUnclaimedDraftTemplateSigner[]|null $signers Add Signers to your Templated-based Signature Request. + * @param SubUnclaimedDraftTemplateSigner[]|null $signers add Signers to your Templated-based Signature Request * * @return self */ - public function setSigners($signers) + public function setSigners(?array $signers) { if (is_null($signers)) { - throw new \InvalidArgumentException('non-nullable signers cannot be null'); + throw new InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -1151,10 +1138,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions($signing_options) + public function setSigningOptions(?SubSigningOptions $signing_options) { if (is_null($signing_options)) { - throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -1174,14 +1161,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. + * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign * * @return self */ - public function setSigningRedirectUrl($signing_redirect_url) + public function setSigningRedirectUrl(?string $signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -1205,10 +1192,10 @@ public function getSkipMeNow() * * @return self */ - public function setSkipMeNow($skip_me_now) + public function setSkipMeNow(?bool $skip_me_now) { if (is_null($skip_me_now)) { - throw new \InvalidArgumentException('non-nullable skip_me_now cannot be null'); + throw new InvalidArgumentException('non-nullable skip_me_now cannot be null'); } $this->container['skip_me_now'] = $skip_me_now; @@ -1228,17 +1215,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject The subject in the email that will be sent to the signers. + * @param string|null $subject the subject in the email that will be sent to the signers * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { - throw new \InvalidArgumentException('non-nullable subject cannot be null'); + throw new InvalidArgumentException('non-nullable subject cannot be null'); } - if ((mb_strlen($subject) > 255)) { - throw new \InvalidArgumentException('invalid length for $subject when calling UnclaimedDraftCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); + if (mb_strlen($subject) > 255) { + throw new InvalidArgumentException('invalid length for $subject when calling UnclaimedDraftCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['subject'] = $subject; @@ -1263,10 +1250,10 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -1286,17 +1273,17 @@ public function getTitle() /** * Sets title * - * @param string|null $title The title you want to assign to the SignatureRequest. + * @param string|null $title the title you want to assign to the SignatureRequest * * @return self */ - public function setTitle($title) + public function setTitle(?string $title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + throw new InvalidArgumentException('non-nullable title cannot be null'); } - if ((mb_strlen($title) > 255)) { - throw new \InvalidArgumentException('invalid length for $title when calling UnclaimedDraftCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); + if (mb_strlen($title) > 255) { + throw new InvalidArgumentException('invalid length for $title when calling UnclaimedDraftCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } $this->container['title'] = $title; @@ -1321,10 +1308,10 @@ public function getPopulateAutoFillFields() * * @return self */ - public function setPopulateAutoFillFields($populate_auto_fill_fields) + public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) { if (is_null($populate_auto_fill_fields)) { - throw new \InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); + throw new InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); } $this->container['populate_auto_fill_fields'] = $populate_auto_fill_fields; @@ -1344,27 +1331,26 @@ public function getAllowCcs() /** * Sets allow_ccs * - * @param bool|null $allow_ccs This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. + * @param bool|null $allow_ccs this allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft * * @return self */ - public function setAllowCcs($allow_ccs) + public function setAllowCcs(?bool $allow_ccs) { if (is_null($allow_ccs)) { - throw new \InvalidArgumentException('non-nullable allow_ccs cannot be null'); + throw new InvalidArgumentException('non-nullable allow_ccs cannot be null'); } $this->container['allow_ccs'] = $allow_ccs; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1373,11 +1359,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1388,10 +1374,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1404,11 +1388,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1416,12 +1398,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1450,5 +1432,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/UnclaimedDraftCreateRequest.php b/sdks/php/src/Model/UnclaimedDraftCreateRequest.php index 8afe4e54e..89b665f5c 100644 --- a/sdks/php/src/Model/UnclaimedDraftCreateRequest.php +++ b/sdks/php/src/Model/UnclaimedDraftCreateRequest.php @@ -1,14 +1,11 @@ */ -class UnclaimedDraftCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class UnclaimedDraftCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'UnclaimedDraftCreateRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'files' => '\SplFileObject[]', @@ -83,16 +82,16 @@ class UnclaimedDraftCreateRequest implements ModelInterface, ArrayAccess, \JsonS 'test_mode' => 'bool', 'use_preexisting_fields' => 'bool', 'use_text_tags' => 'bool', - 'expires_at' => 'int' + 'expires_at' => 'int', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'files' => 'binary', @@ -117,14 +116,14 @@ class UnclaimedDraftCreateRequest implements ModelInterface, ArrayAccess, \JsonS 'test_mode' => null, 'use_preexisting_fields' => null, 'use_text_tags' => null, - 'expires_at' => null + 'expires_at' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'type' => false, 'files' => false, @@ -149,14 +148,14 @@ class UnclaimedDraftCreateRequest implements ModelInterface, ArrayAccess, \JsonS 'test_mode' => false, 'use_preexisting_fields' => false, 'use_text_tags' => false, - 'expires_at' => true + 'expires_at' => true, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -181,8 +180,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -192,7 +189,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -202,7 +199,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -211,9 +208,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -222,9 +216,6 @@ 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 { @@ -261,7 +252,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'test_mode', 'use_preexisting_fields' => 'use_preexisting_fields', 'use_text_tags' => 'use_text_tags', - 'expires_at' => 'expires_at' + 'expires_at' => 'expires_at', ]; /** @@ -293,7 +284,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'setTestMode', 'use_preexisting_fields' => 'setUsePreexistingFields', 'use_text_tags' => 'setUseTextTags', - 'expires_at' => 'setExpiresAt' + 'expires_at' => 'setExpiresAt', ]; /** @@ -325,7 +316,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'getTestMode', 'use_preexisting_fields' => 'getUsePreexistingFields', 'use_text_tags' => 'getUseTextTags', - 'expires_at' => 'getExpiresAt' + 'expires_at' => 'getExpiresAt', ]; /** @@ -396,7 +387,7 @@ public function getTypeAllowableValues() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -426,34 +417,33 @@ public function __construct(?array $data = null) $this->setIfExists('expires_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): UnclaimedDraftCreateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): UnclaimedDraftCreateRequest { /** @var UnclaimedDraftCreateRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, UnclaimedDraftCreateRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -506,7 +496,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -524,14 +513,14 @@ public function getType() * * @return self */ - public function setType($type) + public function setType(string $type) { if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + throw new InvalidArgumentException('non-nullable type cannot be null'); } $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'type', must be one of '%s'", $type, @@ -547,7 +536,7 @@ public function setType($type) /** * Gets files * - * @return \SplFileObject[]|null + * @return SplFileObject[]|null */ public function getFiles() { @@ -557,14 +546,14 @@ public function getFiles() /** * Sets files * - * @param \SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * * @return self */ - public function setFiles($files) + public function setFiles(?array $files) { if (is_null($files)) { - throw new \InvalidArgumentException('non-nullable files cannot be null'); + throw new InvalidArgumentException('non-nullable files cannot be null'); } $this->container['files'] = $files; @@ -588,10 +577,10 @@ public function getFileUrls() * * @return self */ - public function setFileUrls($file_urls) + public function setFileUrls(?array $file_urls) { if (is_null($file_urls)) { - throw new \InvalidArgumentException('non-nullable file_urls cannot be null'); + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); } $this->container['file_urls'] = $file_urls; @@ -615,10 +604,10 @@ public function getAllowDecline() * * @return self */ - public function setAllowDecline($allow_decline) + public function setAllowDecline(?bool $allow_decline) { if (is_null($allow_decline)) { - throw new \InvalidArgumentException('non-nullable allow_decline cannot be null'); + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); } $this->container['allow_decline'] = $allow_decline; @@ -642,10 +631,10 @@ public function getAttachments() * * @return self */ - public function setAttachments($attachments) + public function setAttachments(?array $attachments) { if (is_null($attachments)) { - throw new \InvalidArgumentException('non-nullable attachments cannot be null'); + throw new InvalidArgumentException('non-nullable attachments cannot be null'); } $this->container['attachments'] = $attachments; @@ -665,14 +654,14 @@ public function getCcEmailAddresses() /** * Sets cc_email_addresses * - * @param string[]|null $cc_email_addresses The email addresses that should be CCed. + * @param string[]|null $cc_email_addresses the email addresses that should be CCed * * @return self */ - public function setCcEmailAddresses($cc_email_addresses) + public function setCcEmailAddresses(?array $cc_email_addresses) { if (is_null($cc_email_addresses)) { - throw new \InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); } $this->container['cc_email_addresses'] = $cc_email_addresses; @@ -696,10 +685,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(?string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -723,10 +712,10 @@ public function getCustomFields() * * @return self */ - public function setCustomFields($custom_fields) + public function setCustomFields(?array $custom_fields) { if (is_null($custom_fields)) { - throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); } $this->container['custom_fields'] = $custom_fields; @@ -750,10 +739,10 @@ public function getFieldOptions() * * @return self */ - public function setFieldOptions($field_options) + public function setFieldOptions(?SubFieldOptions $field_options) { if (is_null($field_options)) { - throw new \InvalidArgumentException('non-nullable field_options cannot be null'); + throw new InvalidArgumentException('non-nullable field_options cannot be null'); } $this->container['field_options'] = $field_options; @@ -777,10 +766,10 @@ public function getFormFieldGroups() * * @return self */ - public function setFormFieldGroups($form_field_groups) + public function setFormFieldGroups(?array $form_field_groups) { if (is_null($form_field_groups)) { - throw new \InvalidArgumentException('non-nullable form_field_groups cannot be null'); + throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); } $this->container['form_field_groups'] = $form_field_groups; @@ -800,14 +789,14 @@ public function getFormFieldRules() /** * Sets form_field_rules * - * @param SubFormFieldRule[]|null $form_field_rules Conditional Logic rules for fields defined in `form_fields_per_document`. + * @param SubFormFieldRule[]|null $form_field_rules conditional Logic rules for fields defined in `form_fields_per_document` * * @return self */ - public function setFormFieldRules($form_field_rules) + public function setFormFieldRules(?array $form_field_rules) { if (is_null($form_field_rules)) { - throw new \InvalidArgumentException('non-nullable form_field_rules cannot be null'); + throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); } $this->container['form_field_rules'] = $form_field_rules; @@ -831,10 +820,10 @@ public function getFormFieldsPerDocument() * * @return self */ - public function setFormFieldsPerDocument($form_fields_per_document) + public function setFormFieldsPerDocument(?array $form_fields_per_document) { if (is_null($form_fields_per_document)) { - throw new \InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); } $this->container['form_fields_per_document'] = $form_fields_per_document; @@ -858,10 +847,10 @@ public function getHideTextTags() * * @return self */ - public function setHideTextTags($hide_text_tags) + public function setHideTextTags(?bool $hide_text_tags) { if (is_null($hide_text_tags)) { - throw new \InvalidArgumentException('non-nullable hide_text_tags cannot be null'); + throw new InvalidArgumentException('non-nullable hide_text_tags cannot be null'); } $this->container['hide_text_tags'] = $hide_text_tags; @@ -881,17 +870,17 @@ public function getMessage() /** * Sets message * - * @param string|null $message The custom message in the email that will be sent to the signers. + * @param string|null $message the custom message in the email that will be sent to the signers * * @return self */ - public function setMessage($message) + public function setMessage(?string $message) { if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + throw new InvalidArgumentException('non-nullable message cannot be null'); } - if ((mb_strlen($message) > 5000)) { - throw new \InvalidArgumentException('invalid length for $message when calling UnclaimedDraftCreateRequest., must be smaller than or equal to 5000.'); + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling UnclaimedDraftCreateRequest., must be smaller than or equal to 5000.'); } $this->container['message'] = $message; @@ -916,13 +905,12 @@ public function getMetadata() * * @return self */ - public function setMetadata($metadata) + public function setMetadata(?array $metadata) { if (is_null($metadata)) { - throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + throw new InvalidArgumentException('non-nullable metadata cannot be null'); } - $this->container['metadata'] = $metadata; return $this; @@ -941,14 +929,14 @@ public function getShowProgressStepper() /** * Sets show_progress_stepper * - * @param bool|null $show_progress_stepper When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. + * @param bool|null $show_progress_stepper when only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden * * @return self */ - public function setShowProgressStepper($show_progress_stepper) + public function setShowProgressStepper(?bool $show_progress_stepper) { if (is_null($show_progress_stepper)) { - throw new \InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); + throw new InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); } $this->container['show_progress_stepper'] = $show_progress_stepper; @@ -968,14 +956,14 @@ public function getSigners() /** * Sets signers * - * @param SubUnclaimedDraftSigner[]|null $signers Add Signers to your Unclaimed Draft Signature Request. + * @param SubUnclaimedDraftSigner[]|null $signers add Signers to your Unclaimed Draft Signature Request * * @return self */ - public function setSigners($signers) + public function setSigners(?array $signers) { if (is_null($signers)) { - throw new \InvalidArgumentException('non-nullable signers cannot be null'); + throw new InvalidArgumentException('non-nullable signers cannot be null'); } $this->container['signers'] = $signers; @@ -999,10 +987,10 @@ public function getSigningOptions() * * @return self */ - public function setSigningOptions($signing_options) + public function setSigningOptions(?SubSigningOptions $signing_options) { if (is_null($signing_options)) { - throw new \InvalidArgumentException('non-nullable signing_options cannot be null'); + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); } $this->container['signing_options'] = $signing_options; @@ -1022,14 +1010,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. + * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign * * @return self */ - public function setSigningRedirectUrl($signing_redirect_url) + public function setSigningRedirectUrl(?string $signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -1049,17 +1037,17 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject The subject in the email that will be sent to the signers. + * @param string|null $subject the subject in the email that will be sent to the signers * * @return self */ - public function setSubject($subject) + public function setSubject(?string $subject) { if (is_null($subject)) { - throw new \InvalidArgumentException('non-nullable subject cannot be null'); + throw new InvalidArgumentException('non-nullable subject cannot be null'); } - if ((mb_strlen($subject) > 200)) { - throw new \InvalidArgumentException('invalid length for $subject when calling UnclaimedDraftCreateRequest., must be smaller than or equal to 200.'); + if (mb_strlen($subject) > 200) { + throw new InvalidArgumentException('invalid length for $subject when calling UnclaimedDraftCreateRequest., must be smaller than or equal to 200.'); } $this->container['subject'] = $subject; @@ -1084,10 +1072,10 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; @@ -1111,10 +1099,10 @@ public function getUsePreexistingFields() * * @return self */ - public function setUsePreexistingFields($use_preexisting_fields) + public function setUsePreexistingFields(?bool $use_preexisting_fields) { if (is_null($use_preexisting_fields)) { - throw new \InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); + throw new InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); } $this->container['use_preexisting_fields'] = $use_preexisting_fields; @@ -1138,10 +1126,10 @@ public function getUseTextTags() * * @return self */ - public function setUseTextTags($use_text_tags) + public function setUseTextTags(?bool $use_text_tags) { if (is_null($use_text_tags)) { - throw new \InvalidArgumentException('non-nullable use_text_tags cannot be null'); + throw new InvalidArgumentException('non-nullable use_text_tags cannot be null'); } $this->container['use_text_tags'] = $use_text_tags; @@ -1165,13 +1153,13 @@ public function getExpiresAt() * * @return self */ - public function setExpiresAt($expires_at) + public function setExpiresAt(?int $expires_at) { if (is_null($expires_at)) { array_push($this->openAPINullablesSetToNull, 'expires_at'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('expires_at', $nullablesSetToNull, true); + $index = array_search('expires_at', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -1181,14 +1169,13 @@ public function setExpiresAt($expires_at) return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -1197,11 +1184,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1212,10 +1199,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -1228,11 +1213,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -1240,12 +1223,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -1274,5 +1257,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/UnclaimedDraftCreateResponse.php b/sdks/php/src/Model/UnclaimedDraftCreateResponse.php index 14f3f0a03..d6c1043c1 100644 --- a/sdks/php/src/Model/UnclaimedDraftCreateResponse.php +++ b/sdks/php/src/Model/UnclaimedDraftCreateResponse.php @@ -1,14 +1,11 @@ */ -class UnclaimedDraftCreateResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class UnclaimedDraftCreateResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'UnclaimedDraftCreateResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'unclaimed_draft' => '\Dropbox\Sign\Model\UnclaimedDraftResponse', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]' + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'unclaimed_draft' => null, - 'warnings' => null + 'warnings' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'unclaimed_draft' => false, - 'warnings' => false + 'warnings' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -114,8 +112,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -125,7 +121,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -135,7 +131,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -144,9 +140,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -155,9 +148,6 @@ 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 { @@ -172,7 +162,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'unclaimed_draft' => 'unclaimed_draft', - 'warnings' => 'warnings' + 'warnings' => 'warnings', ]; /** @@ -182,7 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'unclaimed_draft' => 'setUnclaimedDraft', - 'warnings' => 'setWarnings' + 'warnings' => 'setWarnings', ]; /** @@ -192,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'unclaimed_draft' => 'getUnclaimedDraft', - 'warnings' => 'getWarnings' + 'warnings' => 'getWarnings', ]; /** @@ -236,7 +226,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -248,7 +237,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -256,34 +245,33 @@ public function __construct(?array $data = null) $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): UnclaimedDraftCreateResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): UnclaimedDraftCreateResponse { /** @var UnclaimedDraftCreateResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, UnclaimedDraftCreateResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -319,7 +307,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets unclaimed_draft * @@ -337,10 +324,10 @@ public function getUnclaimedDraft() * * @return self */ - public function setUnclaimedDraft($unclaimed_draft) + public function setUnclaimedDraft(UnclaimedDraftResponse $unclaimed_draft) { if (is_null($unclaimed_draft)) { - throw new \InvalidArgumentException('non-nullable unclaimed_draft cannot be null'); + throw new InvalidArgumentException('non-nullable unclaimed_draft cannot be null'); } $this->container['unclaimed_draft'] = $unclaimed_draft; @@ -360,27 +347,26 @@ public function getWarnings() /** * Sets warnings * - * @param WarningResponse[]|null $warnings A list of warnings. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setWarnings($warnings) + public function setWarnings(?array $warnings) { if (is_null($warnings)) { - throw new \InvalidArgumentException('non-nullable warnings cannot be null'); + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } $this->container['warnings'] = $warnings; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -389,11 +375,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -404,10 +390,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -420,11 +404,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -432,12 +414,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -466,5 +448,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/UnclaimedDraftEditAndResendRequest.php b/sdks/php/src/Model/UnclaimedDraftEditAndResendRequest.php index 42cda1dd1..56a60c50b 100644 --- a/sdks/php/src/Model/UnclaimedDraftEditAndResendRequest.php +++ b/sdks/php/src/Model/UnclaimedDraftEditAndResendRequest.php @@ -1,14 +1,11 @@ */ -class UnclaimedDraftEditAndResendRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class UnclaimedDraftEditAndResendRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'UnclaimedDraftEditAndResendRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'client_id' => 'string', 'editor_options' => '\Dropbox\Sign\Model\SubEditorOptions', @@ -66,16 +64,16 @@ class UnclaimedDraftEditAndResendRequest implements ModelInterface, ArrayAccess, 'requesting_redirect_url' => 'string', 'show_progress_stepper' => 'bool', 'signing_redirect_url' => 'string', - 'test_mode' => 'bool' + 'test_mode' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'client_id' => null, 'editor_options' => null, @@ -84,14 +82,14 @@ class UnclaimedDraftEditAndResendRequest implements ModelInterface, ArrayAccess, 'requesting_redirect_url' => null, 'show_progress_stepper' => null, 'signing_redirect_url' => null, - 'test_mode' => null + 'test_mode' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'client_id' => false, 'editor_options' => false, @@ -100,14 +98,14 @@ class UnclaimedDraftEditAndResendRequest implements ModelInterface, ArrayAccess, 'requesting_redirect_url' => false, 'show_progress_stepper' => false, 'signing_redirect_url' => false, - 'test_mode' => false + 'test_mode' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -132,8 +130,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -143,7 +139,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -153,7 +149,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -162,9 +158,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -173,9 +166,6 @@ 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 { @@ -196,7 +186,7 @@ public function isNullableSetToNull(string $property): bool 'requesting_redirect_url' => 'requesting_redirect_url', 'show_progress_stepper' => 'show_progress_stepper', 'signing_redirect_url' => 'signing_redirect_url', - 'test_mode' => 'test_mode' + 'test_mode' => 'test_mode', ]; /** @@ -212,7 +202,7 @@ public function isNullableSetToNull(string $property): bool 'requesting_redirect_url' => 'setRequestingRedirectUrl', 'show_progress_stepper' => 'setShowProgressStepper', 'signing_redirect_url' => 'setSigningRedirectUrl', - 'test_mode' => 'setTestMode' + 'test_mode' => 'setTestMode', ]; /** @@ -228,7 +218,7 @@ public function isNullableSetToNull(string $property): bool 'requesting_redirect_url' => 'getRequestingRedirectUrl', 'show_progress_stepper' => 'getShowProgressStepper', 'signing_redirect_url' => 'getSigningRedirectUrl', - 'test_mode' => 'getTestMode' + 'test_mode' => 'getTestMode', ]; /** @@ -272,7 +262,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -284,7 +273,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -298,34 +287,33 @@ public function __construct(?array $data = null) $this->setIfExists('test_mode', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): UnclaimedDraftEditAndResendRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): UnclaimedDraftEditAndResendRequest { /** @var UnclaimedDraftEditAndResendRequest */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, UnclaimedDraftEditAndResendRequest::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -361,7 +349,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets client_id * @@ -379,10 +366,10 @@ public function getClientId() * * @return self */ - public function setClientId($client_id) + public function setClientId(string $client_id) { if (is_null($client_id)) { - throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + throw new InvalidArgumentException('non-nullable client_id cannot be null'); } $this->container['client_id'] = $client_id; @@ -406,10 +393,10 @@ public function getEditorOptions() * * @return self */ - public function setEditorOptions($editor_options) + public function setEditorOptions(?SubEditorOptions $editor_options) { if (is_null($editor_options)) { - throw new \InvalidArgumentException('non-nullable editor_options cannot be null'); + throw new InvalidArgumentException('non-nullable editor_options cannot be null'); } $this->container['editor_options'] = $editor_options; @@ -429,14 +416,14 @@ public function getIsForEmbeddedSigning() /** * Sets is_for_embedded_signing * - * @param bool|null $is_for_embedded_signing The request created from this draft will also be signable in embedded mode if set to `true`. + * @param bool|null $is_for_embedded_signing the request created from this draft will also be signable in embedded mode if set to `true` * * @return self */ - public function setIsForEmbeddedSigning($is_for_embedded_signing) + public function setIsForEmbeddedSigning(?bool $is_for_embedded_signing) { if (is_null($is_for_embedded_signing)) { - throw new \InvalidArgumentException('non-nullable is_for_embedded_signing cannot be null'); + throw new InvalidArgumentException('non-nullable is_for_embedded_signing cannot be null'); } $this->container['is_for_embedded_signing'] = $is_for_embedded_signing; @@ -460,10 +447,10 @@ public function getRequesterEmailAddress() * * @return self */ - public function setRequesterEmailAddress($requester_email_address) + public function setRequesterEmailAddress(?string $requester_email_address) { if (is_null($requester_email_address)) { - throw new \InvalidArgumentException('non-nullable requester_email_address cannot be null'); + throw new InvalidArgumentException('non-nullable requester_email_address cannot be null'); } $this->container['requester_email_address'] = $requester_email_address; @@ -483,14 +470,14 @@ public function getRequestingRedirectUrl() /** * Sets requesting_redirect_url * - * @param string|null $requesting_redirect_url The URL you want signers redirected to after they successfully request a signature. + * @param string|null $requesting_redirect_url the URL you want signers redirected to after they successfully request a signature * * @return self */ - public function setRequestingRedirectUrl($requesting_redirect_url) + public function setRequestingRedirectUrl(?string $requesting_redirect_url) { if (is_null($requesting_redirect_url)) { - throw new \InvalidArgumentException('non-nullable requesting_redirect_url cannot be null'); + throw new InvalidArgumentException('non-nullable requesting_redirect_url cannot be null'); } $this->container['requesting_redirect_url'] = $requesting_redirect_url; @@ -510,14 +497,14 @@ public function getShowProgressStepper() /** * Sets show_progress_stepper * - * @param bool|null $show_progress_stepper When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. + * @param bool|null $show_progress_stepper when only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden * * @return self */ - public function setShowProgressStepper($show_progress_stepper) + public function setShowProgressStepper(?bool $show_progress_stepper) { if (is_null($show_progress_stepper)) { - throw new \InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); + throw new InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); } $this->container['show_progress_stepper'] = $show_progress_stepper; @@ -537,14 +524,14 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. + * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign * * @return self */ - public function setSigningRedirectUrl($signing_redirect_url) + public function setSigningRedirectUrl(?string $signing_redirect_url) { if (is_null($signing_redirect_url)) { - throw new \InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); } $this->container['signing_redirect_url'] = $signing_redirect_url; @@ -568,23 +555,22 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -593,11 +579,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -608,10 +594,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -624,11 +608,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -636,12 +618,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -670,5 +652,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/UnclaimedDraftResponse.php b/sdks/php/src/Model/UnclaimedDraftResponse.php index 7b0a5fcc3..774aae3f7 100644 --- a/sdks/php/src/Model/UnclaimedDraftResponse.php +++ b/sdks/php/src/Model/UnclaimedDraftResponse.php @@ -1,14 +1,11 @@ */ -class UnclaimedDraftResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class UnclaimedDraftResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'UnclaimedDraftResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'signature_request_id' => 'string', 'claim_url' => 'string', 'signing_redirect_url' => 'string', 'requesting_redirect_url' => 'string', 'expires_at' => 'int', - 'test_mode' => 'bool' + 'test_mode' => 'bool', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'signature_request_id' => null, 'claim_url' => null, 'signing_redirect_url' => null, 'requesting_redirect_url' => null, 'expires_at' => null, - 'test_mode' => null + 'test_mode' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'signature_request_id' => true, 'claim_url' => false, 'signing_redirect_url' => true, 'requesting_redirect_url' => true, 'expires_at' => true, - 'test_mode' => false + 'test_mode' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -127,8 +125,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -138,7 +134,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -148,7 +144,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -157,9 +153,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -168,9 +161,6 @@ 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 { @@ -189,7 +179,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'signing_redirect_url', 'requesting_redirect_url' => 'requesting_redirect_url', 'expires_at' => 'expires_at', - 'test_mode' => 'test_mode' + 'test_mode' => 'test_mode', ]; /** @@ -203,7 +193,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'setSigningRedirectUrl', 'requesting_redirect_url' => 'setRequestingRedirectUrl', 'expires_at' => 'setExpiresAt', - 'test_mode' => 'setTestMode' + 'test_mode' => 'setTestMode', ]; /** @@ -217,7 +207,7 @@ public function isNullableSetToNull(string $property): bool 'signing_redirect_url' => 'getSigningRedirectUrl', 'requesting_redirect_url' => 'getRequestingRedirectUrl', 'expires_at' => 'getExpiresAt', - 'test_mode' => 'getTestMode' + 'test_mode' => 'getTestMode', ]; /** @@ -261,7 +251,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -273,7 +262,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -285,34 +274,33 @@ public function __construct(?array $data = null) $this->setIfExists('test_mode', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): UnclaimedDraftResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): UnclaimedDraftResponse { /** @var UnclaimedDraftResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, UnclaimedDraftResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -329,9 +317,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -345,7 +331,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets signature_request_id * @@ -359,17 +344,17 @@ public function getSignatureRequestId() /** * Sets signature_request_id * - * @param string|null $signature_request_id The ID of the signature request that is represented by this UnclaimedDraft. + * @param string|null $signature_request_id the ID of the signature request that is represented by this UnclaimedDraft * * @return self */ - public function setSignatureRequestId($signature_request_id) + public function setSignatureRequestId(?string $signature_request_id) { if (is_null($signature_request_id)) { array_push($this->openAPINullablesSetToNull, 'signature_request_id'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signature_request_id', $nullablesSetToNull, true); + $index = array_search('signature_request_id', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -393,14 +378,14 @@ public function getClaimUrl() /** * Sets claim_url * - * @param string|null $claim_url The URL to be used to claim this UnclaimedDraft. + * @param string|null $claim_url the URL to be used to claim this UnclaimedDraft * * @return self */ - public function setClaimUrl($claim_url) + public function setClaimUrl(?string $claim_url) { if (is_null($claim_url)) { - throw new \InvalidArgumentException('non-nullable claim_url cannot be null'); + throw new InvalidArgumentException('non-nullable claim_url cannot be null'); } $this->container['claim_url'] = $claim_url; @@ -420,17 +405,17 @@ public function getSigningRedirectUrl() /** * Sets signing_redirect_url * - * @param string|null $signing_redirect_url The URL you want signers redirected to after they successfully sign. + * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign * * @return self */ - public function setSigningRedirectUrl($signing_redirect_url) + public function setSigningRedirectUrl(?string $signing_redirect_url) { if (is_null($signing_redirect_url)) { array_push($this->openAPINullablesSetToNull, 'signing_redirect_url'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('signing_redirect_url', $nullablesSetToNull, true); + $index = array_search('signing_redirect_url', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -458,13 +443,13 @@ public function getRequestingRedirectUrl() * * @return self */ - public function setRequestingRedirectUrl($requesting_redirect_url) + public function setRequestingRedirectUrl(?string $requesting_redirect_url) { if (is_null($requesting_redirect_url)) { array_push($this->openAPINullablesSetToNull, 'requesting_redirect_url'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('requesting_redirect_url', $nullablesSetToNull, true); + $index = array_search('requesting_redirect_url', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -488,17 +473,17 @@ public function getExpiresAt() /** * Sets expires_at * - * @param int|null $expires_at When the link expires. + * @param int|null $expires_at when the link expires * * @return self */ - public function setExpiresAt($expires_at) + public function setExpiresAt(?int $expires_at) { if (is_null($expires_at)) { array_push($this->openAPINullablesSetToNull, 'expires_at'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('expires_at', $nullablesSetToNull, true); + $index = array_search('expires_at', $nullablesSetToNull); if ($index !== false) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); @@ -526,23 +511,22 @@ public function getTestMode() * * @return self */ - public function setTestMode($test_mode) + public function setTestMode(?bool $test_mode) { if (is_null($test_mode)) { - throw new \InvalidArgumentException('non-nullable test_mode cannot be null'); + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); } $this->container['test_mode'] = $test_mode; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -551,11 +535,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -566,10 +550,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -582,11 +564,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -594,12 +574,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -628,5 +608,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/Model/WarningResponse.php b/sdks/php/src/Model/WarningResponse.php index dc2c0feec..309277392 100644 --- a/sdks/php/src/Model/WarningResponse.php +++ b/sdks/php/src/Model/WarningResponse.php @@ -1,14 +1,11 @@ */ -class WarningResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class WarningResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'WarningResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'warning_msg' => 'string', - 'warning_name' => 'string' + 'warning_name' => 'string', ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'warning_msg' => null, - 'warning_name' => null + 'warning_name' => null, ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ protected static array $openAPINullables = [ 'warning_msg' => false, - 'warning_name' => false + 'warning_name' => false, ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ protected array $openAPINullablesSetToNull = []; /** @@ -115,8 +113,6 @@ public static function openAPIFormats() /** * Array of nullable properties - * - * @return array */ protected static function openAPINullables(): array { @@ -126,7 +122,7 @@ protected static function openAPINullables(): array /** * Array of nullable field names deliberately set to null * - * @return boolean[] + * @return bool[] */ private function getOpenAPINullablesSetToNull(): array { @@ -136,7 +132,7 @@ private function getOpenAPINullablesSetToNull(): array /** * Setter - Array of nullable field names deliberately set to null * - * @param boolean[] $openAPINullablesSetToNull + * @param bool[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { @@ -145,9 +141,6 @@ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): /** * Checks if a property is nullable - * - * @param string $property - * @return bool */ public static function isNullable(string $property): bool { @@ -156,9 +149,6 @@ 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 { @@ -173,7 +163,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'warning_msg' => 'warning_msg', - 'warning_name' => 'warning_name' + 'warning_name' => 'warning_name', ]; /** @@ -183,7 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'warning_msg' => 'setWarningMsg', - 'warning_name' => 'setWarningName' + 'warning_name' => 'setWarningName', ]; /** @@ -193,7 +183,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'warning_msg' => 'getWarningMsg', - 'warning_name' => 'getWarningName' + 'warning_name' => 'getWarningName', ]; /** @@ -237,7 +227,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -249,7 +238,7 @@ public function getModelName() * Constructor * * @param mixed[]|null $data Associated array of property values - * initializing the model + * initializing the model */ public function __construct(?array $data = null) { @@ -257,34 +246,33 @@ public function __construct(?array $data = null) $this->setIfExists('warning_name', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): WarningResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): WarningResponse { /** @var WarningResponse */ - $obj = ObjectSerializer::deserialize( + return ObjectSerializer::deserialize( $data, WarningResponse::class, ); - - return $obj; } - /** - * 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 string|int|object|array|mixed $defaultValue - */ + * 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|int|object|array|mixed $defaultValue + */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { @@ -323,7 +311,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets warning_msg * @@ -341,10 +328,10 @@ public function getWarningMsg() * * @return self */ - public function setWarningMsg($warning_msg) + public function setWarningMsg(string $warning_msg) { if (is_null($warning_msg)) { - throw new \InvalidArgumentException('non-nullable warning_msg cannot be null'); + throw new InvalidArgumentException('non-nullable warning_msg cannot be null'); } $this->container['warning_msg'] = $warning_msg; @@ -368,23 +355,22 @@ public function getWarningName() * * @return self */ - public function setWarningName($warning_name) + public function setWarningName(string $warning_name) { if (is_null($warning_name)) { - throw new \InvalidArgumentException('non-nullable warning_name cannot be null'); + throw new InvalidArgumentException('non-nullable warning_name cannot be null'); } $this->container['warning_name'] = $warning_name; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists($offset): bool { return isset($this->container[$offset]); @@ -393,11 +379,11 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -408,10 +394,8 @@ public function offsetGet($offset) * * @param int|null $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet($offset, $value): void { if (is_null($offset)) { @@ -424,11 +408,9 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset($offset): void { unset($this->container[$offset]); @@ -436,12 +418,12 @@ public function offsetUnset($offset): void /** * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * @see 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. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -470,5 +452,3 @@ public function toHeaderValue() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/sdks/php/src/ObjectSerializer.php b/sdks/php/src/ObjectSerializer.php index d0bcbffe0..f8022100b 100644 --- a/sdks/php/src/ObjectSerializer.php +++ b/sdks/php/src/ObjectSerializer.php @@ -1,14 +1,11 @@ format('Y-m-d') : $data->format(self::$dateTimeFormat); } @@ -89,7 +88,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n $formats = $data::openAPIFormats(); foreach ($data::openAPITypes() as $property => $openAPIType) { $getter = $data::getters()[$property]; - $value = $data->$getter(); + $value = $data->{$getter}(); 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)) { @@ -97,7 +96,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n $allowedEnumTypes = $callable(); if (!in_array($value, $allowedEnumTypes, true)) { $imploded = implode("', '", $allowedEnumTypes); - throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + throw new InvalidArgumentException("Invalid value for enum '{$openAPIType}', must be one of: '{$imploded}'"); } } } @@ -105,17 +104,16 @@ public static function sanitizeForSerialization($data, $type = null, $format = n $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); } } - } elseif ($data instanceof \SplFileObject) { - return (string) $data; + } elseif ($data instanceof SplFileObject) { + return (string)$data; } else { foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } return (object)$values; - } else { - return (string)$data; } + return (string)$data; } /** @@ -126,13 +124,12 @@ public static function sanitizeForSerialization($data, $type = null, $format = n * * @return string the sanitized filename */ - public static function sanitizeFilename($filename) + public static function sanitizeFilename(string $filename) { - if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + if (preg_match('/.*[\\/\\\\](.*)$/', $filename, $match)) { return $match[1]; - } else { - return $filename; } + return $filename; } /** @@ -142,7 +139,7 @@ public static function sanitizeFilename($filename) * * @return string the shorten timestamp */ - public static function sanitizeTimestamp($timestamp) + public static function sanitizeTimestamp(string $timestamp) { if (!is_string($timestamp)) { return $timestamp; @@ -159,7 +156,7 @@ public static function sanitizeTimestamp($timestamp) * * @return string the serialized object */ - public static function toPathValue($value) + public static function toPathValue(string $value) { return rawurlencode(self::toString($value)); } @@ -167,27 +164,26 @@ public static function toPathValue($value) /** * Checks if a value is empty, based on its OpenAPI type. * - * @param string|int|object|array|mixed $value - * @param string $openApiType + * @param string|int|object|array|mixed $value * * @return bool true if $value is empty */ private static function isEmptyValue($value, string $openApiType): bool { - # If empty() returns false, it is not empty regardless of its type. + // 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. + // 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. + // 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; @@ -196,16 +192,16 @@ private static function isEmptyValue($value, string $openApiType): bool case 'float': return $value !== 0 && $value !== 0.0; - # For boolean values, '' is considered empty + // For boolean values, '' is considered empty case 'bool': case 'boolean': return !in_array($value, [false, 0], true); - # For string values, '' is considered empty. + // For string values, '' is considered empty. case 'string': return $value === ''; - # For all the other types, any value at this point can be considered empty. + // For all the other types, any value at this point can be considered empty. default: return true; } @@ -215,14 +211,12 @@ private static function isEmptyValue($value, string $openApiType): bool * Take query parameter properties and turn it into an array suitable for * native http_build_query or GuzzleHttp\Psr7\Query::build. * - * @param string|int|object|array|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 + * @param string|int|object|array|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 */ public static function toQueryValue( $value, @@ -232,21 +226,19 @@ public static function toQueryValue( 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. + // 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 []; } + return []; } - # Handle DateTime objects in query - if ($openApiType === "\\DateTime" && $value instanceof \DateTime) { + // Handle DateTime objects in query + if ($openApiType === '\\DateTime' && $value instanceof DateTime) { return ["{$paramName}" => $value->format(self::$dateTimeFormat)]; } @@ -306,11 +298,11 @@ public static function toQueryValue( */ public static function convertBoolToQueryStringFormat(bool $value) { - if (Configuration::BOOLEAN_FORMAT_STRING === Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) { + if (Configuration::BOOLEAN_FORMAT_STRING == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) { return $value ? 'true' : 'false'; } - return (int) $value; + return (int)$value; } /** @@ -322,7 +314,7 @@ public static function convertBoolToQueryStringFormat(bool $value) * * @return string the header string */ - public static function toHeaderValue($value) + public static function toHeaderValue(string $value) { $callable = [$value, 'toHeaderValue']; if (is_callable($callable)) { @@ -337,17 +329,16 @@ public static function toHeaderValue($value) * the http body (form parameter). If it's a string, pass through unchanged * If it's a datetime object, format it in ISO8601 * - * @param string|\SplFileObject $value the value of the form parameter + * @param string|SplFileObject $value the value of the form parameter * * @return string the form string */ public static function toFormValue($value) { - if ($value instanceof \SplFileObject) { + if ($value instanceof SplFileObject) { return $value->getRealPath(); - } else { - return self::toString($value); } + return self::toString($value); } /** @@ -362,13 +353,13 @@ public static function toFormValue($value) */ public static function toString($value) { - if ($value instanceof \DateTime) { // datetime in ISO8601 format + if ($value instanceof DateTime) { // datetime in ISO8601 format return $value->format(self::$dateTimeFormat); - } elseif (is_bool($value)) { + } + if (is_bool($value)) { return $value ? 'true' : 'false'; - } else { - return (string) $value; } + return (string)$value; } /** @@ -376,12 +367,12 @@ public static function toString($value) * * @param array $collection collection to serialize to a string * @param string $style the format use for serialization (csv, - * ssv, tsv, pipes, multi) + * ssv, tsv, pipes, multi) * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array * * @return string */ - public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + public static function serializeCollection(array $collection, string $style, bool $allowCollectionFormatMulti = false) { if ($allowCollectionFormatMulti && ('multi' === $style)) { // http_build_query() almost does the job for us. We just @@ -411,13 +402,13 @@ public static function serializeCollection(array $collection, $style, $allowColl /** * Deserialize a JSON string into an object * - * @param string|int|object|array|mixed $data object or primitive to be deserialized - * @param string $class class name is passed as a string - * @param string[]|null $httpHeaders HTTP headers + * @param string|int|object|array|mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[]|null $httpHeaders HTTP headers * * @return object|array|null a single or an array of $class instances */ - public static function deserialize($data, $class, $httpHeaders = null) + public static function deserialize($data, string $class, ?array $httpHeaders = null) { if (null === $data) { return null; @@ -427,7 +418,7 @@ public static function deserialize($data, $class, $httpHeaders = null) $data = is_string($data) ? json_decode($data) : $data; if (!is_array($data)) { - throw new \InvalidArgumentException("Invalid array '$class'"); + throw new InvalidArgumentException("Invalid array '{$class}'"); } $subClass = substr($class, 0, -2); @@ -443,7 +434,7 @@ public static function deserialize($data, $class, $httpHeaders = null) settype($data, 'array'); $inner = substr($class, 4, -1); $deserialized = []; - if (strrpos($inner, ",") !== false) { + if (strrpos($inner, ',') !== false) { $subClass_array = explode(',', $inner, 2); $subClass = $subClass_array[1]; foreach ($data as $key => $value) { @@ -456,7 +447,8 @@ public static function deserialize($data, $class, $httpHeaders = null) if ($class === 'object') { settype($data, 'array'); return $data; - } elseif ($class === 'mixed') { + } + if ($class === 'mixed') { settype($data, gettype($data)); return $data; } @@ -470,12 +462,12 @@ public static function deserialize($data, $class, $httpHeaders = null) // this graceful. if (!empty($data)) { try { - return new \DateTime($data); - } catch (\Exception $exception) { + 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)); + return new DateTime(self::sanitizeTimestamp($data)); } } else { return null; @@ -483,7 +475,7 @@ public static function deserialize($data, $class, $httpHeaders = null) } if ($class === '\SplFileObject') { - if (is_a($data, \SplFileObject::class)) { + if (is_a($data, SplFileObject::class)) { return $data; } @@ -508,7 +500,7 @@ public static function deserialize($data, $class, $httpHeaders = null) } fclose($file); - return new \SplFileObject($filename, 'r'); + return new SplFileObject($filename, 'r'); } /** @psalm-suppress ParadoxicalCondition */ @@ -517,97 +509,95 @@ public static function deserialize($data, $class, $httpHeaders = null) 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'"); + throw new InvalidArgumentException("Invalid value for enum '{$class}', must be one of: '{$imploded}'"); } return $data; - } else { - $data = is_string($data) ? json_decode($data) : $data; + } + $data = is_string($data) ? json_decode($data) : $data; - if (is_array($data)) { - $data = (object)$data; - } + if (is_array($data)) { + $data = (object)$data; + } - // If a discriminator is defined and points to a valid subclass, use it. - $discriminator = $class::DISCRIMINATOR; - $discriminatorValue = null; - if (is_object($data)) { - $discriminatorValue = $data->{$discriminator} ?? null; - } elseif (is_array($data)) { - $discriminatorValue = $data[$discriminator] ?? null; - } + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + $discriminatorValue = null; + if (is_object($data)) { + $discriminatorValue = $data->{$discriminator} ?? null; + } elseif (is_array($data)) { + $discriminatorValue = $data[$discriminator] ?? null; + } - $discrimnatorSubclassFound = false; - if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { - $subclass = '\Dropbox\Sign\Model\\' . $data->{$discriminator}; - if (is_subclass_of($subclass, $class)) { - $class = $subclass; - $discrimnatorSubclassFound = true; - } + $discrimnatorSubclassFound = false; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Dropbox\Sign\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + $discrimnatorSubclassFound = true; } + } - if ( - !$discrimnatorSubclassFound - && !empty($discriminator) - && method_exists($class, 'discriminatorClassName') - ) { - $subclass = call_user_func( - "{$class}::discriminatorClassName", - (array) $data, - ); - - if (empty($subclass)) { - return null; - } + if ( + !$discrimnatorSubclassFound + && !empty($discriminator) + && method_exists($class, 'discriminatorClassName') + ) { + $subclass = call_user_func( + "{$class}::discriminatorClassName", + (array)$data, + ); - $class = $subclass; - $discrimnatorSubclassFound = true; + if (empty($subclass)) { + return null; } - /** @var ModelInterface $instance */ - $instance = new $class(); - foreach ($instance::openAPITypes() as $property => $type) { - $propertySetter = $instance::setters()[$property]; + $class = $subclass; + $discrimnatorSubclassFound = true; + } - if (!isset($propertySetter)) { - continue; - } + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; - if (!isset($data->{$instance::attributeMap()[$property]})) { - if ($instance::isNullable($property)) { - $instance->$propertySetter(null); - } + if (!isset($propertySetter)) { + continue; + } - continue; + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->{$propertySetter}(null); } - if (isset($data->{$instance::attributeMap()[$property]})) { - $propertyValue = $data->{$instance::attributeMap()[$property]}; - $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); - } + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->{$propertySetter}(self::deserialize($propertyValue, $type, null)); } - return $instance; } + return $instance; } /** - * Build a query string from an array of key value pairs. - * - * This function can use the return value of `parse()` to build a query - * string. This function does not modify the provided keys when an array is - * encountered (like `http_build_query()` would). - * - * The function is copied from https://github.com/guzzle/psr7/blob/a243f80a1ca7fe8ceed4deee17f12c1930efe662/src/Query.php#L59-L112 - * with a modification which is described in https://github.com/guzzle/psr7/pull/603 - * - * @param array $params Query string parameters. - * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 - * to encode using RFC3986, or PHP_QUERY_RFC1738 - * to encode using RFC1738. - */ + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * The function is copied from https://github.com/guzzle/psr7/blob/a243f80a1ca7fe8ceed4deee17f12c1930efe662/src/Query.php#L59-L112 + * with a modification which is described in https://github.com/guzzle/psr7/pull/603 + * + * @param array $params query string parameters + * @param int|false $encoding set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738 + */ public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string { if (!$params) { @@ -623,21 +613,21 @@ public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): } elseif ($encoding === PHP_QUERY_RFC1738) { $encoder = 'urlencode'; } else { - throw new \InvalidArgumentException('Invalid type'); + throw new InvalidArgumentException('Invalid type'); } - $castBool = Configuration::BOOLEAN_FORMAT_INT === Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString() - ? function ($v) { return (int) $v; } + $castBool = Configuration::BOOLEAN_FORMAT_INT == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString() + ? function ($v) { return (int)$v; } : function ($v) { return $v ? 'true' : 'false'; }; $qs = ''; foreach ($params as $k => $v) { - $k = $encoder((string) $k); + $k = $encoder((string)$k); if (!is_array($v)) { $qs .= $k; $v = is_bool($v) ? $castBool($v) : $v; if ($v !== null) { - $qs .= '='.$encoder((string) $v); + $qs .= '=' . $encoder((string)$v); } $qs .= '&'; } else { @@ -645,14 +635,14 @@ public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): $qs .= $k; $vv = is_bool($vv) ? $castBool($vv) : $vv; if ($vv !== null) { - $qs .= '='.$encoder((string) $vv); + $qs .= '=' . $encoder((string)$vv); } $qs .= '&'; } } } - return $qs ? (string) substr($qs, 0, -1) : ''; + return $qs ? (string)substr($qs, 0, -1) : ''; } /** From 5d264c9be170cc9d194b9221732687f8ee8dc459 Mon Sep 17 00:00:00 2001 From: Monica Auriemma Date: Mon, 17 Mar 2025 15:24:00 -0400 Subject: [PATCH 6/8] updated config file --- sdks/php/openapi-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/sdks/php/openapi-config.yaml b/sdks/php/openapi-config.yaml index f761f58f7..f881d81e0 100644 --- a/sdks/php/openapi-config.yaml +++ b/sdks/php/openapi-config.yaml @@ -34,3 +34,4 @@ files: globalProperties: apiTests: false modelTests: false + removeEnumValuePrefix: true \ No newline at end of file From 06d5791e3cfe0c8a32836fdfee6284d3d6fb0e61 Mon Sep 17 00:00:00 2001 From: Juan Treminio Date: Thu, 20 Mar 2025 12:29:18 -0500 Subject: [PATCH 7/8] Adds copy-constants.php --- sdks/php/bin/copy-constants.php | 64 +++++++++++++++++++ sdks/php/run-build | 3 + sdks/php/src/Model/SubFormFieldRuleAction.php | 2 + 3 files changed, 69 insertions(+) create mode 100755 sdks/php/bin/copy-constants.php diff --git a/sdks/php/bin/copy-constants.php b/sdks/php/bin/copy-constants.php new file mode 100755 index 000000000..f71f52441 --- /dev/null +++ b/sdks/php/bin/copy-constants.php @@ -0,0 +1,64 @@ +#!/usr/bin/env php +run(); diff --git a/sdks/php/run-build b/sdks/php/run-build index e52a919bf..e1012e02f 100755 --- a/sdks/php/run-build +++ b/sdks/php/run-build @@ -48,6 +48,9 @@ docker run --rm \ -w "${WORKING_DIR}" \ perl bash ./bin/scan_for +printf "Adding old-style constant names ...\n" +bash "${DIR}/bin/php-8" ./bin/copy-constants.php + # avoid docker messing with permissions if [[ -z "$GITHUB_ACTIONS" ]]; then chmod 644 "${DIR}/README.md" diff --git a/sdks/php/src/Model/SubFormFieldRuleAction.php b/sdks/php/src/Model/SubFormFieldRuleAction.php index 3ec8988e9..39e7c0c87 100644 --- a/sdks/php/src/Model/SubFormFieldRuleAction.php +++ b/sdks/php/src/Model/SubFormFieldRuleAction.php @@ -239,7 +239,9 @@ public function getModelName() } public const TYPE_CHANGE_FIELD_VISIBILITY = 'change-field-visibility'; + public const TYPE_FIELD_VISIBILITY = self::TYPE_CHANGE_FIELD_VISIBILITY; public const TYPE_CHANGE_GROUP_VISIBILITY = 'change-group-visibility'; + public const TYPE_GROUP_VISIBILITY = self::TYPE_CHANGE_GROUP_VISIBILITY; /** * Gets allowable values of the enum From 243aadb7d1b3c8201042e0f99e8f3550e5878062 Mon Sep 17 00:00:00 2001 From: Juan Treminio Date: Thu, 20 Mar 2025 12:31:50 -0500 Subject: [PATCH 8/8] Removes removeEnumValuePrefix --- sdks/php/openapi-config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/sdks/php/openapi-config.yaml b/sdks/php/openapi-config.yaml index f881d81e0..f761f58f7 100644 --- a/sdks/php/openapi-config.yaml +++ b/sdks/php/openapi-config.yaml @@ -34,4 +34,3 @@ files: globalProperties: apiTests: false modelTests: false - removeEnumValuePrefix: true \ No newline at end of file