From 1a1f538e0fadb03eea74be83e734f663ddfb97c1 Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Wed, 16 Apr 2025 16:55:20 +0300 Subject: [PATCH] Codegen: Marketing Forms --- codegen/Marketing/Forms/Api/FormsApi.php | 199 +++++----- codegen/Marketing/Forms/ApiException.php | 8 +- codegen/Marketing/Forms/Configuration.php | 4 +- codegen/Marketing/Forms/HeaderSelector.php | 32 +- ...esponseFormDefinitionBaseForwardPaging.php | 6 +- ...efinitionBaseForwardPagingResultsInner.php | 6 +- .../Marketing/Forms/Model/DatepickerField.php | 302 +++++++-------- .../Marketing/Forms/Model/DependentField.php | 6 +- .../Model/DependentFieldDependentField.php | 362 +++++++++--------- .../Forms/Model/DependentFieldFilter.php | 164 ++++---- .../Marketing/Forms/Model/DropdownField.php | 342 ++++++++--------- codegen/Marketing/Forms/Model/EmailField.php | 302 +++++++-------- .../Forms/Model/EmailFieldValidation.php | 78 ++-- .../Forms/Model/EnumeratedFieldOption.php | 132 +++---- codegen/Marketing/Forms/Model/Error.php | 6 +- codegen/Marketing/Forms/Model/ErrorDetail.php | 6 +- codegen/Marketing/Forms/Model/FieldGroup.php | 6 +- codegen/Marketing/Forms/Model/FileField.php | 336 ++++++++-------- .../Forms/Model/FormDefinitionBase.php | 6 +- .../Model/FormDefinitionCreateRequestBase.php | 6 +- .../Forms/Model/FormDisplayOptions.php | 6 +- .../Forms/Model/FormPostSubmitAction.php | 6 +- codegen/Marketing/Forms/Model/FormStyle.php | 6 +- .../Marketing/Forms/Model/ForwardPaging.php | 6 +- .../Forms/Model/HubSpotFormConfiguration.php | 6 +- .../Forms/Model/HubSpotFormDefinition.php | 6 +- ...FormDefinitionAllOfLegalConsentOptions.php | 132 +++---- .../HubSpotFormDefinitionCreateRequest.php | 6 +- ...nCreateRequestAllOfLegalConsentOptions.php | 132 +++---- .../HubSpotFormDefinitionPatchRequest.php | 6 +- .../Forms/Model/LegalConsentCheckbox.php | 94 ++--- ...ConsentOptionsExplicitConsentToProcess.php | 206 +++++----- ...ConsentOptionsImplicitConsentToProcess.php | 106 ++--- .../LegalConsentOptionsLegitimateInterest.php | 138 +++---- .../Forms/Model/LegalConsentOptionsNone.php | 8 +- .../Marketing/Forms/Model/LifecycleStage.php | 6 +- .../Forms/Model/MobilePhoneField.php | 302 +++++++-------- .../Marketing/Forms/Model/ModelInterface.php | 2 +- .../Forms/Model/MultiLineTextField.php | 302 +++++++-------- .../Forms/Model/MultipleCheckboxesField.php | 310 +++++++-------- codegen/Marketing/Forms/Model/NextPage.php | 6 +- codegen/Marketing/Forms/Model/NumberField.php | 302 +++++++-------- .../Forms/Model/NumberFieldValidation.php | 10 +- .../Forms/Model/PaymentLinkRadioField.php | 310 +++++++-------- codegen/Marketing/Forms/Model/PhoneField.php | 338 ++++++++-------- .../Forms/Model/PhoneFieldValidation.php | 10 +- codegen/Marketing/Forms/Model/RadioField.php | 342 ++++++++--------- .../Forms/Model/SingleCheckboxField.php | 282 +++++++------- .../Forms/Model/SingleLineTextField.php | 302 +++++++-------- codegen/Marketing/Forms/ObjectSerializer.php | 98 +++-- 50 files changed, 3083 insertions(+), 3012 deletions(-) diff --git a/codegen/Marketing/Forms/Api/FormsApi.php b/codegen/Marketing/Forms/Api/FormsApi.php index 5b61a8431..09cf1946a 100644 --- a/codegen/Marketing/Forms/Api/FormsApi.php +++ b/codegen/Marketing/Forms/Api/FormsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -98,13 +98,13 @@ class FormsApi * @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 ) { $this->client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); $this->headerSelector = $selector ?: new HeaderSelector(); $this->hostIndex = $hostIndex; } @@ -192,18 +192,6 @@ public function archiveWithHttpInfo($form_id, string $contentType = self::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() - ); - } return [null, $statusCode, $response->getHeaders()]; @@ -434,18 +422,6 @@ public function createWithHttpInfo($form_definition_create_request_base, 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() - ); - } switch($statusCode) { case 201: @@ -504,6 +480,19 @@ public function createWithHttpInfo($form_definition_create_request_base, string ]; } + 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 = '\HubSpot\Client\Marketing\Forms\Model\FormDefinitionBase'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -729,7 +718,7 @@ public function createRequest($form_definition_create_request_base, string $cont * Get a form definition * * @param string $form_id The unique identifier of the form (required) - * @param bool $archived Whether to return only results that have been archived. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \HubSpot\Client\Marketing\Forms\ApiException on non-2xx response or if the response body is not in the expected format @@ -748,7 +737,7 @@ public function getById($form_id, $archived = null, string $contentType = self:: * Get a form definition * * @param string $form_id The unique identifier of the form (required) - * @param bool $archived Whether to return only results that have been archived. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \HubSpot\Client\Marketing\Forms\ApiException on non-2xx response or if the response body is not in the expected format @@ -781,18 +770,6 @@ public function getByIdWithHttpInfo($form_id, $archived = null, 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() - ); - } switch($statusCode) { case 200: @@ -851,6 +828,19 @@ public function getByIdWithHttpInfo($form_id, $archived = null, string $contentT ]; } + 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 = '\HubSpot\Client\Marketing\Forms\Model\FormDefinitionBase'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -908,7 +898,7 @@ public function getByIdWithHttpInfo($form_id, $archived = null, string $contentT * Get a form definition * * @param string $form_id The unique identifier of the form (required) - * @param bool $archived Whether to return only results that have been archived. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -930,7 +920,7 @@ function ($response) { * Get a form definition * * @param string $form_id The unique identifier of the form (required) - * @param bool $archived Whether to return only results that have been archived. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -981,7 +971,7 @@ function ($exception) { * Create request for operation 'getById' * * @param string $form_id The unique identifier of the form (required) - * @param bool $archived Whether to return only results that have been archived. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1089,10 +1079,10 @@ public function getByIdRequest($form_id, $archived = null, string $contentType = * * Get a list of forms * - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to display per page. (optional) - * @param bool $archived Whether to return only results that have been archived. (optional) - * @param string[] $form_types The form types to be included in the results. (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to display per page. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional) + * @param string[]|null $form_types The form types to be included in the results. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \HubSpot\Client\Marketing\Forms\ApiException on non-2xx response or if the response body is not in the expected format @@ -1110,10 +1100,10 @@ public function getPage($after = null, $limit = null, $archived = null, $form_ty * * Get a list of forms * - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to display per page. (optional) - * @param bool $archived Whether to return only results that have been archived. (optional) - * @param string[] $form_types The form types to be included in the results. (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to display per page. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional) + * @param string[]|null $form_types The form types to be included in the results. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \HubSpot\Client\Marketing\Forms\ApiException on non-2xx response or if the response body is not in the expected format @@ -1146,18 +1136,6 @@ public function getPageWithHttpInfo($after = null, $limit = null, $archived = nu $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -1216,6 +1194,19 @@ public function getPageWithHttpInfo($after = null, $limit = null, $archived = nu ]; } + 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 = '\HubSpot\Client\Marketing\Forms\Model\CollectionResponseFormDefinitionBaseForwardPaging'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1272,10 +1263,10 @@ public function getPageWithHttpInfo($after = null, $limit = null, $archived = nu * * Get a list of forms * - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to display per page. (optional) - * @param bool $archived Whether to return only results that have been archived. (optional) - * @param string[] $form_types The form types to be included in the results. (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to display per page. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional) + * @param string[]|null $form_types The form types to be included in the results. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1296,10 +1287,10 @@ function ($response) { * * Get a list of forms * - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to display per page. (optional) - * @param bool $archived Whether to return only results that have been archived. (optional) - * @param string[] $form_types The form types to be included in the results. (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to display per page. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional) + * @param string[]|null $form_types The form types to be included in the results. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1349,10 +1340,10 @@ function ($exception) { /** * Create request for operation 'getPage' * - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to display per page. (optional) - * @param bool $archived Whether to return only results that have been archived. (optional) - * @param string[] $form_types The form types to be included in the results. (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to display per page. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional) + * @param string[]|null $form_types The form types to be included in the results. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1528,18 +1519,6 @@ public function replaceWithHttpInfo($form_id, $hub_spot_form_definition, 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() - ); - } switch($statusCode) { case 200: @@ -1598,6 +1577,19 @@ public function replaceWithHttpInfo($form_id, $hub_spot_form_definition, string ]; } + 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 = '\HubSpot\Client\Marketing\Forms\Model\FormDefinitionBase'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1893,18 +1885,6 @@ public function updateWithHttpInfo($form_id, $hub_spot_form_definition_patch_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() - ); - } switch($statusCode) { case 200: @@ -1963,6 +1943,19 @@ public function updateWithHttpInfo($form_id, $hub_spot_form_definition_patch_req ]; } + 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 = '\HubSpot\Client\Marketing\Forms\Model\FormDefinitionBase'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer diff --git a/codegen/Marketing/Forms/ApiException.php b/codegen/Marketing/Forms/ApiException.php index 33ecc0939..bb7f1d575 100644 --- a/codegen/Marketing/Forms/ApiException.php +++ b/codegen/Marketing/Forms/ApiException.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -49,7 +49,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected $responseHeaders; @@ -65,7 +65,7 @@ class ApiException extends Exception * * @param string $message Error message * @param int $code HTTP status code - * @param string[]|null $responseHeaders HTTP response header + * @param string[][]|null $responseHeaders HTTP response header * @param \stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string */ public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) @@ -78,7 +78,7 @@ public function __construct($message = "", $code = 0, $responseHeaders = [], $re /** * Gets the HTTP response header * - * @return string[]|null HTTP response header + * @return string[][]|null HTTP response header */ public function getResponseHeaders() { diff --git a/codegen/Marketing/Forms/Configuration.php b/codegen/Marketing/Forms/Configuration.php index 641a759c4..3c8f03b42 100644 --- a/codegen/Marketing/Forms/Configuration.php +++ b/codegen/Marketing/Forms/Configuration.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -486,7 +486,7 @@ public function getHostSettings() * @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/codegen/Marketing/Forms/HeaderSelector.php b/codegen/Marketing/Forms/HeaderSelector.php index e26605506..6f39ebaa4 100644 --- a/codegen/Marketing/Forms/HeaderSelector.php +++ b/codegen/Marketing/Forms/HeaderSelector.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -85,7 +85,7 @@ private function selectAcceptHeader(array $accept): ?string } # 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); } @@ -95,6 +95,34 @@ private function selectAcceptHeader(array $accept): ?string 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/codegen/Marketing/Forms/Model/CollectionResponseFormDefinitionBaseForwardPaging.php b/codegen/Marketing/Forms/Model/CollectionResponseFormDefinitionBaseForwardPaging.php index 196add296..21d33b55e 100644 --- a/codegen/Marketing/Forms/Model/CollectionResponseFormDefinitionBaseForwardPaging.php +++ b/codegen/Marketing/Forms/Model/CollectionResponseFormDefinitionBaseForwardPaging.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -245,10 +245,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('paging', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); diff --git a/codegen/Marketing/Forms/Model/CollectionResponseFormDefinitionBaseForwardPagingResultsInner.php b/codegen/Marketing/Forms/Model/CollectionResponseFormDefinitionBaseForwardPagingResultsInner.php index cfa76bf32..84abf9837 100644 --- a/codegen/Marketing/Forms/Model/CollectionResponseFormDefinitionBaseForwardPagingResultsInner.php +++ b/codegen/Marketing/Forms/Model/CollectionResponseFormDefinitionBaseForwardPagingResultsInner.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -312,10 +312,10 @@ public function getFormTypeAllowableValues() /** * 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_type', $data ?? [], 'hubspot'); $this->setIfExists('id', $data ?? [], null); diff --git a/codegen/Marketing/Forms/Model/DatepickerField.php b/codegen/Marketing/Forms/Model/DatepickerField.php index d44de0d55..6703faf4c 100644 --- a/codegen/Marketing/Forms/Model/DatepickerField.php +++ b/codegen/Marketing/Forms/Model/DatepickerField.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -58,16 +58,16 @@ class DatepickerField implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'field_type' => 'string', 'object_type_id' => 'string', + 'hidden' => 'bool', + 'default_value' => 'string', 'name' => 'string', - 'label' => 'string', 'description' => 'string', - 'required' => 'bool', - 'hidden' => 'bool', 'dependent_fields' => '\HubSpot\Client\Marketing\Forms\Model\DependentField[]', + 'label' => 'string', 'placeholder' => 'string', - 'default_value' => 'string' + 'field_type' => 'string', + 'required' => 'bool' ]; /** @@ -78,16 +78,16 @@ class DatepickerField implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'field_type' => null, 'object_type_id' => null, + 'hidden' => null, + 'default_value' => null, 'name' => null, - 'label' => null, 'description' => null, - 'required' => null, - 'hidden' => null, 'dependent_fields' => null, + 'label' => null, 'placeholder' => null, - 'default_value' => null + 'field_type' => null, + 'required' => null ]; /** @@ -96,16 +96,16 @@ class DatepickerField implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'field_type' => false, 'object_type_id' => false, + 'hidden' => false, + 'default_value' => false, 'name' => false, - 'label' => false, 'description' => false, - 'required' => false, - 'hidden' => false, 'dependent_fields' => false, + 'label' => false, 'placeholder' => false, - 'default_value' => false + 'field_type' => false, + 'required' => false ]; /** @@ -194,16 +194,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'field_type' => 'fieldType', 'object_type_id' => 'objectTypeId', + 'hidden' => 'hidden', + 'default_value' => 'defaultValue', 'name' => 'name', - 'label' => 'label', 'description' => 'description', - 'required' => 'required', - 'hidden' => 'hidden', 'dependent_fields' => 'dependentFields', + 'label' => 'label', 'placeholder' => 'placeholder', - 'default_value' => 'defaultValue' + 'field_type' => 'fieldType', + 'required' => 'required' ]; /** @@ -212,16 +212,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'field_type' => 'setFieldType', 'object_type_id' => 'setObjectTypeId', + 'hidden' => 'setHidden', + 'default_value' => 'setDefaultValue', 'name' => 'setName', - 'label' => 'setLabel', 'description' => 'setDescription', - 'required' => 'setRequired', - 'hidden' => 'setHidden', 'dependent_fields' => 'setDependentFields', + 'label' => 'setLabel', 'placeholder' => 'setPlaceholder', - 'default_value' => 'setDefaultValue' + 'field_type' => 'setFieldType', + 'required' => 'setRequired' ]; /** @@ -230,16 +230,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'field_type' => 'getFieldType', 'object_type_id' => 'getObjectTypeId', + 'hidden' => 'getHidden', + 'default_value' => 'getDefaultValue', 'name' => 'getName', - 'label' => 'getLabel', 'description' => 'getDescription', - 'required' => 'getRequired', - 'hidden' => 'getHidden', 'dependent_fields' => 'getDependentFields', + 'label' => 'getLabel', 'placeholder' => 'getPlaceholder', - 'default_value' => 'getDefaultValue' + 'field_type' => 'getFieldType', + 'required' => 'getRequired' ]; /** @@ -307,21 +307,21 @@ public function getFieldTypeAllowableValues() /** * 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('field_type', $data ?? [], 'datepicker'); $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('hidden', $data ?? [], null); + $this->setIfExists('default_value', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('required', $data ?? [], null); - $this->setIfExists('hidden', $data ?? [], null); $this->setIfExists('dependent_fields', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); $this->setIfExists('placeholder', $data ?? [], null); - $this->setIfExists('default_value', $data ?? [], null); + $this->setIfExists('field_type', $data ?? [], 'datepicker'); + $this->setIfExists('required', $data ?? [], null); } /** @@ -351,6 +351,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['hidden'] === null) { + $invalidProperties[] = "'hidden' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['dependent_fields'] === null) { + $invalidProperties[] = "'dependent_fields' can't be null"; + } + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } if ($this->container['field_type'] === null) { $invalidProperties[] = "'field_type' can't be null"; } @@ -363,24 +378,9 @@ public function listInvalidProperties() ); } - if ($this->container['object_type_id'] === null) { - $invalidProperties[] = "'object_type_id' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['label'] === null) { - $invalidProperties[] = "'label' can't be null"; - } if ($this->container['required'] === null) { $invalidProperties[] = "'required' can't be null"; } - if ($this->container['hidden'] === null) { - $invalidProperties[] = "'hidden' can't be null"; - } - if ($this->container['dependent_fields'] === null) { - $invalidProperties[] = "'dependent_fields' can't be null"; - } return $invalidProperties; } @@ -397,119 +397,109 @@ public function valid() /** - * Gets field_type + * Gets object_type_id * * @return string */ - public function getFieldType() + public function getObjectTypeId() { - return $this->container['field_type']; + return $this->container['object_type_id']; } /** - * Sets field_type + * Sets object_type_id * - * @param string $field_type Determines how the field will be displayed and validated. + * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. * * @return self */ - public function setFieldType($field_type) + public function setObjectTypeId($object_type_id) { - if (is_null($field_type)) { - throw new \InvalidArgumentException('non-nullable field_type cannot be null'); - } - $allowedValues = $this->getFieldTypeAllowableValues(); - if (!in_array($field_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'field_type', must be one of '%s'", - $field_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); } - $this->container['field_type'] = $field_type; + $this->container['object_type_id'] = $object_type_id; return $this; } /** - * Gets object_type_id + * Gets hidden * - * @return string + * @return bool */ - public function getObjectTypeId() + public function getHidden() { - return $this->container['object_type_id']; + return $this->container['hidden']; } /** - * Sets object_type_id + * Sets hidden * - * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. + * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. * * @return self */ - public function setObjectTypeId($object_type_id) + public function setHidden($hidden) { - if (is_null($object_type_id)) { - throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + if (is_null($hidden)) { + throw new \InvalidArgumentException('non-nullable hidden cannot be null'); } - $this->container['object_type_id'] = $object_type_id; + $this->container['hidden'] = $hidden; return $this; } /** - * Gets name + * Gets default_value * - * @return string + * @return string|null */ - public function getName() + public function getDefaultValue() { - return $this->container['name']; + return $this->container['default_value']; } /** - * Sets name + * Sets default_value * - * @param string $name The identifier of the field. In combination with the object type ID, it must be unique. + * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. * * @return self */ - public function setName($name) + public function setDefaultValue($default_value) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($default_value)) { + throw new \InvalidArgumentException('non-nullable default_value cannot be null'); } - $this->container['name'] = $name; + $this->container['default_value'] = $default_value; return $this; } /** - * Gets label + * Gets name * * @return string */ - public function getLabel() + public function getName() { - return $this->container['label']; + return $this->container['name']; } /** - * Sets label + * Sets name * - * @param string $label The main label for the form field. + * @param string $name The identifier of the field. In combination with the object type ID, it must be unique. * * @return self */ - public function setLabel($label) + public function setName($name) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['label'] = $label; + $this->container['name'] = $name; return $this; } @@ -542,136 +532,146 @@ public function setDescription($description) } /** - * Gets required + * Gets dependent_fields * - * @return bool + * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] */ - public function getRequired() + public function getDependentFields() { - return $this->container['required']; + return $this->container['dependent_fields']; } /** - * Sets required + * Sets dependent_fields * - * @param bool $required Whether a value for this field is required when submitting the form. + * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. * * @return self */ - public function setRequired($required) + public function setDependentFields($dependent_fields) { - if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + if (is_null($dependent_fields)) { + throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); } - $this->container['required'] = $required; + $this->container['dependent_fields'] = $dependent_fields; return $this; } /** - * Gets hidden + * Gets label * - * @return bool + * @return string */ - public function getHidden() + public function getLabel() { - return $this->container['hidden']; + return $this->container['label']; } /** - * Sets hidden + * Sets label * - * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. + * @param string $label The main label for the form field. * * @return self */ - public function setHidden($hidden) + public function setLabel($label) { - if (is_null($hidden)) { - throw new \InvalidArgumentException('non-nullable hidden cannot be null'); + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); } - $this->container['hidden'] = $hidden; + $this->container['label'] = $label; return $this; } /** - * Gets dependent_fields + * Gets placeholder * - * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] + * @return string|null */ - public function getDependentFields() + public function getPlaceholder() { - return $this->container['dependent_fields']; + return $this->container['placeholder']; } /** - * Sets dependent_fields + * Sets placeholder * - * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. + * @param string|null $placeholder The prompt text showing when the field isn't filled in. * * @return self */ - public function setDependentFields($dependent_fields) + public function setPlaceholder($placeholder) { - if (is_null($dependent_fields)) { - throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); + if (is_null($placeholder)) { + throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); } - $this->container['dependent_fields'] = $dependent_fields; + $this->container['placeholder'] = $placeholder; return $this; } /** - * Gets placeholder + * Gets field_type * - * @return string|null + * @return string */ - public function getPlaceholder() + public function getFieldType() { - return $this->container['placeholder']; + return $this->container['field_type']; } /** - * Sets placeholder + * Sets field_type * - * @param string|null $placeholder The prompt text showing when the field isn't filled in. + * @param string $field_type Determines how the field will be displayed and validated. * * @return self */ - public function setPlaceholder($placeholder) + public function setFieldType($field_type) { - if (is_null($placeholder)) { - throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); + if (is_null($field_type)) { + throw new \InvalidArgumentException('non-nullable field_type cannot be null'); } - $this->container['placeholder'] = $placeholder; + $allowedValues = $this->getFieldTypeAllowableValues(); + if (!in_array($field_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'field_type', must be one of '%s'", + $field_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['field_type'] = $field_type; return $this; } /** - * Gets default_value + * Gets required * - * @return string|null + * @return bool */ - public function getDefaultValue() + public function getRequired() { - return $this->container['default_value']; + return $this->container['required']; } /** - * Sets default_value + * Sets required * - * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. + * @param bool $required Whether a value for this field is required when submitting the form. * * @return self */ - public function setDefaultValue($default_value) + public function setRequired($required) { - if (is_null($default_value)) { - throw new \InvalidArgumentException('non-nullable default_value cannot be null'); + if (is_null($required)) { + throw new \InvalidArgumentException('non-nullable required cannot be null'); } - $this->container['default_value'] = $default_value; + $this->container['required'] = $required; return $this; } diff --git a/codegen/Marketing/Forms/Model/DependentField.php b/codegen/Marketing/Forms/Model/DependentField.php index 465f470c1..01498844d 100644 --- a/codegen/Marketing/Forms/Model/DependentField.php +++ b/codegen/Marketing/Forms/Model/DependentField.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -246,10 +246,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('dependent_condition', $data ?? [], null); $this->setIfExists('dependent_field', $data ?? [], null); diff --git a/codegen/Marketing/Forms/Model/DependentFieldDependentField.php b/codegen/Marketing/Forms/Model/DependentFieldDependentField.php index 9588de353..b9358c210 100644 --- a/codegen/Marketing/Forms/Model/DependentFieldDependentField.php +++ b/codegen/Marketing/Forms/Model/DependentFieldDependentField.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -57,20 +57,20 @@ class DependentFieldDependentField implements ModelInterface, ArrayAccess, \Json * @var string[] */ protected static $openAPITypes = [ - 'field_type' => 'string', 'object_type_id' => 'string', + 'hidden' => 'bool', + 'default_value' => 'string', 'name' => 'string', - 'label' => 'string', 'description' => 'string', - 'required' => 'bool', - 'hidden' => 'bool', 'dependent_fields' => '\HubSpot\Client\Marketing\Forms\Model\DependentField[]', + 'label' => 'string', 'placeholder' => 'string', - 'default_value' => 'string', + 'field_type' => 'string', + 'required' => 'bool', 'validation' => '\HubSpot\Client\Marketing\Forms\Model\NumberFieldValidation', 'use_country_code_select' => 'bool', - 'default_values' => 'string[]', 'options' => '\HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[]', + 'default_values' => 'string[]', 'allow_multiple_files' => 'bool' ]; @@ -82,20 +82,20 @@ class DependentFieldDependentField implements ModelInterface, ArrayAccess, \Json * @psalm-var array */ protected static $openAPIFormats = [ - 'field_type' => null, 'object_type_id' => null, + 'hidden' => null, + 'default_value' => null, 'name' => null, - 'label' => null, 'description' => null, - 'required' => null, - 'hidden' => null, 'dependent_fields' => null, + 'label' => null, 'placeholder' => null, - 'default_value' => null, + 'field_type' => null, + 'required' => null, 'validation' => null, 'use_country_code_select' => null, - 'default_values' => null, 'options' => null, + 'default_values' => null, 'allow_multiple_files' => null ]; @@ -105,20 +105,20 @@ class DependentFieldDependentField implements ModelInterface, ArrayAccess, \Json * @var boolean[] */ protected static array $openAPINullables = [ - 'field_type' => false, 'object_type_id' => false, + 'hidden' => false, + 'default_value' => false, 'name' => false, - 'label' => false, 'description' => false, - 'required' => false, - 'hidden' => false, 'dependent_fields' => false, + 'label' => false, 'placeholder' => false, - 'default_value' => false, + 'field_type' => false, + 'required' => false, 'validation' => false, 'use_country_code_select' => false, - 'default_values' => false, 'options' => false, + 'default_values' => false, 'allow_multiple_files' => false ]; @@ -208,20 +208,20 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'field_type' => 'fieldType', 'object_type_id' => 'objectTypeId', + 'hidden' => 'hidden', + 'default_value' => 'defaultValue', 'name' => 'name', - 'label' => 'label', 'description' => 'description', - 'required' => 'required', - 'hidden' => 'hidden', 'dependent_fields' => 'dependentFields', + 'label' => 'label', 'placeholder' => 'placeholder', - 'default_value' => 'defaultValue', + 'field_type' => 'fieldType', + 'required' => 'required', 'validation' => 'validation', 'use_country_code_select' => 'useCountryCodeSelect', - 'default_values' => 'defaultValues', 'options' => 'options', + 'default_values' => 'defaultValues', 'allow_multiple_files' => 'allowMultipleFiles' ]; @@ -231,20 +231,20 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'field_type' => 'setFieldType', 'object_type_id' => 'setObjectTypeId', + 'hidden' => 'setHidden', + 'default_value' => 'setDefaultValue', 'name' => 'setName', - 'label' => 'setLabel', 'description' => 'setDescription', - 'required' => 'setRequired', - 'hidden' => 'setHidden', 'dependent_fields' => 'setDependentFields', + 'label' => 'setLabel', 'placeholder' => 'setPlaceholder', - 'default_value' => 'setDefaultValue', + 'field_type' => 'setFieldType', + 'required' => 'setRequired', 'validation' => 'setValidation', 'use_country_code_select' => 'setUseCountryCodeSelect', - 'default_values' => 'setDefaultValues', 'options' => 'setOptions', + 'default_values' => 'setDefaultValues', 'allow_multiple_files' => 'setAllowMultipleFiles' ]; @@ -254,20 +254,20 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'field_type' => 'getFieldType', 'object_type_id' => 'getObjectTypeId', + 'hidden' => 'getHidden', + 'default_value' => 'getDefaultValue', 'name' => 'getName', - 'label' => 'getLabel', 'description' => 'getDescription', - 'required' => 'getRequired', - 'hidden' => 'getHidden', 'dependent_fields' => 'getDependentFields', + 'label' => 'getLabel', 'placeholder' => 'getPlaceholder', - 'default_value' => 'getDefaultValue', + 'field_type' => 'getFieldType', + 'required' => 'getRequired', 'validation' => 'getValidation', 'use_country_code_select' => 'getUseCountryCodeSelect', - 'default_values' => 'getDefaultValues', 'options' => 'getOptions', + 'default_values' => 'getDefaultValues', 'allow_multiple_files' => 'getAllowMultipleFiles' ]; @@ -336,25 +336,25 @@ public function getFieldTypeAllowableValues() /** * 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('field_type', $data ?? [], 'payment_link_radio'); $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('hidden', $data ?? [], null); + $this->setIfExists('default_value', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('required', $data ?? [], null); - $this->setIfExists('hidden', $data ?? [], null); $this->setIfExists('dependent_fields', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); $this->setIfExists('placeholder', $data ?? [], null); - $this->setIfExists('default_value', $data ?? [], null); + $this->setIfExists('field_type', $data ?? [], 'payment_link_radio'); + $this->setIfExists('required', $data ?? [], null); $this->setIfExists('validation', $data ?? [], null); $this->setIfExists('use_country_code_select', $data ?? [], null); - $this->setIfExists('default_values', $data ?? [], null); $this->setIfExists('options', $data ?? [], null); + $this->setIfExists('default_values', $data ?? [], null); $this->setIfExists('allow_multiple_files', $data ?? [], null); } @@ -385,6 +385,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['hidden'] === null) { + $invalidProperties[] = "'hidden' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['dependent_fields'] === null) { + $invalidProperties[] = "'dependent_fields' can't be null"; + } + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } if ($this->container['field_type'] === null) { $invalidProperties[] = "'field_type' can't be null"; } @@ -397,36 +412,21 @@ public function listInvalidProperties() ); } - if ($this->container['object_type_id'] === null) { - $invalidProperties[] = "'object_type_id' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['label'] === null) { - $invalidProperties[] = "'label' can't be null"; - } if ($this->container['required'] === null) { $invalidProperties[] = "'required' can't be null"; } - if ($this->container['hidden'] === null) { - $invalidProperties[] = "'hidden' can't be null"; - } - if ($this->container['dependent_fields'] === null) { - $invalidProperties[] = "'dependent_fields' can't be null"; - } if ($this->container['validation'] === null) { $invalidProperties[] = "'validation' can't be null"; } if ($this->container['use_country_code_select'] === null) { $invalidProperties[] = "'use_country_code_select' can't be null"; } - if ($this->container['default_values'] === null) { - $invalidProperties[] = "'default_values' can't be null"; - } if ($this->container['options'] === null) { $invalidProperties[] = "'options' can't be null"; } + if ($this->container['default_values'] === null) { + $invalidProperties[] = "'default_values' can't be null"; + } if ($this->container['allow_multiple_files'] === null) { $invalidProperties[] = "'allow_multiple_files' can't be null"; } @@ -446,119 +446,109 @@ public function valid() /** - * Gets field_type + * Gets object_type_id * * @return string */ - public function getFieldType() + public function getObjectTypeId() { - return $this->container['field_type']; + return $this->container['object_type_id']; } /** - * Sets field_type + * Sets object_type_id * - * @param string $field_type field_type + * @param string $object_type_id object_type_id * * @return self */ - public function setFieldType($field_type) + public function setObjectTypeId($object_type_id) { - if (is_null($field_type)) { - throw new \InvalidArgumentException('non-nullable field_type cannot be null'); - } - $allowedValues = $this->getFieldTypeAllowableValues(); - if (!in_array($field_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'field_type', must be one of '%s'", - $field_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); } - $this->container['field_type'] = $field_type; + $this->container['object_type_id'] = $object_type_id; return $this; } /** - * Gets object_type_id + * Gets hidden * - * @return string + * @return bool */ - public function getObjectTypeId() + public function getHidden() { - return $this->container['object_type_id']; + return $this->container['hidden']; } /** - * Sets object_type_id + * Sets hidden * - * @param string $object_type_id object_type_id + * @param bool $hidden hidden * * @return self */ - public function setObjectTypeId($object_type_id) + public function setHidden($hidden) { - if (is_null($object_type_id)) { - throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + if (is_null($hidden)) { + throw new \InvalidArgumentException('non-nullable hidden cannot be null'); } - $this->container['object_type_id'] = $object_type_id; + $this->container['hidden'] = $hidden; return $this; } /** - * Gets name + * Gets default_value * - * @return string + * @return string|null */ - public function getName() + public function getDefaultValue() { - return $this->container['name']; + return $this->container['default_value']; } /** - * Sets name + * Sets default_value * - * @param string $name name + * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. * * @return self */ - public function setName($name) + public function setDefaultValue($default_value) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($default_value)) { + throw new \InvalidArgumentException('non-nullable default_value cannot be null'); } - $this->container['name'] = $name; + $this->container['default_value'] = $default_value; return $this; } /** - * Gets label + * Gets name * * @return string */ - public function getLabel() + public function getName() { - return $this->container['label']; + return $this->container['name']; } /** - * Sets label + * Sets name * - * @param string $label label + * @param string $name name * * @return self */ - public function setLabel($label) + public function setName($name) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['label'] = $label; + $this->container['name'] = $name; return $this; } @@ -591,136 +581,146 @@ public function setDescription($description) } /** - * Gets required + * Gets dependent_fields * - * @return bool + * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] */ - public function getRequired() + public function getDependentFields() { - return $this->container['required']; + return $this->container['dependent_fields']; } /** - * Sets required + * Sets dependent_fields * - * @param bool $required required + * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields dependent_fields * * @return self */ - public function setRequired($required) + public function setDependentFields($dependent_fields) { - if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + if (is_null($dependent_fields)) { + throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); } - $this->container['required'] = $required; + $this->container['dependent_fields'] = $dependent_fields; return $this; } /** - * Gets hidden + * Gets label * - * @return bool + * @return string */ - public function getHidden() + public function getLabel() { - return $this->container['hidden']; + return $this->container['label']; } /** - * Sets hidden + * Sets label * - * @param bool $hidden hidden + * @param string $label label * * @return self */ - public function setHidden($hidden) + public function setLabel($label) { - if (is_null($hidden)) { - throw new \InvalidArgumentException('non-nullable hidden cannot be null'); + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); } - $this->container['hidden'] = $hidden; + $this->container['label'] = $label; return $this; } /** - * Gets dependent_fields + * Gets placeholder * - * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] + * @return string|null */ - public function getDependentFields() + public function getPlaceholder() { - return $this->container['dependent_fields']; + return $this->container['placeholder']; } /** - * Sets dependent_fields + * Sets placeholder * - * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields dependent_fields + * @param string|null $placeholder The prompt text showing when the field isn't filled in. * * @return self */ - public function setDependentFields($dependent_fields) + public function setPlaceholder($placeholder) { - if (is_null($dependent_fields)) { - throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); + if (is_null($placeholder)) { + throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); } - $this->container['dependent_fields'] = $dependent_fields; + $this->container['placeholder'] = $placeholder; return $this; } /** - * Gets placeholder + * Gets field_type * - * @return string|null + * @return string */ - public function getPlaceholder() + public function getFieldType() { - return $this->container['placeholder']; + return $this->container['field_type']; } /** - * Sets placeholder + * Sets field_type * - * @param string|null $placeholder The prompt text showing when the field isn't filled in. + * @param string $field_type field_type * * @return self */ - public function setPlaceholder($placeholder) + public function setFieldType($field_type) { - if (is_null($placeholder)) { - throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); + if (is_null($field_type)) { + throw new \InvalidArgumentException('non-nullable field_type cannot be null'); } - $this->container['placeholder'] = $placeholder; + $allowedValues = $this->getFieldTypeAllowableValues(); + if (!in_array($field_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'field_type', must be one of '%s'", + $field_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['field_type'] = $field_type; return $this; } /** - * Gets default_value + * Gets required * - * @return string|null + * @return bool */ - public function getDefaultValue() + public function getRequired() { - return $this->container['default_value']; + return $this->container['required']; } /** - * Sets default_value + * Sets required * - * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. + * @param bool $required required * * @return self */ - public function setDefaultValue($default_value) + public function setRequired($required) { - if (is_null($default_value)) { - throw new \InvalidArgumentException('non-nullable default_value cannot be null'); + if (is_null($required)) { + throw new \InvalidArgumentException('non-nullable required cannot be null'); } - $this->container['default_value'] = $default_value; + $this->container['required'] = $required; return $this; } @@ -780,55 +780,55 @@ public function setUseCountryCodeSelect($use_country_code_select) } /** - * Gets default_values + * Gets options * - * @return string[] + * @return \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] */ - public function getDefaultValues() + public function getOptions() { - return $this->container['default_values']; + return $this->container['options']; } /** - * Sets default_values + * Sets options * - * @param string[] $default_values default_values + * @param \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] $options options * * @return self */ - public function setDefaultValues($default_values) + public function setOptions($options) { - if (is_null($default_values)) { - throw new \InvalidArgumentException('non-nullable default_values cannot be null'); + if (is_null($options)) { + throw new \InvalidArgumentException('non-nullable options cannot be null'); } - $this->container['default_values'] = $default_values; + $this->container['options'] = $options; return $this; } /** - * Gets options + * Gets default_values * - * @return \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] + * @return string[] */ - public function getOptions() + public function getDefaultValues() { - return $this->container['options']; + return $this->container['default_values']; } /** - * Sets options + * Sets default_values * - * @param \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] $options options + * @param string[] $default_values default_values * * @return self */ - public function setOptions($options) + public function setDefaultValues($default_values) { - if (is_null($options)) { - throw new \InvalidArgumentException('non-nullable options cannot be null'); + if (is_null($default_values)) { + throw new \InvalidArgumentException('non-nullable default_values cannot be null'); } - $this->container['options'] = $options; + $this->container['default_values'] = $default_values; return $this; } diff --git a/codegen/Marketing/Forms/Model/DependentFieldFilter.php b/codegen/Marketing/Forms/Model/DependentFieldFilter.php index 674835a71..5c7bf4961 100644 --- a/codegen/Marketing/Forms/Model/DependentFieldFilter.php +++ b/codegen/Marketing/Forms/Model/DependentFieldFilter.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -58,10 +58,10 @@ class DependentFieldFilter implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'operator' => 'string', - 'value' => 'string', - 'values' => 'string[]', 'range_start' => 'string', + 'values' => 'string[]', + 'value' => 'string', + 'operator' => 'string', 'range_end' => 'string' ]; @@ -73,10 +73,10 @@ class DependentFieldFilter implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ - 'operator' => null, - 'value' => null, - 'values' => null, 'range_start' => null, + 'values' => null, + 'value' => null, + 'operator' => null, 'range_end' => null ]; @@ -86,10 +86,10 @@ class DependentFieldFilter implements ModelInterface, ArrayAccess, \JsonSerializ * @var boolean[] */ protected static array $openAPINullables = [ - 'operator' => false, - 'value' => false, - 'values' => false, 'range_start' => false, + 'values' => false, + 'value' => false, + 'operator' => false, 'range_end' => false ]; @@ -179,10 +179,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'operator' => 'operator', - 'value' => 'value', - 'values' => 'values', 'range_start' => 'rangeStart', + 'values' => 'values', + 'value' => 'value', + 'operator' => 'operator', 'range_end' => 'rangeEnd' ]; @@ -192,10 +192,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'operator' => 'setOperator', - 'value' => 'setValue', - 'values' => 'setValues', 'range_start' => 'setRangeStart', + 'values' => 'setValues', + 'value' => 'setValue', + 'operator' => 'setOperator', 'range_end' => 'setRangeEnd' ]; @@ -205,10 +205,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'operator' => 'getOperator', - 'value' => 'getValue', - 'values' => 'getValues', 'range_start' => 'getRangeStart', + 'values' => 'getValues', + 'value' => 'getValue', + 'operator' => 'getOperator', 'range_end' => 'getRangeEnd' ]; @@ -317,15 +317,15 @@ 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('operator', $data ?? [], null); - $this->setIfExists('value', $data ?? [], null); - $this->setIfExists('values', $data ?? [], null); $this->setIfExists('range_start', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); $this->setIfExists('range_end', $data ?? [], null); } @@ -356,6 +356,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['range_start'] === null) { + $invalidProperties[] = "'range_start' can't be null"; + } + if ($this->container['values'] === null) { + $invalidProperties[] = "'values' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } @@ -368,15 +377,6 @@ public function listInvalidProperties() ); } - if ($this->container['value'] === null) { - $invalidProperties[] = "'value' can't be null"; - } - if ($this->container['values'] === null) { - $invalidProperties[] = "'values' can't be null"; - } - if ($this->container['range_start'] === null) { - $invalidProperties[] = "'range_start' can't be null"; - } if ($this->container['range_end'] === null) { $invalidProperties[] = "'range_end' can't be null"; } @@ -396,119 +396,119 @@ public function valid() /** - * Gets operator + * Gets range_start * * @return string */ - public function getOperator() + public function getRangeStart() { - return $this->container['operator']; + return $this->container['range_start']; } /** - * Sets operator + * Sets range_start * - * @param string $operator operator + * @param string $range_start * * @return self */ - public function setOperator($operator) + public function setRangeStart($range_start) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); - } - $allowedValues = $this->getOperatorAllowableValues(); - if (!in_array($operator, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'operator', must be one of '%s'", - $operator, - implode("', '", $allowedValues) - ) - ); + if (is_null($range_start)) { + throw new \InvalidArgumentException('non-nullable range_start cannot be null'); } - $this->container['operator'] = $operator; + $this->container['range_start'] = $range_start; return $this; } /** - * Gets value + * Gets values * - * @return string + * @return string[] */ - public function getValue() + public function getValues() { - return $this->container['value']; + return $this->container['values']; } /** - * Sets value + * Sets values * - * @param string $value value + * @param string[] $values * * @return self */ - public function setValue($value) + public function setValues($values) { - if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); } - $this->container['value'] = $value; + $this->container['values'] = $values; return $this; } /** - * Gets values + * Gets value * - * @return string[] + * @return string */ - public function getValues() + public function getValue() { - return $this->container['values']; + return $this->container['value']; } /** - * Sets values + * Sets value * - * @param string[] $values values + * @param string $value * * @return self */ - public function setValues($values) + public function setValue($value) { - if (is_null($values)) { - throw new \InvalidArgumentException('non-nullable values cannot be null'); + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); } - $this->container['values'] = $values; + $this->container['value'] = $value; return $this; } /** - * Gets range_start + * Gets operator * * @return string */ - public function getRangeStart() + public function getOperator() { - return $this->container['range_start']; + return $this->container['operator']; } /** - * Sets range_start + * Sets operator * - * @param string $range_start range_start + * @param string $operator * * @return self */ - public function setRangeStart($range_start) + public function setOperator($operator) { - if (is_null($range_start)) { - throw new \InvalidArgumentException('non-nullable range_start cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['range_start'] = $range_start; + $allowedValues = $this->getOperatorAllowableValues(); + if (!in_array($operator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'operator', must be one of '%s'", + $operator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['operator'] = $operator; return $this; } @@ -526,7 +526,7 @@ public function getRangeEnd() /** * Sets range_end * - * @param string $range_end range_end + * @param string $range_end * * @return self */ diff --git a/codegen/Marketing/Forms/Model/DropdownField.php b/codegen/Marketing/Forms/Model/DropdownField.php index fe5662c3a..fe9dfd5fd 100644 --- a/codegen/Marketing/Forms/Model/DropdownField.php +++ b/codegen/Marketing/Forms/Model/DropdownField.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -58,17 +58,17 @@ class DropdownField implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'field_type' => 'string', 'object_type_id' => 'string', + 'hidden' => 'bool', 'name' => 'string', - 'label' => 'string', + 'options' => '\HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[]', 'description' => 'string', - 'required' => 'bool', - 'hidden' => 'bool', - 'dependent_fields' => '\HubSpot\Client\Marketing\Forms\Model\DependentField[]', 'default_values' => 'string[]', - 'options' => '\HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[]', - 'placeholder' => 'string' + 'dependent_fields' => '\HubSpot\Client\Marketing\Forms\Model\DependentField[]', + 'label' => 'string', + 'placeholder' => 'string', + 'field_type' => 'string', + 'required' => 'bool' ]; /** @@ -79,17 +79,17 @@ class DropdownField implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'field_type' => null, 'object_type_id' => null, + 'hidden' => null, 'name' => null, - 'label' => null, + 'options' => null, 'description' => null, - 'required' => null, - 'hidden' => null, - 'dependent_fields' => null, 'default_values' => null, - 'options' => null, - 'placeholder' => null + 'dependent_fields' => null, + 'label' => null, + 'placeholder' => null, + 'field_type' => null, + 'required' => null ]; /** @@ -98,17 +98,17 @@ class DropdownField implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'field_type' => false, 'object_type_id' => false, + 'hidden' => false, 'name' => false, - 'label' => false, + 'options' => false, 'description' => false, - 'required' => false, - 'hidden' => false, - 'dependent_fields' => false, 'default_values' => false, - 'options' => false, - 'placeholder' => false + 'dependent_fields' => false, + 'label' => false, + 'placeholder' => false, + 'field_type' => false, + 'required' => false ]; /** @@ -197,17 +197,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'field_type' => 'fieldType', 'object_type_id' => 'objectTypeId', + 'hidden' => 'hidden', 'name' => 'name', - 'label' => 'label', + 'options' => 'options', 'description' => 'description', - 'required' => 'required', - 'hidden' => 'hidden', - 'dependent_fields' => 'dependentFields', 'default_values' => 'defaultValues', - 'options' => 'options', - 'placeholder' => 'placeholder' + 'dependent_fields' => 'dependentFields', + 'label' => 'label', + 'placeholder' => 'placeholder', + 'field_type' => 'fieldType', + 'required' => 'required' ]; /** @@ -216,17 +216,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'field_type' => 'setFieldType', 'object_type_id' => 'setObjectTypeId', + 'hidden' => 'setHidden', 'name' => 'setName', - 'label' => 'setLabel', + 'options' => 'setOptions', 'description' => 'setDescription', - 'required' => 'setRequired', - 'hidden' => 'setHidden', - 'dependent_fields' => 'setDependentFields', 'default_values' => 'setDefaultValues', - 'options' => 'setOptions', - 'placeholder' => 'setPlaceholder' + 'dependent_fields' => 'setDependentFields', + 'label' => 'setLabel', + 'placeholder' => 'setPlaceholder', + 'field_type' => 'setFieldType', + 'required' => 'setRequired' ]; /** @@ -235,17 +235,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'field_type' => 'getFieldType', 'object_type_id' => 'getObjectTypeId', + 'hidden' => 'getHidden', 'name' => 'getName', - 'label' => 'getLabel', + 'options' => 'getOptions', 'description' => 'getDescription', - 'required' => 'getRequired', - 'hidden' => 'getHidden', - 'dependent_fields' => 'getDependentFields', 'default_values' => 'getDefaultValues', - 'options' => 'getOptions', - 'placeholder' => 'getPlaceholder' + 'dependent_fields' => 'getDependentFields', + 'label' => 'getLabel', + 'placeholder' => 'getPlaceholder', + 'field_type' => 'getFieldType', + 'required' => 'getRequired' ]; /** @@ -313,22 +313,22 @@ public function getFieldTypeAllowableValues() /** * 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('field_type', $data ?? [], 'dropdown'); $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('hidden', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); + $this->setIfExists('options', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('required', $data ?? [], null); - $this->setIfExists('hidden', $data ?? [], null); - $this->setIfExists('dependent_fields', $data ?? [], null); $this->setIfExists('default_values', $data ?? [], null); - $this->setIfExists('options', $data ?? [], null); + $this->setIfExists('dependent_fields', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); $this->setIfExists('placeholder', $data ?? [], null); + $this->setIfExists('field_type', $data ?? [], 'dropdown'); + $this->setIfExists('required', $data ?? [], null); } /** @@ -358,6 +358,27 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['hidden'] === null) { + $invalidProperties[] = "'hidden' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['options'] === null) { + $invalidProperties[] = "'options' can't be null"; + } + if ($this->container['default_values'] === null) { + $invalidProperties[] = "'default_values' can't be null"; + } + if ($this->container['dependent_fields'] === null) { + $invalidProperties[] = "'dependent_fields' can't be null"; + } + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } if ($this->container['field_type'] === null) { $invalidProperties[] = "'field_type' can't be null"; } @@ -370,30 +391,9 @@ public function listInvalidProperties() ); } - if ($this->container['object_type_id'] === null) { - $invalidProperties[] = "'object_type_id' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['label'] === null) { - $invalidProperties[] = "'label' can't be null"; - } if ($this->container['required'] === null) { $invalidProperties[] = "'required' can't be null"; } - if ($this->container['hidden'] === null) { - $invalidProperties[] = "'hidden' can't be null"; - } - if ($this->container['dependent_fields'] === null) { - $invalidProperties[] = "'dependent_fields' can't be null"; - } - if ($this->container['default_values'] === null) { - $invalidProperties[] = "'default_values' can't be null"; - } - if ($this->container['options'] === null) { - $invalidProperties[] = "'options' can't be null"; - } return $invalidProperties; } @@ -410,65 +410,55 @@ public function valid() /** - * Gets field_type + * Gets object_type_id * * @return string */ - public function getFieldType() + public function getObjectTypeId() { - return $this->container['field_type']; + return $this->container['object_type_id']; } /** - * Sets field_type + * Sets object_type_id * - * @param string $field_type Determines how the field will be displayed and validated. + * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. * * @return self */ - public function setFieldType($field_type) + public function setObjectTypeId($object_type_id) { - if (is_null($field_type)) { - throw new \InvalidArgumentException('non-nullable field_type cannot be null'); - } - $allowedValues = $this->getFieldTypeAllowableValues(); - if (!in_array($field_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'field_type', must be one of '%s'", - $field_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); } - $this->container['field_type'] = $field_type; + $this->container['object_type_id'] = $object_type_id; return $this; } /** - * Gets object_type_id + * Gets hidden * - * @return string + * @return bool */ - public function getObjectTypeId() + public function getHidden() { - return $this->container['object_type_id']; + return $this->container['hidden']; } /** - * Sets object_type_id + * Sets hidden * - * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. + * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. * * @return self */ - public function setObjectTypeId($object_type_id) + public function setHidden($hidden) { - if (is_null($object_type_id)) { - throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + if (is_null($hidden)) { + throw new \InvalidArgumentException('non-nullable hidden cannot be null'); } - $this->container['object_type_id'] = $object_type_id; + $this->container['hidden'] = $hidden; return $this; } @@ -501,28 +491,28 @@ public function setName($name) } /** - * Gets label + * Gets options * - * @return string + * @return \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] */ - public function getLabel() + public function getOptions() { - return $this->container['label']; + return $this->container['options']; } /** - * Sets label + * Sets options * - * @param string $label The main label for the form field. + * @param \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] $options The list of available choices for this field. * * @return self */ - public function setLabel($label) + public function setOptions($options) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($options)) { + throw new \InvalidArgumentException('non-nullable options cannot be null'); } - $this->container['label'] = $label; + $this->container['options'] = $options; return $this; } @@ -555,163 +545,173 @@ public function setDescription($description) } /** - * Gets required + * Gets default_values * - * @return bool + * @return string[] */ - public function getRequired() + public function getDefaultValues() { - return $this->container['required']; + return $this->container['default_values']; } /** - * Sets required + * Sets default_values * - * @param bool $required Whether a value for this field is required when submitting the form. + * @param string[] $default_values The values selected by default. Those values will be submitted unless the customer modifies them. * * @return self */ - public function setRequired($required) + public function setDefaultValues($default_values) { - if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + if (is_null($default_values)) { + throw new \InvalidArgumentException('non-nullable default_values cannot be null'); } - $this->container['required'] = $required; + $this->container['default_values'] = $default_values; return $this; } /** - * Gets hidden + * Gets dependent_fields * - * @return bool + * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] */ - public function getHidden() + public function getDependentFields() { - return $this->container['hidden']; + return $this->container['dependent_fields']; } /** - * Sets hidden + * Sets dependent_fields * - * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. + * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. * * @return self */ - public function setHidden($hidden) + public function setDependentFields($dependent_fields) { - if (is_null($hidden)) { - throw new \InvalidArgumentException('non-nullable hidden cannot be null'); + if (is_null($dependent_fields)) { + throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); } - $this->container['hidden'] = $hidden; + $this->container['dependent_fields'] = $dependent_fields; return $this; } /** - * Gets dependent_fields + * Gets label * - * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] + * @return string */ - public function getDependentFields() + public function getLabel() { - return $this->container['dependent_fields']; + return $this->container['label']; } /** - * Sets dependent_fields + * Sets label * - * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. + * @param string $label The main label for the form field. * * @return self */ - public function setDependentFields($dependent_fields) + public function setLabel($label) { - if (is_null($dependent_fields)) { - throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); } - $this->container['dependent_fields'] = $dependent_fields; + $this->container['label'] = $label; return $this; } /** - * Gets default_values + * Gets placeholder * - * @return string[] + * @return string|null */ - public function getDefaultValues() + public function getPlaceholder() { - return $this->container['default_values']; + return $this->container['placeholder']; } /** - * Sets default_values + * Sets placeholder * - * @param string[] $default_values The values selected by default. Those values will be submitted unless the customer modifies them. + * @param string|null $placeholder The prompt text showing when the field isn't filled in. * * @return self */ - public function setDefaultValues($default_values) + public function setPlaceholder($placeholder) { - if (is_null($default_values)) { - throw new \InvalidArgumentException('non-nullable default_values cannot be null'); + if (is_null($placeholder)) { + throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); } - $this->container['default_values'] = $default_values; + $this->container['placeholder'] = $placeholder; return $this; } /** - * Gets options + * Gets field_type * - * @return \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] + * @return string */ - public function getOptions() + public function getFieldType() { - return $this->container['options']; + return $this->container['field_type']; } /** - * Sets options + * Sets field_type * - * @param \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] $options The list of available choices for this field. + * @param string $field_type Determines how the field will be displayed and validated. * * @return self */ - public function setOptions($options) + public function setFieldType($field_type) { - if (is_null($options)) { - throw new \InvalidArgumentException('non-nullable options cannot be null'); + if (is_null($field_type)) { + throw new \InvalidArgumentException('non-nullable field_type cannot be null'); } - $this->container['options'] = $options; + $allowedValues = $this->getFieldTypeAllowableValues(); + if (!in_array($field_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'field_type', must be one of '%s'", + $field_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['field_type'] = $field_type; return $this; } /** - * Gets placeholder + * Gets required * - * @return string|null + * @return bool */ - public function getPlaceholder() + public function getRequired() { - return $this->container['placeholder']; + return $this->container['required']; } /** - * Sets placeholder + * Sets required * - * @param string|null $placeholder The prompt text showing when the field isn't filled in. + * @param bool $required Whether a value for this field is required when submitting the form. * * @return self */ - public function setPlaceholder($placeholder) + public function setRequired($required) { - if (is_null($placeholder)) { - throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); + if (is_null($required)) { + throw new \InvalidArgumentException('non-nullable required cannot be null'); } - $this->container['placeholder'] = $placeholder; + $this->container['required'] = $required; return $this; } diff --git a/codegen/Marketing/Forms/Model/EmailField.php b/codegen/Marketing/Forms/Model/EmailField.php index 545bfd2be..357d062ab 100644 --- a/codegen/Marketing/Forms/Model/EmailField.php +++ b/codegen/Marketing/Forms/Model/EmailField.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -58,16 +58,16 @@ class EmailField implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'field_type' => 'string', 'object_type_id' => 'string', + 'hidden' => 'bool', + 'default_value' => 'string', 'name' => 'string', - 'label' => 'string', 'description' => 'string', - 'required' => 'bool', - 'hidden' => 'bool', 'dependent_fields' => '\HubSpot\Client\Marketing\Forms\Model\DependentField[]', + 'label' => 'string', 'placeholder' => 'string', - 'default_value' => 'string', + 'field_type' => 'string', + 'required' => 'bool', 'validation' => '\HubSpot\Client\Marketing\Forms\Model\EmailFieldValidation' ]; @@ -79,16 +79,16 @@ class EmailField implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'field_type' => null, 'object_type_id' => null, + 'hidden' => null, + 'default_value' => null, 'name' => null, - 'label' => null, 'description' => null, - 'required' => null, - 'hidden' => null, 'dependent_fields' => null, + 'label' => null, 'placeholder' => null, - 'default_value' => null, + 'field_type' => null, + 'required' => null, 'validation' => null ]; @@ -98,16 +98,16 @@ class EmailField implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'field_type' => false, 'object_type_id' => false, + 'hidden' => false, + 'default_value' => false, 'name' => false, - 'label' => false, 'description' => false, - 'required' => false, - 'hidden' => false, 'dependent_fields' => false, + 'label' => false, 'placeholder' => false, - 'default_value' => false, + 'field_type' => false, + 'required' => false, 'validation' => false ]; @@ -197,16 +197,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'field_type' => 'fieldType', 'object_type_id' => 'objectTypeId', + 'hidden' => 'hidden', + 'default_value' => 'defaultValue', 'name' => 'name', - 'label' => 'label', 'description' => 'description', - 'required' => 'required', - 'hidden' => 'hidden', 'dependent_fields' => 'dependentFields', + 'label' => 'label', 'placeholder' => 'placeholder', - 'default_value' => 'defaultValue', + 'field_type' => 'fieldType', + 'required' => 'required', 'validation' => 'validation' ]; @@ -216,16 +216,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'field_type' => 'setFieldType', 'object_type_id' => 'setObjectTypeId', + 'hidden' => 'setHidden', + 'default_value' => 'setDefaultValue', 'name' => 'setName', - 'label' => 'setLabel', 'description' => 'setDescription', - 'required' => 'setRequired', - 'hidden' => 'setHidden', 'dependent_fields' => 'setDependentFields', + 'label' => 'setLabel', 'placeholder' => 'setPlaceholder', - 'default_value' => 'setDefaultValue', + 'field_type' => 'setFieldType', + 'required' => 'setRequired', 'validation' => 'setValidation' ]; @@ -235,16 +235,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'field_type' => 'getFieldType', 'object_type_id' => 'getObjectTypeId', + 'hidden' => 'getHidden', + 'default_value' => 'getDefaultValue', 'name' => 'getName', - 'label' => 'getLabel', 'description' => 'getDescription', - 'required' => 'getRequired', - 'hidden' => 'getHidden', 'dependent_fields' => 'getDependentFields', + 'label' => 'getLabel', 'placeholder' => 'getPlaceholder', - 'default_value' => 'getDefaultValue', + 'field_type' => 'getFieldType', + 'required' => 'getRequired', 'validation' => 'getValidation' ]; @@ -313,21 +313,21 @@ public function getFieldTypeAllowableValues() /** * 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('field_type', $data ?? [], 'email'); $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('hidden', $data ?? [], null); + $this->setIfExists('default_value', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('required', $data ?? [], null); - $this->setIfExists('hidden', $data ?? [], null); $this->setIfExists('dependent_fields', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); $this->setIfExists('placeholder', $data ?? [], null); - $this->setIfExists('default_value', $data ?? [], null); + $this->setIfExists('field_type', $data ?? [], 'email'); + $this->setIfExists('required', $data ?? [], null); $this->setIfExists('validation', $data ?? [], null); } @@ -358,6 +358,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['hidden'] === null) { + $invalidProperties[] = "'hidden' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['dependent_fields'] === null) { + $invalidProperties[] = "'dependent_fields' can't be null"; + } + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } if ($this->container['field_type'] === null) { $invalidProperties[] = "'field_type' can't be null"; } @@ -370,24 +385,9 @@ public function listInvalidProperties() ); } - if ($this->container['object_type_id'] === null) { - $invalidProperties[] = "'object_type_id' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['label'] === null) { - $invalidProperties[] = "'label' can't be null"; - } if ($this->container['required'] === null) { $invalidProperties[] = "'required' can't be null"; } - if ($this->container['hidden'] === null) { - $invalidProperties[] = "'hidden' can't be null"; - } - if ($this->container['dependent_fields'] === null) { - $invalidProperties[] = "'dependent_fields' can't be null"; - } if ($this->container['validation'] === null) { $invalidProperties[] = "'validation' can't be null"; } @@ -407,119 +407,109 @@ public function valid() /** - * Gets field_type + * Gets object_type_id * * @return string */ - public function getFieldType() + public function getObjectTypeId() { - return $this->container['field_type']; + return $this->container['object_type_id']; } /** - * Sets field_type + * Sets object_type_id * - * @param string $field_type Determines how the field will be displayed and validated. + * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. * * @return self */ - public function setFieldType($field_type) + public function setObjectTypeId($object_type_id) { - if (is_null($field_type)) { - throw new \InvalidArgumentException('non-nullable field_type cannot be null'); - } - $allowedValues = $this->getFieldTypeAllowableValues(); - if (!in_array($field_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'field_type', must be one of '%s'", - $field_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); } - $this->container['field_type'] = $field_type; + $this->container['object_type_id'] = $object_type_id; return $this; } /** - * Gets object_type_id + * Gets hidden * - * @return string + * @return bool */ - public function getObjectTypeId() + public function getHidden() { - return $this->container['object_type_id']; + return $this->container['hidden']; } /** - * Sets object_type_id + * Sets hidden * - * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. + * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. * * @return self */ - public function setObjectTypeId($object_type_id) + public function setHidden($hidden) { - if (is_null($object_type_id)) { - throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + if (is_null($hidden)) { + throw new \InvalidArgumentException('non-nullable hidden cannot be null'); } - $this->container['object_type_id'] = $object_type_id; + $this->container['hidden'] = $hidden; return $this; } /** - * Gets name + * Gets default_value * - * @return string + * @return string|null */ - public function getName() + public function getDefaultValue() { - return $this->container['name']; + return $this->container['default_value']; } /** - * Sets name + * Sets default_value * - * @param string $name The identifier of the field. In combination with the object type ID, it must be unique. + * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. * * @return self */ - public function setName($name) + public function setDefaultValue($default_value) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($default_value)) { + throw new \InvalidArgumentException('non-nullable default_value cannot be null'); } - $this->container['name'] = $name; + $this->container['default_value'] = $default_value; return $this; } /** - * Gets label + * Gets name * * @return string */ - public function getLabel() + public function getName() { - return $this->container['label']; + return $this->container['name']; } /** - * Sets label + * Sets name * - * @param string $label The main label for the form field. + * @param string $name The identifier of the field. In combination with the object type ID, it must be unique. * * @return self */ - public function setLabel($label) + public function setName($name) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['label'] = $label; + $this->container['name'] = $name; return $this; } @@ -552,136 +542,146 @@ public function setDescription($description) } /** - * Gets required + * Gets dependent_fields * - * @return bool + * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] */ - public function getRequired() + public function getDependentFields() { - return $this->container['required']; + return $this->container['dependent_fields']; } /** - * Sets required + * Sets dependent_fields * - * @param bool $required Whether a value for this field is required when submitting the form. + * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. * * @return self */ - public function setRequired($required) + public function setDependentFields($dependent_fields) { - if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + if (is_null($dependent_fields)) { + throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); } - $this->container['required'] = $required; + $this->container['dependent_fields'] = $dependent_fields; return $this; } /** - * Gets hidden + * Gets label * - * @return bool + * @return string */ - public function getHidden() + public function getLabel() { - return $this->container['hidden']; + return $this->container['label']; } /** - * Sets hidden + * Sets label * - * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. + * @param string $label The main label for the form field. * * @return self */ - public function setHidden($hidden) + public function setLabel($label) { - if (is_null($hidden)) { - throw new \InvalidArgumentException('non-nullable hidden cannot be null'); + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); } - $this->container['hidden'] = $hidden; + $this->container['label'] = $label; return $this; } /** - * Gets dependent_fields + * Gets placeholder * - * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] + * @return string|null */ - public function getDependentFields() + public function getPlaceholder() { - return $this->container['dependent_fields']; + return $this->container['placeholder']; } /** - * Sets dependent_fields + * Sets placeholder * - * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. + * @param string|null $placeholder The prompt text showing when the field isn't filled in. * * @return self */ - public function setDependentFields($dependent_fields) + public function setPlaceholder($placeholder) { - if (is_null($dependent_fields)) { - throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); + if (is_null($placeholder)) { + throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); } - $this->container['dependent_fields'] = $dependent_fields; + $this->container['placeholder'] = $placeholder; return $this; } /** - * Gets placeholder + * Gets field_type * - * @return string|null + * @return string */ - public function getPlaceholder() + public function getFieldType() { - return $this->container['placeholder']; + return $this->container['field_type']; } /** - * Sets placeholder + * Sets field_type * - * @param string|null $placeholder The prompt text showing when the field isn't filled in. + * @param string $field_type Determines how the field will be displayed and validated. * * @return self */ - public function setPlaceholder($placeholder) + public function setFieldType($field_type) { - if (is_null($placeholder)) { - throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); + if (is_null($field_type)) { + throw new \InvalidArgumentException('non-nullable field_type cannot be null'); } - $this->container['placeholder'] = $placeholder; + $allowedValues = $this->getFieldTypeAllowableValues(); + if (!in_array($field_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'field_type', must be one of '%s'", + $field_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['field_type'] = $field_type; return $this; } /** - * Gets default_value + * Gets required * - * @return string|null + * @return bool */ - public function getDefaultValue() + public function getRequired() { - return $this->container['default_value']; + return $this->container['required']; } /** - * Sets default_value + * Sets required * - * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. + * @param bool $required Whether a value for this field is required when submitting the form. * * @return self */ - public function setDefaultValue($default_value) + public function setRequired($required) { - if (is_null($default_value)) { - throw new \InvalidArgumentException('non-nullable default_value cannot be null'); + if (is_null($required)) { + throw new \InvalidArgumentException('non-nullable required cannot be null'); } - $this->container['default_value'] = $default_value; + $this->container['required'] = $required; return $this; } diff --git a/codegen/Marketing/Forms/Model/EmailFieldValidation.php b/codegen/Marketing/Forms/Model/EmailFieldValidation.php index c904f2eca..17382776b 100644 --- a/codegen/Marketing/Forms/Model/EmailFieldValidation.php +++ b/codegen/Marketing/Forms/Model/EmailFieldValidation.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -58,8 +58,8 @@ class EmailFieldValidation implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'blocked_email_domains' => 'string[]', - 'use_default_block_list' => 'bool' + 'use_default_block_list' => 'bool', + 'blocked_email_domains' => 'string[]' ]; /** @@ -70,8 +70,8 @@ class EmailFieldValidation implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ - 'blocked_email_domains' => null, - 'use_default_block_list' => null + 'use_default_block_list' => null, + 'blocked_email_domains' => null ]; /** @@ -80,8 +80,8 @@ class EmailFieldValidation implements ModelInterface, ArrayAccess, \JsonSerializ * @var boolean[] */ protected static array $openAPINullables = [ - 'blocked_email_domains' => false, - 'use_default_block_list' => false + 'use_default_block_list' => false, + 'blocked_email_domains' => false ]; /** @@ -170,8 +170,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'blocked_email_domains' => 'blockedEmailDomains', - 'use_default_block_list' => 'useDefaultBlockList' + 'use_default_block_list' => 'useDefaultBlockList', + 'blocked_email_domains' => 'blockedEmailDomains' ]; /** @@ -180,8 +180,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'blocked_email_domains' => 'setBlockedEmailDomains', - 'use_default_block_list' => 'setUseDefaultBlockList' + 'use_default_block_list' => 'setUseDefaultBlockList', + 'blocked_email_domains' => 'setBlockedEmailDomains' ]; /** @@ -190,8 +190,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'blocked_email_domains' => 'getBlockedEmailDomains', - 'use_default_block_list' => 'getUseDefaultBlockList' + 'use_default_block_list' => 'getUseDefaultBlockList', + 'blocked_email_domains' => 'getBlockedEmailDomains' ]; /** @@ -246,13 +246,13 @@ 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('blocked_email_domains', $data ?? [], null); $this->setIfExists('use_default_block_list', $data ?? [], null); + $this->setIfExists('blocked_email_domains', $data ?? [], null); } /** @@ -282,12 +282,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['blocked_email_domains'] === null) { - $invalidProperties[] = "'blocked_email_domains' can't be null"; - } if ($this->container['use_default_block_list'] === null) { $invalidProperties[] = "'use_default_block_list' can't be null"; } + if ($this->container['blocked_email_domains'] === null) { + $invalidProperties[] = "'blocked_email_domains' can't be null"; + } return $invalidProperties; } @@ -304,55 +304,55 @@ public function valid() /** - * Gets blocked_email_domains + * Gets use_default_block_list * - * @return string[] + * @return bool */ - public function getBlockedEmailDomains() + public function getUseDefaultBlockList() { - return $this->container['blocked_email_domains']; + return $this->container['use_default_block_list']; } /** - * Sets blocked_email_domains + * Sets use_default_block_list * - * @param string[] $blocked_email_domains A list of email domains to block. + * @param bool $use_default_block_list Whether to block the free email providers. * * @return self */ - public function setBlockedEmailDomains($blocked_email_domains) + public function setUseDefaultBlockList($use_default_block_list) { - if (is_null($blocked_email_domains)) { - throw new \InvalidArgumentException('non-nullable blocked_email_domains cannot be null'); + if (is_null($use_default_block_list)) { + throw new \InvalidArgumentException('non-nullable use_default_block_list cannot be null'); } - $this->container['blocked_email_domains'] = $blocked_email_domains; + $this->container['use_default_block_list'] = $use_default_block_list; return $this; } /** - * Gets use_default_block_list + * Gets blocked_email_domains * - * @return bool + * @return string[] */ - public function getUseDefaultBlockList() + public function getBlockedEmailDomains() { - return $this->container['use_default_block_list']; + return $this->container['blocked_email_domains']; } /** - * Sets use_default_block_list + * Sets blocked_email_domains * - * @param bool $use_default_block_list Whether to block the free email providers. + * @param string[] $blocked_email_domains A list of email domains to block. * * @return self */ - public function setUseDefaultBlockList($use_default_block_list) + public function setBlockedEmailDomains($blocked_email_domains) { - if (is_null($use_default_block_list)) { - throw new \InvalidArgumentException('non-nullable use_default_block_list cannot be null'); + if (is_null($blocked_email_domains)) { + throw new \InvalidArgumentException('non-nullable blocked_email_domains cannot be null'); } - $this->container['use_default_block_list'] = $use_default_block_list; + $this->container['blocked_email_domains'] = $blocked_email_domains; return $this; } diff --git a/codegen/Marketing/Forms/Model/EnumeratedFieldOption.php b/codegen/Marketing/Forms/Model/EnumeratedFieldOption.php index 24919962f..50767c938 100644 --- a/codegen/Marketing/Forms/Model/EnumeratedFieldOption.php +++ b/codegen/Marketing/Forms/Model/EnumeratedFieldOption.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -57,10 +57,10 @@ class EnumeratedFieldOption implements ModelInterface, ArrayAccess, \JsonSeriali * @var string[] */ protected static $openAPITypes = [ - 'label' => 'string', - 'value' => 'string', + 'display_order' => 'int', 'description' => 'string', - 'display_order' => 'int' + 'label' => 'string', + 'value' => 'string' ]; /** @@ -71,10 +71,10 @@ class EnumeratedFieldOption implements ModelInterface, ArrayAccess, \JsonSeriali * @psalm-var array */ protected static $openAPIFormats = [ - 'label' => null, - 'value' => null, + 'display_order' => 'int32', 'description' => null, - 'display_order' => 'int32' + 'label' => null, + 'value' => null ]; /** @@ -83,10 +83,10 @@ class EnumeratedFieldOption implements ModelInterface, ArrayAccess, \JsonSeriali * @var boolean[] */ protected static array $openAPINullables = [ - 'label' => false, - 'value' => false, + 'display_order' => false, 'description' => false, - 'display_order' => false + 'label' => false, + 'value' => false ]; /** @@ -175,10 +175,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'label' => 'label', - 'value' => 'value', + 'display_order' => 'displayOrder', 'description' => 'description', - 'display_order' => 'displayOrder' + 'label' => 'label', + 'value' => 'value' ]; /** @@ -187,10 +187,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'label' => 'setLabel', - 'value' => 'setValue', + 'display_order' => 'setDisplayOrder', 'description' => 'setDescription', - 'display_order' => 'setDisplayOrder' + 'label' => 'setLabel', + 'value' => 'setValue' ]; /** @@ -199,10 +199,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'label' => 'getLabel', - 'value' => 'getValue', + 'display_order' => 'getDisplayOrder', 'description' => 'getDescription', - 'display_order' => 'getDisplayOrder' + 'label' => 'getLabel', + 'value' => 'getValue' ]; /** @@ -257,15 +257,15 @@ 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('display_order', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); $this->setIfExists('label', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); - $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('display_order', $data ?? [], null); } /** @@ -295,15 +295,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['display_order'] === null) { + $invalidProperties[] = "'display_order' can't be null"; + } if ($this->container['label'] === null) { $invalidProperties[] = "'label' can't be null"; } if ($this->container['value'] === null) { $invalidProperties[] = "'value' can't be null"; } - if ($this->container['display_order'] === null) { - $invalidProperties[] = "'display_order' can't be null"; - } return $invalidProperties; } @@ -320,109 +320,109 @@ public function valid() /** - * Gets label + * Gets display_order * - * @return string + * @return int */ - public function getLabel() + public function getDisplayOrder() { - return $this->container['label']; + return $this->container['display_order']; } /** - * Sets label + * Sets display_order * - * @param string $label The visible label for this choice. + * @param int $display_order The order the choices will be displayed in. * * @return self */ - public function setLabel($label) + public function setDisplayOrder($display_order) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($display_order)) { + throw new \InvalidArgumentException('non-nullable display_order cannot be null'); } - $this->container['label'] = $label; + $this->container['display_order'] = $display_order; return $this; } /** - * Gets value + * Gets description * - * @return string + * @return string|null */ - public function getValue() + public function getDescription() { - return $this->container['value']; + return $this->container['description']; } /** - * Sets value + * Sets description * - * @param string $value The value which will be submitted if this choice is selected. + * @param string|null $description * * @return self */ - public function setValue($value) + public function setDescription($description) { - if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); } - $this->container['value'] = $value; + $this->container['description'] = $description; return $this; } /** - * Gets description + * Gets label * - * @return string|null + * @return string */ - public function getDescription() + public function getLabel() { - return $this->container['description']; + return $this->container['label']; } /** - * Sets description + * Sets label * - * @param string|null $description description + * @param string $label The visible label for this choice. * * @return self */ - public function setDescription($description) + public function setLabel($label) { - if (is_null($description)) { - throw new \InvalidArgumentException('non-nullable description cannot be null'); + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); } - $this->container['description'] = $description; + $this->container['label'] = $label; return $this; } /** - * Gets display_order + * Gets value * - * @return int + * @return string */ - public function getDisplayOrder() + public function getValue() { - return $this->container['display_order']; + return $this->container['value']; } /** - * Sets display_order + * Sets value * - * @param int $display_order The order the choices will be displayed in. + * @param string $value The value which will be submitted if this choice is selected. * * @return self */ - public function setDisplayOrder($display_order) + public function setValue($value) { - if (is_null($display_order)) { - throw new \InvalidArgumentException('non-nullable display_order cannot be null'); + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); } - $this->container['display_order'] = $display_order; + $this->container['value'] = $value; return $this; } diff --git a/codegen/Marketing/Forms/Model/Error.php b/codegen/Marketing/Forms/Model/Error.php index 8706ba018..95c8e7657 100644 --- a/codegen/Marketing/Forms/Model/Error.php +++ b/codegen/Marketing/Forms/Model/Error.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -275,10 +275,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('sub_category', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); diff --git a/codegen/Marketing/Forms/Model/ErrorDetail.php b/codegen/Marketing/Forms/Model/ErrorDetail.php index 71c238df8..597df8e65 100644 --- a/codegen/Marketing/Forms/Model/ErrorDetail.php +++ b/codegen/Marketing/Forms/Model/ErrorDetail.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -263,10 +263,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('sub_category', $data ?? [], null); $this->setIfExists('code', $data ?? [], null); diff --git a/codegen/Marketing/Forms/Model/FieldGroup.php b/codegen/Marketing/Forms/Model/FieldGroup.php index 0f58c573a..6345429ab 100644 --- a/codegen/Marketing/Forms/Model/FieldGroup.php +++ b/codegen/Marketing/Forms/Model/FieldGroup.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -290,10 +290,10 @@ public function getRichTextTypeAllowableValues() /** * 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_type', $data ?? [], null); $this->setIfExists('rich_text_type', $data ?? [], null); diff --git a/codegen/Marketing/Forms/Model/FileField.php b/codegen/Marketing/Forms/Model/FileField.php index ad30f17c0..2dd55b42a 100644 --- a/codegen/Marketing/Forms/Model/FileField.php +++ b/codegen/Marketing/Forms/Model/FileField.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -58,17 +58,17 @@ class FileField implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'field_type' => 'string', 'object_type_id' => 'string', + 'allow_multiple_files' => 'bool', + 'hidden' => 'bool', + 'default_value' => 'string', 'name' => 'string', - 'label' => 'string', 'description' => 'string', - 'required' => 'bool', - 'hidden' => 'bool', 'dependent_fields' => '\HubSpot\Client\Marketing\Forms\Model\DependentField[]', + 'label' => 'string', 'placeholder' => 'string', - 'default_value' => 'string', - 'allow_multiple_files' => 'bool' + 'field_type' => 'string', + 'required' => 'bool' ]; /** @@ -79,17 +79,17 @@ class FileField implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'field_type' => null, 'object_type_id' => null, + 'allow_multiple_files' => null, + 'hidden' => null, + 'default_value' => null, 'name' => null, - 'label' => null, 'description' => null, - 'required' => null, - 'hidden' => null, 'dependent_fields' => null, + 'label' => null, 'placeholder' => null, - 'default_value' => null, - 'allow_multiple_files' => null + 'field_type' => null, + 'required' => null ]; /** @@ -98,17 +98,17 @@ class FileField implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'field_type' => false, 'object_type_id' => false, + 'allow_multiple_files' => false, + 'hidden' => false, + 'default_value' => false, 'name' => false, - 'label' => false, 'description' => false, - 'required' => false, - 'hidden' => false, 'dependent_fields' => false, + 'label' => false, 'placeholder' => false, - 'default_value' => false, - 'allow_multiple_files' => false + 'field_type' => false, + 'required' => false ]; /** @@ -197,17 +197,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'field_type' => 'fieldType', 'object_type_id' => 'objectTypeId', + 'allow_multiple_files' => 'allowMultipleFiles', + 'hidden' => 'hidden', + 'default_value' => 'defaultValue', 'name' => 'name', - 'label' => 'label', 'description' => 'description', - 'required' => 'required', - 'hidden' => 'hidden', 'dependent_fields' => 'dependentFields', + 'label' => 'label', 'placeholder' => 'placeholder', - 'default_value' => 'defaultValue', - 'allow_multiple_files' => 'allowMultipleFiles' + 'field_type' => 'fieldType', + 'required' => 'required' ]; /** @@ -216,17 +216,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'field_type' => 'setFieldType', 'object_type_id' => 'setObjectTypeId', + 'allow_multiple_files' => 'setAllowMultipleFiles', + 'hidden' => 'setHidden', + 'default_value' => 'setDefaultValue', 'name' => 'setName', - 'label' => 'setLabel', 'description' => 'setDescription', - 'required' => 'setRequired', - 'hidden' => 'setHidden', 'dependent_fields' => 'setDependentFields', + 'label' => 'setLabel', 'placeholder' => 'setPlaceholder', - 'default_value' => 'setDefaultValue', - 'allow_multiple_files' => 'setAllowMultipleFiles' + 'field_type' => 'setFieldType', + 'required' => 'setRequired' ]; /** @@ -235,17 +235,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'field_type' => 'getFieldType', 'object_type_id' => 'getObjectTypeId', + 'allow_multiple_files' => 'getAllowMultipleFiles', + 'hidden' => 'getHidden', + 'default_value' => 'getDefaultValue', 'name' => 'getName', - 'label' => 'getLabel', 'description' => 'getDescription', - 'required' => 'getRequired', - 'hidden' => 'getHidden', 'dependent_fields' => 'getDependentFields', + 'label' => 'getLabel', 'placeholder' => 'getPlaceholder', - 'default_value' => 'getDefaultValue', - 'allow_multiple_files' => 'getAllowMultipleFiles' + 'field_type' => 'getFieldType', + 'required' => 'getRequired' ]; /** @@ -313,22 +313,22 @@ public function getFieldTypeAllowableValues() /** * 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('field_type', $data ?? [], 'file'); $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('allow_multiple_files', $data ?? [], null); + $this->setIfExists('hidden', $data ?? [], null); + $this->setIfExists('default_value', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('required', $data ?? [], null); - $this->setIfExists('hidden', $data ?? [], null); $this->setIfExists('dependent_fields', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); $this->setIfExists('placeholder', $data ?? [], null); - $this->setIfExists('default_value', $data ?? [], null); - $this->setIfExists('allow_multiple_files', $data ?? [], null); + $this->setIfExists('field_type', $data ?? [], 'file'); + $this->setIfExists('required', $data ?? [], null); } /** @@ -358,6 +358,24 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['allow_multiple_files'] === null) { + $invalidProperties[] = "'allow_multiple_files' can't be null"; + } + if ($this->container['hidden'] === null) { + $invalidProperties[] = "'hidden' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['dependent_fields'] === null) { + $invalidProperties[] = "'dependent_fields' can't be null"; + } + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } if ($this->container['field_type'] === null) { $invalidProperties[] = "'field_type' can't be null"; } @@ -370,27 +388,9 @@ public function listInvalidProperties() ); } - if ($this->container['object_type_id'] === null) { - $invalidProperties[] = "'object_type_id' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['label'] === null) { - $invalidProperties[] = "'label' can't be null"; - } if ($this->container['required'] === null) { $invalidProperties[] = "'required' can't be null"; } - if ($this->container['hidden'] === null) { - $invalidProperties[] = "'hidden' can't be null"; - } - if ($this->container['dependent_fields'] === null) { - $invalidProperties[] = "'dependent_fields' can't be null"; - } - if ($this->container['allow_multiple_files'] === null) { - $invalidProperties[] = "'allow_multiple_files' can't be null"; - } return $invalidProperties; } @@ -406,43 +406,6 @@ public function valid() } - /** - * Gets field_type - * - * @return string - */ - public function getFieldType() - { - return $this->container['field_type']; - } - - /** - * Sets field_type - * - * @param string $field_type Determines how the field will be displayed and validated. - * - * @return self - */ - public function setFieldType($field_type) - { - if (is_null($field_type)) { - throw new \InvalidArgumentException('non-nullable field_type cannot be null'); - } - $allowedValues = $this->getFieldTypeAllowableValues(); - if (!in_array($field_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'field_type', must be one of '%s'", - $field_type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['field_type'] = $field_type; - - return $this; - } - /** * Gets object_type_id * @@ -471,136 +434,136 @@ public function setObjectTypeId($object_type_id) } /** - * Gets name + * Gets allow_multiple_files * - * @return string + * @return bool */ - public function getName() + public function getAllowMultipleFiles() { - return $this->container['name']; + return $this->container['allow_multiple_files']; } /** - * Sets name + * Sets allow_multiple_files * - * @param string $name The identifier of the field. In combination with the object type ID, it must be unique. + * @param bool $allow_multiple_files Whether to allow the upload of multiple files. * * @return self */ - public function setName($name) + public function setAllowMultipleFiles($allow_multiple_files) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($allow_multiple_files)) { + throw new \InvalidArgumentException('non-nullable allow_multiple_files cannot be null'); } - $this->container['name'] = $name; + $this->container['allow_multiple_files'] = $allow_multiple_files; return $this; } /** - * Gets label + * Gets hidden * - * @return string + * @return bool */ - public function getLabel() + public function getHidden() { - return $this->container['label']; + return $this->container['hidden']; } /** - * Sets label + * Sets hidden * - * @param string $label The main label for the form field. + * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. * * @return self */ - public function setLabel($label) + public function setHidden($hidden) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($hidden)) { + throw new \InvalidArgumentException('non-nullable hidden cannot be null'); } - $this->container['label'] = $label; + $this->container['hidden'] = $hidden; return $this; } /** - * Gets description + * Gets default_value * * @return string|null */ - public function getDescription() + public function getDefaultValue() { - return $this->container['description']; + return $this->container['default_value']; } /** - * Sets description + * Sets default_value * - * @param string|null $description Additional text helping the customer to complete the field. + * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. * * @return self */ - public function setDescription($description) + public function setDefaultValue($default_value) { - if (is_null($description)) { - throw new \InvalidArgumentException('non-nullable description cannot be null'); + if (is_null($default_value)) { + throw new \InvalidArgumentException('non-nullable default_value cannot be null'); } - $this->container['description'] = $description; + $this->container['default_value'] = $default_value; return $this; } /** - * Gets required + * Gets name * - * @return bool + * @return string */ - public function getRequired() + public function getName() { - return $this->container['required']; + return $this->container['name']; } /** - * Sets required + * Sets name * - * @param bool $required Whether a value for this field is required when submitting the form. + * @param string $name The identifier of the field. In combination with the object type ID, it must be unique. * * @return self */ - public function setRequired($required) + public function setName($name) { - if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['required'] = $required; + $this->container['name'] = $name; return $this; } /** - * Gets hidden + * Gets description * - * @return bool + * @return string|null */ - public function getHidden() + public function getDescription() { - return $this->container['hidden']; + return $this->container['description']; } /** - * Sets hidden + * Sets description * - * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. + * @param string|null $description Additional text helping the customer to complete the field. * * @return self */ - public function setHidden($hidden) + public function setDescription($description) { - if (is_null($hidden)) { - throw new \InvalidArgumentException('non-nullable hidden cannot be null'); + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); } - $this->container['hidden'] = $hidden; + $this->container['description'] = $description; return $this; } @@ -632,6 +595,33 @@ public function setDependentFields($dependent_fields) return $this; } + /** + * Gets label + * + * @return string + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string $label The main label for the form field. + * + * @return self + */ + public function setLabel($label) + { + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); + } + $this->container['label'] = $label; + + return $this; + } + /** * Gets placeholder * @@ -660,55 +650,65 @@ public function setPlaceholder($placeholder) } /** - * Gets default_value + * Gets field_type * - * @return string|null + * @return string */ - public function getDefaultValue() + public function getFieldType() { - return $this->container['default_value']; + return $this->container['field_type']; } /** - * Sets default_value + * Sets field_type * - * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. + * @param string $field_type Determines how the field will be displayed and validated. * * @return self */ - public function setDefaultValue($default_value) + public function setFieldType($field_type) { - if (is_null($default_value)) { - throw new \InvalidArgumentException('non-nullable default_value cannot be null'); + if (is_null($field_type)) { + throw new \InvalidArgumentException('non-nullable field_type cannot be null'); } - $this->container['default_value'] = $default_value; + $allowedValues = $this->getFieldTypeAllowableValues(); + if (!in_array($field_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'field_type', must be one of '%s'", + $field_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['field_type'] = $field_type; return $this; } /** - * Gets allow_multiple_files + * Gets required * * @return bool */ - public function getAllowMultipleFiles() + public function getRequired() { - return $this->container['allow_multiple_files']; + return $this->container['required']; } /** - * Sets allow_multiple_files + * Sets required * - * @param bool $allow_multiple_files Whether to allow the upload of multiple files. + * @param bool $required Whether a value for this field is required when submitting the form. * * @return self */ - public function setAllowMultipleFiles($allow_multiple_files) + public function setRequired($required) { - if (is_null($allow_multiple_files)) { - throw new \InvalidArgumentException('non-nullable allow_multiple_files cannot be null'); + if (is_null($required)) { + throw new \InvalidArgumentException('non-nullable required cannot be null'); } - $this->container['allow_multiple_files'] = $allow_multiple_files; + $this->container['required'] = $required; return $this; } diff --git a/codegen/Marketing/Forms/Model/FormDefinitionBase.php b/codegen/Marketing/Forms/Model/FormDefinitionBase.php index 3082b7cfc..d2dc9c255 100644 --- a/codegen/Marketing/Forms/Model/FormDefinitionBase.php +++ b/codegen/Marketing/Forms/Model/FormDefinitionBase.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -312,10 +312,10 @@ public function getFormTypeAllowableValues() /** * 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_type', $data ?? [], 'hubspot'); $this->setIfExists('id', $data ?? [], null); diff --git a/codegen/Marketing/Forms/Model/FormDefinitionCreateRequestBase.php b/codegen/Marketing/Forms/Model/FormDefinitionCreateRequestBase.php index c24ea96bf..8f2da0ebc 100644 --- a/codegen/Marketing/Forms/Model/FormDefinitionCreateRequestBase.php +++ b/codegen/Marketing/Forms/Model/FormDefinitionCreateRequestBase.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -306,10 +306,10 @@ public function getFormTypeAllowableValues() /** * 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_type', $data ?? [], 'hubspot'); $this->setIfExists('name', $data ?? [], null); diff --git a/codegen/Marketing/Forms/Model/FormDisplayOptions.php b/codegen/Marketing/Forms/Model/FormDisplayOptions.php index eaf6603f0..ae7620d76 100644 --- a/codegen/Marketing/Forms/Model/FormDisplayOptions.php +++ b/codegen/Marketing/Forms/Model/FormDisplayOptions.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -287,10 +287,10 @@ public function getThemeAllowableValues() /** * 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('render_raw_html', $data ?? [], null); $this->setIfExists('css_class', $data ?? [], null); diff --git a/codegen/Marketing/Forms/Model/FormPostSubmitAction.php b/codegen/Marketing/Forms/Model/FormPostSubmitAction.php index 4e74f4760..947ca06eb 100644 --- a/codegen/Marketing/Forms/Model/FormPostSubmitAction.php +++ b/codegen/Marketing/Forms/Model/FormPostSubmitAction.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -261,10 +261,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('value', $data ?? [], null); diff --git a/codegen/Marketing/Forms/Model/FormStyle.php b/codegen/Marketing/Forms/Model/FormStyle.php index bc2c6c510..2541f268a 100644 --- a/codegen/Marketing/Forms/Model/FormStyle.php +++ b/codegen/Marketing/Forms/Model/FormStyle.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -323,10 +323,10 @@ public function getSubmitAlignmentAllowableValues() /** * 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('label_text_size', $data ?? [], null); $this->setIfExists('legal_consent_text_color', $data ?? [], null); diff --git a/codegen/Marketing/Forms/Model/ForwardPaging.php b/codegen/Marketing/Forms/Model/ForwardPaging.php index 5e2f8dde2..925f3d790 100644 --- a/codegen/Marketing/Forms/Model/ForwardPaging.php +++ b/codegen/Marketing/Forms/Model/ForwardPaging.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -239,10 +239,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('next', $data ?? [], null); } diff --git a/codegen/Marketing/Forms/Model/HubSpotFormConfiguration.php b/codegen/Marketing/Forms/Model/HubSpotFormConfiguration.php index 05bc8de55..d84b66196 100644 --- a/codegen/Marketing/Forms/Model/HubSpotFormConfiguration.php +++ b/codegen/Marketing/Forms/Model/HubSpotFormConfiguration.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -400,10 +400,10 @@ public function getLanguageAllowableValues() /** * 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('create_new_contact_for_new_email', $data ?? [], null); $this->setIfExists('editable', $data ?? [], null); diff --git a/codegen/Marketing/Forms/Model/HubSpotFormDefinition.php b/codegen/Marketing/Forms/Model/HubSpotFormDefinition.php index 6f5f92d41..5eed34954 100644 --- a/codegen/Marketing/Forms/Model/HubSpotFormDefinition.php +++ b/codegen/Marketing/Forms/Model/HubSpotFormDefinition.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -312,10 +312,10 @@ public function getFormTypeAllowableValues() /** * 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_type', $data ?? [], 'hubspot'); $this->setIfExists('id', $data ?? [], null); diff --git a/codegen/Marketing/Forms/Model/HubSpotFormDefinitionAllOfLegalConsentOptions.php b/codegen/Marketing/Forms/Model/HubSpotFormDefinitionAllOfLegalConsentOptions.php index 2b12296c4..d1f930b9f 100644 --- a/codegen/Marketing/Forms/Model/HubSpotFormDefinitionAllOfLegalConsentOptions.php +++ b/codegen/Marketing/Forms/Model/HubSpotFormDefinitionAllOfLegalConsentOptions.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -61,11 +61,11 @@ class HubSpotFormDefinitionAllOfLegalConsentOptions implements ModelInterface, A 'subscription_type_ids' => 'int[]', 'lawful_basis' => 'string', 'privacy_text' => 'string', - 'communication_consent_text' => 'string', 'communications_checkboxes' => '\HubSpot\Client\Marketing\Forms\Model\LegalConsentCheckbox[]', - 'consent_to_process_text' => 'string', + 'communication_consent_text' => 'string', 'consent_to_process_checkbox_label' => 'string', - 'consent_to_process_footer_text' => 'string' + 'consent_to_process_footer_text' => 'string', + 'consent_to_process_text' => 'string' ]; /** @@ -80,11 +80,11 @@ class HubSpotFormDefinitionAllOfLegalConsentOptions implements ModelInterface, A 'subscription_type_ids' => 'int64', 'lawful_basis' => null, 'privacy_text' => null, - 'communication_consent_text' => null, 'communications_checkboxes' => null, - 'consent_to_process_text' => null, + 'communication_consent_text' => null, 'consent_to_process_checkbox_label' => null, - 'consent_to_process_footer_text' => null + 'consent_to_process_footer_text' => null, + 'consent_to_process_text' => null ]; /** @@ -97,11 +97,11 @@ class HubSpotFormDefinitionAllOfLegalConsentOptions implements ModelInterface, A 'subscription_type_ids' => false, 'lawful_basis' => false, 'privacy_text' => false, - 'communication_consent_text' => false, 'communications_checkboxes' => false, - 'consent_to_process_text' => false, + 'communication_consent_text' => false, 'consent_to_process_checkbox_label' => false, - 'consent_to_process_footer_text' => false + 'consent_to_process_footer_text' => false, + 'consent_to_process_text' => false ]; /** @@ -194,11 +194,11 @@ public function isNullableSetToNull(string $property): bool 'subscription_type_ids' => 'subscriptionTypeIds', 'lawful_basis' => 'lawfulBasis', 'privacy_text' => 'privacyText', - 'communication_consent_text' => 'communicationConsentText', 'communications_checkboxes' => 'communicationsCheckboxes', - 'consent_to_process_text' => 'consentToProcessText', + 'communication_consent_text' => 'communicationConsentText', 'consent_to_process_checkbox_label' => 'consentToProcessCheckboxLabel', - 'consent_to_process_footer_text' => 'consentToProcessFooterText' + 'consent_to_process_footer_text' => 'consentToProcessFooterText', + 'consent_to_process_text' => 'consentToProcessText' ]; /** @@ -211,11 +211,11 @@ public function isNullableSetToNull(string $property): bool 'subscription_type_ids' => 'setSubscriptionTypeIds', 'lawful_basis' => 'setLawfulBasis', 'privacy_text' => 'setPrivacyText', - 'communication_consent_text' => 'setCommunicationConsentText', 'communications_checkboxes' => 'setCommunicationsCheckboxes', - 'consent_to_process_text' => 'setConsentToProcessText', + 'communication_consent_text' => 'setCommunicationConsentText', 'consent_to_process_checkbox_label' => 'setConsentToProcessCheckboxLabel', - 'consent_to_process_footer_text' => 'setConsentToProcessFooterText' + 'consent_to_process_footer_text' => 'setConsentToProcessFooterText', + 'consent_to_process_text' => 'setConsentToProcessText' ]; /** @@ -228,11 +228,11 @@ public function isNullableSetToNull(string $property): bool 'subscription_type_ids' => 'getSubscriptionTypeIds', 'lawful_basis' => 'getLawfulBasis', 'privacy_text' => 'getPrivacyText', - 'communication_consent_text' => 'getCommunicationConsentText', 'communications_checkboxes' => 'getCommunicationsCheckboxes', - 'consent_to_process_text' => 'getConsentToProcessText', + 'communication_consent_text' => 'getCommunicationConsentText', 'consent_to_process_checkbox_label' => 'getConsentToProcessCheckboxLabel', - 'consent_to_process_footer_text' => 'getConsentToProcessFooterText' + 'consent_to_process_footer_text' => 'getConsentToProcessFooterText', + 'consent_to_process_text' => 'getConsentToProcessText' ]; /** @@ -323,20 +323,20 @@ public function getLawfulBasisAllowableValues() /** * 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 ?? [], 'none'); $this->setIfExists('subscription_type_ids', $data ?? [], null); $this->setIfExists('lawful_basis', $data ?? [], null); $this->setIfExists('privacy_text', $data ?? [], null); - $this->setIfExists('communication_consent_text', $data ?? [], null); $this->setIfExists('communications_checkboxes', $data ?? [], null); - $this->setIfExists('consent_to_process_text', $data ?? [], null); + $this->setIfExists('communication_consent_text', $data ?? [], null); $this->setIfExists('consent_to_process_checkbox_label', $data ?? [], null); $this->setIfExists('consent_to_process_footer_text', $data ?? [], null); + $this->setIfExists('consent_to_process_text', $data ?? [], null); } /** @@ -427,7 +427,7 @@ public function getType() /** * Sets type * - * @param string $type type + * @param string $type * * @return self */ @@ -464,7 +464,7 @@ public function getSubscriptionTypeIds() /** * Sets subscription_type_ids * - * @param int[] $subscription_type_ids subscription_type_ids + * @param int[] $subscription_type_ids * * @return self */ @@ -491,7 +491,7 @@ public function getLawfulBasis() /** * Sets lawful_basis * - * @param string $lawful_basis lawful_basis + * @param string $lawful_basis * * @return self */ @@ -528,7 +528,7 @@ public function getPrivacyText() /** * Sets privacy_text * - * @param string $privacy_text privacy_text + * @param string $privacy_text * * @return self */ @@ -542,33 +542,6 @@ public function setPrivacyText($privacy_text) return $this; } - /** - * Gets communication_consent_text - * - * @return string|null - */ - public function getCommunicationConsentText() - { - return $this->container['communication_consent_text']; - } - - /** - * Sets communication_consent_text - * - * @param string|null $communication_consent_text communication_consent_text - * - * @return self - */ - public function setCommunicationConsentText($communication_consent_text) - { - if (is_null($communication_consent_text)) { - throw new \InvalidArgumentException('non-nullable communication_consent_text cannot be null'); - } - $this->container['communication_consent_text'] = $communication_consent_text; - - return $this; - } - /** * Gets communications_checkboxes * @@ -582,7 +555,7 @@ public function getCommunicationsCheckboxes() /** * Sets communications_checkboxes * - * @param \HubSpot\Client\Marketing\Forms\Model\LegalConsentCheckbox[] $communications_checkboxes communications_checkboxes + * @param \HubSpot\Client\Marketing\Forms\Model\LegalConsentCheckbox[] $communications_checkboxes * * @return self */ @@ -597,28 +570,28 @@ public function setCommunicationsCheckboxes($communications_checkboxes) } /** - * Gets consent_to_process_text + * Gets communication_consent_text * * @return string|null */ - public function getConsentToProcessText() + public function getCommunicationConsentText() { - return $this->container['consent_to_process_text']; + return $this->container['communication_consent_text']; } /** - * Sets consent_to_process_text + * Sets communication_consent_text * - * @param string|null $consent_to_process_text consent_to_process_text + * @param string|null $communication_consent_text * * @return self */ - public function setConsentToProcessText($consent_to_process_text) + public function setCommunicationConsentText($communication_consent_text) { - if (is_null($consent_to_process_text)) { - throw new \InvalidArgumentException('non-nullable consent_to_process_text cannot be null'); + if (is_null($communication_consent_text)) { + throw new \InvalidArgumentException('non-nullable communication_consent_text cannot be null'); } - $this->container['consent_to_process_text'] = $consent_to_process_text; + $this->container['communication_consent_text'] = $communication_consent_text; return $this; } @@ -636,7 +609,7 @@ public function getConsentToProcessCheckboxLabel() /** * Sets consent_to_process_checkbox_label * - * @param string|null $consent_to_process_checkbox_label consent_to_process_checkbox_label + * @param string|null $consent_to_process_checkbox_label * * @return self */ @@ -663,7 +636,7 @@ public function getConsentToProcessFooterText() /** * Sets consent_to_process_footer_text * - * @param string|null $consent_to_process_footer_text consent_to_process_footer_text + * @param string|null $consent_to_process_footer_text * * @return self */ @@ -676,6 +649,33 @@ public function setConsentToProcessFooterText($consent_to_process_footer_text) return $this; } + + /** + * Gets consent_to_process_text + * + * @return string|null + */ + public function getConsentToProcessText() + { + return $this->container['consent_to_process_text']; + } + + /** + * Sets consent_to_process_text + * + * @param string|null $consent_to_process_text + * + * @return self + */ + public function setConsentToProcessText($consent_to_process_text) + { + if (is_null($consent_to_process_text)) { + throw new \InvalidArgumentException('non-nullable consent_to_process_text cannot be null'); + } + $this->container['consent_to_process_text'] = $consent_to_process_text; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/codegen/Marketing/Forms/Model/HubSpotFormDefinitionCreateRequest.php b/codegen/Marketing/Forms/Model/HubSpotFormDefinitionCreateRequest.php index 16d6ada67..7d7fcdcff 100644 --- a/codegen/Marketing/Forms/Model/HubSpotFormDefinitionCreateRequest.php +++ b/codegen/Marketing/Forms/Model/HubSpotFormDefinitionCreateRequest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -306,10 +306,10 @@ public function getFormTypeAllowableValues() /** * 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_type', $data ?? [], 'hubspot'); $this->setIfExists('name', $data ?? [], null); diff --git a/codegen/Marketing/Forms/Model/HubSpotFormDefinitionCreateRequestAllOfLegalConsentOptions.php b/codegen/Marketing/Forms/Model/HubSpotFormDefinitionCreateRequestAllOfLegalConsentOptions.php index 35204dc0f..c5cf9c0fa 100644 --- a/codegen/Marketing/Forms/Model/HubSpotFormDefinitionCreateRequestAllOfLegalConsentOptions.php +++ b/codegen/Marketing/Forms/Model/HubSpotFormDefinitionCreateRequestAllOfLegalConsentOptions.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -61,11 +61,11 @@ class HubSpotFormDefinitionCreateRequestAllOfLegalConsentOptions implements Mode 'subscription_type_ids' => 'int[]', 'lawful_basis' => 'string', 'privacy_text' => 'string', - 'communication_consent_text' => 'string', 'communications_checkboxes' => '\HubSpot\Client\Marketing\Forms\Model\LegalConsentCheckbox[]', - 'consent_to_process_text' => 'string', + 'communication_consent_text' => 'string', 'consent_to_process_checkbox_label' => 'string', - 'consent_to_process_footer_text' => 'string' + 'consent_to_process_footer_text' => 'string', + 'consent_to_process_text' => 'string' ]; /** @@ -80,11 +80,11 @@ class HubSpotFormDefinitionCreateRequestAllOfLegalConsentOptions implements Mode 'subscription_type_ids' => 'int64', 'lawful_basis' => null, 'privacy_text' => null, - 'communication_consent_text' => null, 'communications_checkboxes' => null, - 'consent_to_process_text' => null, + 'communication_consent_text' => null, 'consent_to_process_checkbox_label' => null, - 'consent_to_process_footer_text' => null + 'consent_to_process_footer_text' => null, + 'consent_to_process_text' => null ]; /** @@ -97,11 +97,11 @@ class HubSpotFormDefinitionCreateRequestAllOfLegalConsentOptions implements Mode 'subscription_type_ids' => false, 'lawful_basis' => false, 'privacy_text' => false, - 'communication_consent_text' => false, 'communications_checkboxes' => false, - 'consent_to_process_text' => false, + 'communication_consent_text' => false, 'consent_to_process_checkbox_label' => false, - 'consent_to_process_footer_text' => false + 'consent_to_process_footer_text' => false, + 'consent_to_process_text' => false ]; /** @@ -194,11 +194,11 @@ public function isNullableSetToNull(string $property): bool 'subscription_type_ids' => 'subscriptionTypeIds', 'lawful_basis' => 'lawfulBasis', 'privacy_text' => 'privacyText', - 'communication_consent_text' => 'communicationConsentText', 'communications_checkboxes' => 'communicationsCheckboxes', - 'consent_to_process_text' => 'consentToProcessText', + 'communication_consent_text' => 'communicationConsentText', 'consent_to_process_checkbox_label' => 'consentToProcessCheckboxLabel', - 'consent_to_process_footer_text' => 'consentToProcessFooterText' + 'consent_to_process_footer_text' => 'consentToProcessFooterText', + 'consent_to_process_text' => 'consentToProcessText' ]; /** @@ -211,11 +211,11 @@ public function isNullableSetToNull(string $property): bool 'subscription_type_ids' => 'setSubscriptionTypeIds', 'lawful_basis' => 'setLawfulBasis', 'privacy_text' => 'setPrivacyText', - 'communication_consent_text' => 'setCommunicationConsentText', 'communications_checkboxes' => 'setCommunicationsCheckboxes', - 'consent_to_process_text' => 'setConsentToProcessText', + 'communication_consent_text' => 'setCommunicationConsentText', 'consent_to_process_checkbox_label' => 'setConsentToProcessCheckboxLabel', - 'consent_to_process_footer_text' => 'setConsentToProcessFooterText' + 'consent_to_process_footer_text' => 'setConsentToProcessFooterText', + 'consent_to_process_text' => 'setConsentToProcessText' ]; /** @@ -228,11 +228,11 @@ public function isNullableSetToNull(string $property): bool 'subscription_type_ids' => 'getSubscriptionTypeIds', 'lawful_basis' => 'getLawfulBasis', 'privacy_text' => 'getPrivacyText', - 'communication_consent_text' => 'getCommunicationConsentText', 'communications_checkboxes' => 'getCommunicationsCheckboxes', - 'consent_to_process_text' => 'getConsentToProcessText', + 'communication_consent_text' => 'getCommunicationConsentText', 'consent_to_process_checkbox_label' => 'getConsentToProcessCheckboxLabel', - 'consent_to_process_footer_text' => 'getConsentToProcessFooterText' + 'consent_to_process_footer_text' => 'getConsentToProcessFooterText', + 'consent_to_process_text' => 'getConsentToProcessText' ]; /** @@ -323,20 +323,20 @@ public function getLawfulBasisAllowableValues() /** * 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 ?? [], 'none'); $this->setIfExists('subscription_type_ids', $data ?? [], null); $this->setIfExists('lawful_basis', $data ?? [], null); $this->setIfExists('privacy_text', $data ?? [], null); - $this->setIfExists('communication_consent_text', $data ?? [], null); $this->setIfExists('communications_checkboxes', $data ?? [], null); - $this->setIfExists('consent_to_process_text', $data ?? [], null); + $this->setIfExists('communication_consent_text', $data ?? [], null); $this->setIfExists('consent_to_process_checkbox_label', $data ?? [], null); $this->setIfExists('consent_to_process_footer_text', $data ?? [], null); + $this->setIfExists('consent_to_process_text', $data ?? [], null); } /** @@ -427,7 +427,7 @@ public function getType() /** * Sets type * - * @param string $type type + * @param string $type * * @return self */ @@ -464,7 +464,7 @@ public function getSubscriptionTypeIds() /** * Sets subscription_type_ids * - * @param int[] $subscription_type_ids subscription_type_ids + * @param int[] $subscription_type_ids * * @return self */ @@ -491,7 +491,7 @@ public function getLawfulBasis() /** * Sets lawful_basis * - * @param string $lawful_basis lawful_basis + * @param string $lawful_basis * * @return self */ @@ -528,7 +528,7 @@ public function getPrivacyText() /** * Sets privacy_text * - * @param string $privacy_text privacy_text + * @param string $privacy_text * * @return self */ @@ -542,33 +542,6 @@ public function setPrivacyText($privacy_text) return $this; } - /** - * Gets communication_consent_text - * - * @return string|null - */ - public function getCommunicationConsentText() - { - return $this->container['communication_consent_text']; - } - - /** - * Sets communication_consent_text - * - * @param string|null $communication_consent_text communication_consent_text - * - * @return self - */ - public function setCommunicationConsentText($communication_consent_text) - { - if (is_null($communication_consent_text)) { - throw new \InvalidArgumentException('non-nullable communication_consent_text cannot be null'); - } - $this->container['communication_consent_text'] = $communication_consent_text; - - return $this; - } - /** * Gets communications_checkboxes * @@ -582,7 +555,7 @@ public function getCommunicationsCheckboxes() /** * Sets communications_checkboxes * - * @param \HubSpot\Client\Marketing\Forms\Model\LegalConsentCheckbox[] $communications_checkboxes communications_checkboxes + * @param \HubSpot\Client\Marketing\Forms\Model\LegalConsentCheckbox[] $communications_checkboxes * * @return self */ @@ -597,28 +570,28 @@ public function setCommunicationsCheckboxes($communications_checkboxes) } /** - * Gets consent_to_process_text + * Gets communication_consent_text * * @return string|null */ - public function getConsentToProcessText() + public function getCommunicationConsentText() { - return $this->container['consent_to_process_text']; + return $this->container['communication_consent_text']; } /** - * Sets consent_to_process_text + * Sets communication_consent_text * - * @param string|null $consent_to_process_text consent_to_process_text + * @param string|null $communication_consent_text * * @return self */ - public function setConsentToProcessText($consent_to_process_text) + public function setCommunicationConsentText($communication_consent_text) { - if (is_null($consent_to_process_text)) { - throw new \InvalidArgumentException('non-nullable consent_to_process_text cannot be null'); + if (is_null($communication_consent_text)) { + throw new \InvalidArgumentException('non-nullable communication_consent_text cannot be null'); } - $this->container['consent_to_process_text'] = $consent_to_process_text; + $this->container['communication_consent_text'] = $communication_consent_text; return $this; } @@ -636,7 +609,7 @@ public function getConsentToProcessCheckboxLabel() /** * Sets consent_to_process_checkbox_label * - * @param string|null $consent_to_process_checkbox_label consent_to_process_checkbox_label + * @param string|null $consent_to_process_checkbox_label * * @return self */ @@ -663,7 +636,7 @@ public function getConsentToProcessFooterText() /** * Sets consent_to_process_footer_text * - * @param string|null $consent_to_process_footer_text consent_to_process_footer_text + * @param string|null $consent_to_process_footer_text * * @return self */ @@ -676,6 +649,33 @@ public function setConsentToProcessFooterText($consent_to_process_footer_text) return $this; } + + /** + * Gets consent_to_process_text + * + * @return string|null + */ + public function getConsentToProcessText() + { + return $this->container['consent_to_process_text']; + } + + /** + * Sets consent_to_process_text + * + * @param string|null $consent_to_process_text + * + * @return self + */ + public function setConsentToProcessText($consent_to_process_text) + { + if (is_null($consent_to_process_text)) { + throw new \InvalidArgumentException('non-nullable consent_to_process_text cannot be null'); + } + $this->container['consent_to_process_text'] = $consent_to_process_text; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/codegen/Marketing/Forms/Model/HubSpotFormDefinitionPatchRequest.php b/codegen/Marketing/Forms/Model/HubSpotFormDefinitionPatchRequest.php index 93d9576ec..4f12e5b6c 100644 --- a/codegen/Marketing/Forms/Model/HubSpotFormDefinitionPatchRequest.php +++ b/codegen/Marketing/Forms/Model/HubSpotFormDefinitionPatchRequest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -269,10 +269,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('field_groups', $data ?? [], null); $this->setIfExists('archived', $data ?? [], null); diff --git a/codegen/Marketing/Forms/Model/LegalConsentCheckbox.php b/codegen/Marketing/Forms/Model/LegalConsentCheckbox.php index 2aca9e240..80ceff907 100644 --- a/codegen/Marketing/Forms/Model/LegalConsentCheckbox.php +++ b/codegen/Marketing/Forms/Model/LegalConsentCheckbox.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -57,9 +57,9 @@ class LegalConsentCheckbox implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'required' => 'bool', 'subscription_type_id' => 'int', - 'label' => 'string' + 'label' => 'string', + 'required' => 'bool' ]; /** @@ -70,9 +70,9 @@ class LegalConsentCheckbox implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ - 'required' => null, 'subscription_type_id' => 'int32', - 'label' => null + 'label' => null, + 'required' => null ]; /** @@ -81,9 +81,9 @@ class LegalConsentCheckbox implements ModelInterface, ArrayAccess, \JsonSerializ * @var boolean[] */ protected static array $openAPINullables = [ - 'required' => false, 'subscription_type_id' => false, - 'label' => false + 'label' => false, + 'required' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'required' => 'required', 'subscription_type_id' => 'subscriptionTypeId', - 'label' => 'label' + 'label' => 'label', + 'required' => 'required' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'required' => 'setRequired', 'subscription_type_id' => 'setSubscriptionTypeId', - 'label' => 'setLabel' + 'label' => 'setLabel', + 'required' => 'setRequired' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'required' => 'getRequired', 'subscription_type_id' => 'getSubscriptionTypeId', - 'label' => 'getLabel' + 'label' => 'getLabel', + 'required' => 'getRequired' ]; /** @@ -251,14 +251,14 @@ 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('required', $data ?? [], null); $this->setIfExists('subscription_type_id', $data ?? [], null); $this->setIfExists('label', $data ?? [], null); + $this->setIfExists('required', $data ?? [], null); } /** @@ -288,15 +288,15 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['required'] === null) { - $invalidProperties[] = "'required' can't be null"; - } if ($this->container['subscription_type_id'] === null) { $invalidProperties[] = "'subscription_type_id' can't be null"; } if ($this->container['label'] === null) { $invalidProperties[] = "'label' can't be null"; } + if ($this->container['required'] === null) { + $invalidProperties[] = "'required' can't be null"; + } return $invalidProperties; } @@ -312,33 +312,6 @@ public function valid() } - /** - * Gets required - * - * @return bool - */ - public function getRequired() - { - return $this->container['required']; - } - - /** - * Sets required - * - * @param bool $required Whether this checkbox is required when submitting the form. - * - * @return self - */ - public function setRequired($required) - { - if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); - } - $this->container['required'] = $required; - - return $this; - } - /** * Gets subscription_type_id * @@ -352,7 +325,7 @@ public function getSubscriptionTypeId() /** * Sets subscription_type_id * - * @param int $subscription_type_id subscription_type_id + * @param int $subscription_type_id * * @return self */ @@ -392,6 +365,33 @@ public function setLabel($label) return $this; } + + /** + * Gets required + * + * @return bool + */ + public function getRequired() + { + return $this->container['required']; + } + + /** + * Sets required + * + * @param bool $required Whether this checkbox is required when submitting the form. + * + * @return self + */ + public function setRequired($required) + { + if (is_null($required)) { + throw new \InvalidArgumentException('non-nullable required cannot be null'); + } + $this->container['required'] = $required; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/codegen/Marketing/Forms/Model/LegalConsentOptionsExplicitConsentToProcess.php b/codegen/Marketing/Forms/Model/LegalConsentOptionsExplicitConsentToProcess.php index e7f86b9dc..9d970424d 100644 --- a/codegen/Marketing/Forms/Model/LegalConsentOptionsExplicitConsentToProcess.php +++ b/codegen/Marketing/Forms/Model/LegalConsentOptionsExplicitConsentToProcess.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -57,13 +57,13 @@ class LegalConsentOptionsExplicitConsentToProcess implements ModelInterface, Arr * @var string[] */ protected static $openAPITypes = [ - 'type' => 'string', - 'communication_consent_text' => 'string', 'communications_checkboxes' => '\HubSpot\Client\Marketing\Forms\Model\LegalConsentCheckbox[]', - 'consent_to_process_text' => 'string', + 'communication_consent_text' => 'string', 'consent_to_process_checkbox_label' => 'string', 'consent_to_process_footer_text' => 'string', - 'privacy_text' => 'string' + 'type' => 'string', + 'privacy_text' => 'string', + 'consent_to_process_text' => 'string' ]; /** @@ -74,13 +74,13 @@ class LegalConsentOptionsExplicitConsentToProcess implements ModelInterface, Arr * @psalm-var array */ protected static $openAPIFormats = [ - 'type' => null, - 'communication_consent_text' => null, 'communications_checkboxes' => null, - 'consent_to_process_text' => null, + 'communication_consent_text' => null, 'consent_to_process_checkbox_label' => null, 'consent_to_process_footer_text' => null, - 'privacy_text' => null + 'type' => null, + 'privacy_text' => null, + 'consent_to_process_text' => null ]; /** @@ -89,13 +89,13 @@ class LegalConsentOptionsExplicitConsentToProcess implements ModelInterface, Arr * @var boolean[] */ protected static array $openAPINullables = [ - 'type' => false, - 'communication_consent_text' => false, 'communications_checkboxes' => false, - 'consent_to_process_text' => false, + 'communication_consent_text' => false, 'consent_to_process_checkbox_label' => false, 'consent_to_process_footer_text' => false, - 'privacy_text' => false + 'type' => false, + 'privacy_text' => false, + 'consent_to_process_text' => false ]; /** @@ -184,13 +184,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', - 'communication_consent_text' => 'communicationConsentText', 'communications_checkboxes' => 'communicationsCheckboxes', - 'consent_to_process_text' => 'consentToProcessText', + 'communication_consent_text' => 'communicationConsentText', 'consent_to_process_checkbox_label' => 'consentToProcessCheckboxLabel', 'consent_to_process_footer_text' => 'consentToProcessFooterText', - 'privacy_text' => 'privacyText' + 'type' => 'type', + 'privacy_text' => 'privacyText', + 'consent_to_process_text' => 'consentToProcessText' ]; /** @@ -199,13 +199,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', - 'communication_consent_text' => 'setCommunicationConsentText', 'communications_checkboxes' => 'setCommunicationsCheckboxes', - 'consent_to_process_text' => 'setConsentToProcessText', + 'communication_consent_text' => 'setCommunicationConsentText', 'consent_to_process_checkbox_label' => 'setConsentToProcessCheckboxLabel', 'consent_to_process_footer_text' => 'setConsentToProcessFooterText', - 'privacy_text' => 'setPrivacyText' + 'type' => 'setType', + 'privacy_text' => 'setPrivacyText', + 'consent_to_process_text' => 'setConsentToProcessText' ]; /** @@ -214,13 +214,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', - 'communication_consent_text' => 'getCommunicationConsentText', 'communications_checkboxes' => 'getCommunicationsCheckboxes', - 'consent_to_process_text' => 'getConsentToProcessText', + 'communication_consent_text' => 'getCommunicationConsentText', 'consent_to_process_checkbox_label' => 'getConsentToProcessCheckboxLabel', 'consent_to_process_footer_text' => 'getConsentToProcessFooterText', - 'privacy_text' => 'getPrivacyText' + 'type' => 'getType', + 'privacy_text' => 'getPrivacyText', + 'consent_to_process_text' => 'getConsentToProcessText' ]; /** @@ -288,18 +288,18 @@ 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 ?? [], 'explicit_consent_to_process'); - $this->setIfExists('communication_consent_text', $data ?? [], null); $this->setIfExists('communications_checkboxes', $data ?? [], null); - $this->setIfExists('consent_to_process_text', $data ?? [], null); + $this->setIfExists('communication_consent_text', $data ?? [], null); $this->setIfExists('consent_to_process_checkbox_label', $data ?? [], null); $this->setIfExists('consent_to_process_footer_text', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'explicit_consent_to_process'); $this->setIfExists('privacy_text', $data ?? [], null); + $this->setIfExists('consent_to_process_text', $data ?? [], null); } /** @@ -329,6 +329,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['communications_checkboxes'] === null) { + $invalidProperties[] = "'communications_checkboxes' can't be null"; + } if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } @@ -341,9 +344,6 @@ public function listInvalidProperties() ); } - if ($this->container['communications_checkboxes'] === null) { - $invalidProperties[] = "'communications_checkboxes' can't be null"; - } if ($this->container['privacy_text'] === null) { $invalidProperties[] = "'privacy_text' can't be null"; } @@ -363,38 +363,28 @@ public function valid() /** - * Gets type + * Gets communications_checkboxes * - * @return string + * @return \HubSpot\Client\Marketing\Forms\Model\LegalConsentCheckbox[] */ - public function getType() + public function getCommunicationsCheckboxes() { - return $this->container['type']; + return $this->container['communications_checkboxes']; } /** - * Sets type + * Sets communications_checkboxes * - * @param string $type type + * @param \HubSpot\Client\Marketing\Forms\Model\LegalConsentCheckbox[] $communications_checkboxes * * @return self */ - public function setType($type) + public function setCommunicationsCheckboxes($communications_checkboxes) { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); + if (is_null($communications_checkboxes)) { + throw new \InvalidArgumentException('non-nullable communications_checkboxes cannot be null'); } - $this->container['type'] = $type; + $this->container['communications_checkboxes'] = $communications_checkboxes; return $this; } @@ -412,7 +402,7 @@ public function getCommunicationConsentText() /** * Sets communication_consent_text * - * @param string|null $communication_consent_text communication_consent_text + * @param string|null $communication_consent_text * * @return self */ @@ -427,136 +417,146 @@ public function setCommunicationConsentText($communication_consent_text) } /** - * Gets communications_checkboxes + * Gets consent_to_process_checkbox_label * - * @return \HubSpot\Client\Marketing\Forms\Model\LegalConsentCheckbox[] + * @return string|null */ - public function getCommunicationsCheckboxes() + public function getConsentToProcessCheckboxLabel() { - return $this->container['communications_checkboxes']; + return $this->container['consent_to_process_checkbox_label']; } /** - * Sets communications_checkboxes + * Sets consent_to_process_checkbox_label * - * @param \HubSpot\Client\Marketing\Forms\Model\LegalConsentCheckbox[] $communications_checkboxes communications_checkboxes + * @param string|null $consent_to_process_checkbox_label * * @return self */ - public function setCommunicationsCheckboxes($communications_checkboxes) + public function setConsentToProcessCheckboxLabel($consent_to_process_checkbox_label) { - if (is_null($communications_checkboxes)) { - throw new \InvalidArgumentException('non-nullable communications_checkboxes cannot be null'); + if (is_null($consent_to_process_checkbox_label)) { + throw new \InvalidArgumentException('non-nullable consent_to_process_checkbox_label cannot be null'); } - $this->container['communications_checkboxes'] = $communications_checkboxes; + $this->container['consent_to_process_checkbox_label'] = $consent_to_process_checkbox_label; return $this; } /** - * Gets consent_to_process_text + * Gets consent_to_process_footer_text * * @return string|null */ - public function getConsentToProcessText() + public function getConsentToProcessFooterText() { - return $this->container['consent_to_process_text']; + return $this->container['consent_to_process_footer_text']; } /** - * Sets consent_to_process_text + * Sets consent_to_process_footer_text * - * @param string|null $consent_to_process_text consent_to_process_text + * @param string|null $consent_to_process_footer_text * * @return self */ - public function setConsentToProcessText($consent_to_process_text) + public function setConsentToProcessFooterText($consent_to_process_footer_text) { - if (is_null($consent_to_process_text)) { - throw new \InvalidArgumentException('non-nullable consent_to_process_text cannot be null'); + if (is_null($consent_to_process_footer_text)) { + throw new \InvalidArgumentException('non-nullable consent_to_process_footer_text cannot be null'); } - $this->container['consent_to_process_text'] = $consent_to_process_text; + $this->container['consent_to_process_footer_text'] = $consent_to_process_footer_text; return $this; } /** - * Gets consent_to_process_checkbox_label + * Gets type * - * @return string|null + * @return string */ - public function getConsentToProcessCheckboxLabel() + public function getType() { - return $this->container['consent_to_process_checkbox_label']; + return $this->container['type']; } /** - * Sets consent_to_process_checkbox_label + * Sets type * - * @param string|null $consent_to_process_checkbox_label consent_to_process_checkbox_label + * @param string $type * * @return self */ - public function setConsentToProcessCheckboxLabel($consent_to_process_checkbox_label) + public function setType($type) { - if (is_null($consent_to_process_checkbox_label)) { - throw new \InvalidArgumentException('non-nullable consent_to_process_checkbox_label cannot be null'); + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); } - $this->container['consent_to_process_checkbox_label'] = $consent_to_process_checkbox_label; + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; return $this; } /** - * Gets consent_to_process_footer_text + * Gets privacy_text * - * @return string|null + * @return string */ - public function getConsentToProcessFooterText() + public function getPrivacyText() { - return $this->container['consent_to_process_footer_text']; + return $this->container['privacy_text']; } /** - * Sets consent_to_process_footer_text + * Sets privacy_text * - * @param string|null $consent_to_process_footer_text consent_to_process_footer_text + * @param string $privacy_text * * @return self */ - public function setConsentToProcessFooterText($consent_to_process_footer_text) + public function setPrivacyText($privacy_text) { - if (is_null($consent_to_process_footer_text)) { - throw new \InvalidArgumentException('non-nullable consent_to_process_footer_text cannot be null'); + if (is_null($privacy_text)) { + throw new \InvalidArgumentException('non-nullable privacy_text cannot be null'); } - $this->container['consent_to_process_footer_text'] = $consent_to_process_footer_text; + $this->container['privacy_text'] = $privacy_text; return $this; } /** - * Gets privacy_text + * Gets consent_to_process_text * - * @return string + * @return string|null */ - public function getPrivacyText() + public function getConsentToProcessText() { - return $this->container['privacy_text']; + return $this->container['consent_to_process_text']; } /** - * Sets privacy_text + * Sets consent_to_process_text * - * @param string $privacy_text privacy_text + * @param string|null $consent_to_process_text * * @return self */ - public function setPrivacyText($privacy_text) + public function setConsentToProcessText($consent_to_process_text) { - if (is_null($privacy_text)) { - throw new \InvalidArgumentException('non-nullable privacy_text cannot be null'); + if (is_null($consent_to_process_text)) { + throw new \InvalidArgumentException('non-nullable consent_to_process_text cannot be null'); } - $this->container['privacy_text'] = $privacy_text; + $this->container['consent_to_process_text'] = $consent_to_process_text; return $this; } diff --git a/codegen/Marketing/Forms/Model/LegalConsentOptionsImplicitConsentToProcess.php b/codegen/Marketing/Forms/Model/LegalConsentOptionsImplicitConsentToProcess.php index affca76a7..68af1e625 100644 --- a/codegen/Marketing/Forms/Model/LegalConsentOptionsImplicitConsentToProcess.php +++ b/codegen/Marketing/Forms/Model/LegalConsentOptionsImplicitConsentToProcess.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -57,9 +57,9 @@ class LegalConsentOptionsImplicitConsentToProcess implements ModelInterface, Arr * @var string[] */ protected static $openAPITypes = [ - 'type' => 'string', - 'communication_consent_text' => 'string', 'communications_checkboxes' => '\HubSpot\Client\Marketing\Forms\Model\LegalConsentCheckbox[]', + 'communication_consent_text' => 'string', + 'type' => 'string', 'privacy_text' => 'string', 'consent_to_process_text' => 'string' ]; @@ -72,9 +72,9 @@ class LegalConsentOptionsImplicitConsentToProcess implements ModelInterface, Arr * @psalm-var array */ protected static $openAPIFormats = [ - 'type' => null, - 'communication_consent_text' => null, 'communications_checkboxes' => null, + 'communication_consent_text' => null, + 'type' => null, 'privacy_text' => null, 'consent_to_process_text' => null ]; @@ -85,9 +85,9 @@ class LegalConsentOptionsImplicitConsentToProcess implements ModelInterface, Arr * @var boolean[] */ protected static array $openAPINullables = [ - 'type' => false, - 'communication_consent_text' => false, 'communications_checkboxes' => false, + 'communication_consent_text' => false, + 'type' => false, 'privacy_text' => false, 'consent_to_process_text' => false ]; @@ -178,9 +178,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', - 'communication_consent_text' => 'communicationConsentText', 'communications_checkboxes' => 'communicationsCheckboxes', + 'communication_consent_text' => 'communicationConsentText', + 'type' => 'type', 'privacy_text' => 'privacyText', 'consent_to_process_text' => 'consentToProcessText' ]; @@ -191,9 +191,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', - 'communication_consent_text' => 'setCommunicationConsentText', 'communications_checkboxes' => 'setCommunicationsCheckboxes', + 'communication_consent_text' => 'setCommunicationConsentText', + 'type' => 'setType', 'privacy_text' => 'setPrivacyText', 'consent_to_process_text' => 'setConsentToProcessText' ]; @@ -204,9 +204,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', - 'communication_consent_text' => 'getCommunicationConsentText', 'communications_checkboxes' => 'getCommunicationsCheckboxes', + 'communication_consent_text' => 'getCommunicationConsentText', + 'type' => 'getType', 'privacy_text' => 'getPrivacyText', 'consent_to_process_text' => 'getConsentToProcessText' ]; @@ -276,14 +276,14 @@ 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 ?? [], 'implicit_consent_to_process'); - $this->setIfExists('communication_consent_text', $data ?? [], null); $this->setIfExists('communications_checkboxes', $data ?? [], null); + $this->setIfExists('communication_consent_text', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'implicit_consent_to_process'); $this->setIfExists('privacy_text', $data ?? [], null); $this->setIfExists('consent_to_process_text', $data ?? [], null); } @@ -315,6 +315,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['communications_checkboxes'] === null) { + $invalidProperties[] = "'communications_checkboxes' can't be null"; + } if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } @@ -327,9 +330,6 @@ public function listInvalidProperties() ); } - if ($this->container['communications_checkboxes'] === null) { - $invalidProperties[] = "'communications_checkboxes' can't be null"; - } if ($this->container['privacy_text'] === null) { $invalidProperties[] = "'privacy_text' can't be null"; } @@ -349,38 +349,28 @@ public function valid() /** - * Gets type + * Gets communications_checkboxes * - * @return string + * @return \HubSpot\Client\Marketing\Forms\Model\LegalConsentCheckbox[] */ - public function getType() + public function getCommunicationsCheckboxes() { - return $this->container['type']; + return $this->container['communications_checkboxes']; } /** - * Sets type + * Sets communications_checkboxes * - * @param string $type type + * @param \HubSpot\Client\Marketing\Forms\Model\LegalConsentCheckbox[] $communications_checkboxes * * @return self */ - public function setType($type) + public function setCommunicationsCheckboxes($communications_checkboxes) { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); + if (is_null($communications_checkboxes)) { + throw new \InvalidArgumentException('non-nullable communications_checkboxes cannot be null'); } - $this->container['type'] = $type; + $this->container['communications_checkboxes'] = $communications_checkboxes; return $this; } @@ -398,7 +388,7 @@ public function getCommunicationConsentText() /** * Sets communication_consent_text * - * @param string|null $communication_consent_text communication_consent_text + * @param string|null $communication_consent_text * * @return self */ @@ -413,28 +403,38 @@ public function setCommunicationConsentText($communication_consent_text) } /** - * Gets communications_checkboxes + * Gets type * - * @return \HubSpot\Client\Marketing\Forms\Model\LegalConsentCheckbox[] + * @return string */ - public function getCommunicationsCheckboxes() + public function getType() { - return $this->container['communications_checkboxes']; + return $this->container['type']; } /** - * Sets communications_checkboxes + * Sets type * - * @param \HubSpot\Client\Marketing\Forms\Model\LegalConsentCheckbox[] $communications_checkboxes communications_checkboxes + * @param string $type * * @return self */ - public function setCommunicationsCheckboxes($communications_checkboxes) + public function setType($type) { - if (is_null($communications_checkboxes)) { - throw new \InvalidArgumentException('non-nullable communications_checkboxes cannot be null'); + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); } - $this->container['communications_checkboxes'] = $communications_checkboxes; + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; return $this; } @@ -452,7 +452,7 @@ public function getPrivacyText() /** * Sets privacy_text * - * @param string $privacy_text privacy_text + * @param string $privacy_text * * @return self */ @@ -479,7 +479,7 @@ public function getConsentToProcessText() /** * Sets consent_to_process_text * - * @param string|null $consent_to_process_text consent_to_process_text + * @param string|null $consent_to_process_text * * @return self */ diff --git a/codegen/Marketing/Forms/Model/LegalConsentOptionsLegitimateInterest.php b/codegen/Marketing/Forms/Model/LegalConsentOptionsLegitimateInterest.php index 318192c45..bc7032c89 100644 --- a/codegen/Marketing/Forms/Model/LegalConsentOptionsLegitimateInterest.php +++ b/codegen/Marketing/Forms/Model/LegalConsentOptionsLegitimateInterest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -57,9 +57,9 @@ class LegalConsentOptionsLegitimateInterest implements ModelInterface, ArrayAcce * @var string[] */ protected static $openAPITypes = [ - 'type' => 'string', 'subscription_type_ids' => 'int[]', 'lawful_basis' => 'string', + 'type' => 'string', 'privacy_text' => 'string' ]; @@ -71,9 +71,9 @@ class LegalConsentOptionsLegitimateInterest implements ModelInterface, ArrayAcce * @psalm-var array */ protected static $openAPIFormats = [ - 'type' => null, 'subscription_type_ids' => 'int64', 'lawful_basis' => null, + 'type' => null, 'privacy_text' => null ]; @@ -83,9 +83,9 @@ class LegalConsentOptionsLegitimateInterest implements ModelInterface, ArrayAcce * @var boolean[] */ protected static array $openAPINullables = [ - 'type' => false, 'subscription_type_ids' => false, 'lawful_basis' => false, + 'type' => false, 'privacy_text' => false ]; @@ -175,9 +175,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', 'subscription_type_ids' => 'subscriptionTypeIds', 'lawful_basis' => 'lawfulBasis', + 'type' => 'type', 'privacy_text' => 'privacyText' ]; @@ -187,9 +187,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', 'subscription_type_ids' => 'setSubscriptionTypeIds', 'lawful_basis' => 'setLawfulBasis', + 'type' => 'setType', 'privacy_text' => 'setPrivacyText' ]; @@ -199,9 +199,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', 'subscription_type_ids' => 'getSubscriptionTypeIds', 'lawful_basis' => 'getLawfulBasis', + 'type' => 'getType', 'privacy_text' => 'getPrivacyText' ]; @@ -246,20 +246,22 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_LEGITIMATE_INTEREST = 'legitimate_interest'; public const LAWFUL_BASIS_LEAD = 'lead'; public const LAWFUL_BASIS_CLIENT = 'client'; public const LAWFUL_BASIS_OTHER = 'other'; + public const TYPE_LEGITIMATE_INTEREST = 'legitimate_interest'; /** * Gets allowable values of the enum * * @return string[] */ - public function getTypeAllowableValues() + public function getLawfulBasisAllowableValues() { return [ - self::TYPE_LEGITIMATE_INTEREST, + self::LAWFUL_BASIS_LEAD, + self::LAWFUL_BASIS_CLIENT, + self::LAWFUL_BASIS_OTHER, ]; } @@ -268,12 +270,10 @@ public function getTypeAllowableValues() * * @return string[] */ - public function getLawfulBasisAllowableValues() + public function getTypeAllowableValues() { return [ - self::LAWFUL_BASIS_LEAD, - self::LAWFUL_BASIS_CLIENT, - self::LAWFUL_BASIS_OTHER, + self::TYPE_LEGITIMATE_INTEREST, ]; } @@ -287,14 +287,14 @@ public function getLawfulBasisAllowableValues() /** * 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 ?? [], 'legitimate_interest'); $this->setIfExists('subscription_type_ids', $data ?? [], null); $this->setIfExists('lawful_basis', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'legitimate_interest'); $this->setIfExists('privacy_text', $data ?? [], null); } @@ -325,18 +325,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'type', must be one of '%s'", - $this->container['type'], - implode("', '", $allowedValues) - ); - } - if ($this->container['subscription_type_ids'] === null) { $invalidProperties[] = "'subscription_type_ids' can't be null"; } @@ -352,6 +340,18 @@ public function listInvalidProperties() ); } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + if ($this->container['privacy_text'] === null) { $invalidProperties[] = "'privacy_text' can't be null"; } @@ -370,43 +370,6 @@ public function valid() } - /** - * Gets type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $type type - * - * @return self - */ - public function setType($type) - { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['type'] = $type; - - return $this; - } - /** * Gets subscription_type_ids * @@ -420,7 +383,7 @@ public function getSubscriptionTypeIds() /** * Sets subscription_type_ids * - * @param int[] $subscription_type_ids subscription_type_ids + * @param int[] $subscription_type_ids * * @return self */ @@ -447,7 +410,7 @@ public function getLawfulBasis() /** * Sets lawful_basis * - * @param string $lawful_basis lawful_basis + * @param string $lawful_basis * * @return self */ @@ -471,6 +434,43 @@ public function setLawfulBasis($lawful_basis) return $this; } + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** * Gets privacy_text * @@ -484,7 +484,7 @@ public function getPrivacyText() /** * Sets privacy_text * - * @param string $privacy_text privacy_text + * @param string $privacy_text * * @return self */ diff --git a/codegen/Marketing/Forms/Model/LegalConsentOptionsNone.php b/codegen/Marketing/Forms/Model/LegalConsentOptionsNone.php index f05ce840e..1cdf4dd96 100644 --- a/codegen/Marketing/Forms/Model/LegalConsentOptionsNone.php +++ b/codegen/Marketing/Forms/Model/LegalConsentOptionsNone.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -252,10 +252,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 ?? [], 'none'); } @@ -327,7 +327,7 @@ public function getType() /** * Sets type * - * @param string $type type + * @param string $type * * @return self */ diff --git a/codegen/Marketing/Forms/Model/LifecycleStage.php b/codegen/Marketing/Forms/Model/LifecycleStage.php index 5ebb98f1f..2c951e32c 100644 --- a/codegen/Marketing/Forms/Model/LifecycleStage.php +++ b/codegen/Marketing/Forms/Model/LifecycleStage.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -245,10 +245,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('object_type_id', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); diff --git a/codegen/Marketing/Forms/Model/MobilePhoneField.php b/codegen/Marketing/Forms/Model/MobilePhoneField.php index 18593eeb9..def582d3b 100644 --- a/codegen/Marketing/Forms/Model/MobilePhoneField.php +++ b/codegen/Marketing/Forms/Model/MobilePhoneField.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -58,16 +58,16 @@ class MobilePhoneField implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'field_type' => 'string', 'object_type_id' => 'string', + 'hidden' => 'bool', + 'default_value' => 'string', 'name' => 'string', - 'label' => 'string', 'description' => 'string', - 'required' => 'bool', - 'hidden' => 'bool', 'dependent_fields' => '\HubSpot\Client\Marketing\Forms\Model\DependentField[]', + 'label' => 'string', 'placeholder' => 'string', - 'default_value' => 'string', + 'field_type' => 'string', + 'required' => 'bool', 'validation' => '\HubSpot\Client\Marketing\Forms\Model\PhoneFieldValidation' ]; @@ -79,16 +79,16 @@ class MobilePhoneField implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'field_type' => null, 'object_type_id' => null, + 'hidden' => null, + 'default_value' => null, 'name' => null, - 'label' => null, 'description' => null, - 'required' => null, - 'hidden' => null, 'dependent_fields' => null, + 'label' => null, 'placeholder' => null, - 'default_value' => null, + 'field_type' => null, + 'required' => null, 'validation' => null ]; @@ -98,16 +98,16 @@ class MobilePhoneField implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'field_type' => false, 'object_type_id' => false, + 'hidden' => false, + 'default_value' => false, 'name' => false, - 'label' => false, 'description' => false, - 'required' => false, - 'hidden' => false, 'dependent_fields' => false, + 'label' => false, 'placeholder' => false, - 'default_value' => false, + 'field_type' => false, + 'required' => false, 'validation' => false ]; @@ -197,16 +197,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'field_type' => 'fieldType', 'object_type_id' => 'objectTypeId', + 'hidden' => 'hidden', + 'default_value' => 'defaultValue', 'name' => 'name', - 'label' => 'label', 'description' => 'description', - 'required' => 'required', - 'hidden' => 'hidden', 'dependent_fields' => 'dependentFields', + 'label' => 'label', 'placeholder' => 'placeholder', - 'default_value' => 'defaultValue', + 'field_type' => 'fieldType', + 'required' => 'required', 'validation' => 'validation' ]; @@ -216,16 +216,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'field_type' => 'setFieldType', 'object_type_id' => 'setObjectTypeId', + 'hidden' => 'setHidden', + 'default_value' => 'setDefaultValue', 'name' => 'setName', - 'label' => 'setLabel', 'description' => 'setDescription', - 'required' => 'setRequired', - 'hidden' => 'setHidden', 'dependent_fields' => 'setDependentFields', + 'label' => 'setLabel', 'placeholder' => 'setPlaceholder', - 'default_value' => 'setDefaultValue', + 'field_type' => 'setFieldType', + 'required' => 'setRequired', 'validation' => 'setValidation' ]; @@ -235,16 +235,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'field_type' => 'getFieldType', 'object_type_id' => 'getObjectTypeId', + 'hidden' => 'getHidden', + 'default_value' => 'getDefaultValue', 'name' => 'getName', - 'label' => 'getLabel', 'description' => 'getDescription', - 'required' => 'getRequired', - 'hidden' => 'getHidden', 'dependent_fields' => 'getDependentFields', + 'label' => 'getLabel', 'placeholder' => 'getPlaceholder', - 'default_value' => 'getDefaultValue', + 'field_type' => 'getFieldType', + 'required' => 'getRequired', 'validation' => 'getValidation' ]; @@ -313,21 +313,21 @@ public function getFieldTypeAllowableValues() /** * 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('field_type', $data ?? [], 'mobile_phone'); $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('hidden', $data ?? [], null); + $this->setIfExists('default_value', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('required', $data ?? [], null); - $this->setIfExists('hidden', $data ?? [], null); $this->setIfExists('dependent_fields', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); $this->setIfExists('placeholder', $data ?? [], null); - $this->setIfExists('default_value', $data ?? [], null); + $this->setIfExists('field_type', $data ?? [], 'mobile_phone'); + $this->setIfExists('required', $data ?? [], null); $this->setIfExists('validation', $data ?? [], null); } @@ -358,6 +358,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['hidden'] === null) { + $invalidProperties[] = "'hidden' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['dependent_fields'] === null) { + $invalidProperties[] = "'dependent_fields' can't be null"; + } + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } if ($this->container['field_type'] === null) { $invalidProperties[] = "'field_type' can't be null"; } @@ -370,24 +385,9 @@ public function listInvalidProperties() ); } - if ($this->container['object_type_id'] === null) { - $invalidProperties[] = "'object_type_id' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['label'] === null) { - $invalidProperties[] = "'label' can't be null"; - } if ($this->container['required'] === null) { $invalidProperties[] = "'required' can't be null"; } - if ($this->container['hidden'] === null) { - $invalidProperties[] = "'hidden' can't be null"; - } - if ($this->container['dependent_fields'] === null) { - $invalidProperties[] = "'dependent_fields' can't be null"; - } if ($this->container['validation'] === null) { $invalidProperties[] = "'validation' can't be null"; } @@ -407,119 +407,109 @@ public function valid() /** - * Gets field_type + * Gets object_type_id * * @return string */ - public function getFieldType() + public function getObjectTypeId() { - return $this->container['field_type']; + return $this->container['object_type_id']; } /** - * Sets field_type + * Sets object_type_id * - * @param string $field_type Determines how the field will be displayed and validated. + * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. * * @return self */ - public function setFieldType($field_type) + public function setObjectTypeId($object_type_id) { - if (is_null($field_type)) { - throw new \InvalidArgumentException('non-nullable field_type cannot be null'); - } - $allowedValues = $this->getFieldTypeAllowableValues(); - if (!in_array($field_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'field_type', must be one of '%s'", - $field_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); } - $this->container['field_type'] = $field_type; + $this->container['object_type_id'] = $object_type_id; return $this; } /** - * Gets object_type_id + * Gets hidden * - * @return string + * @return bool */ - public function getObjectTypeId() + public function getHidden() { - return $this->container['object_type_id']; + return $this->container['hidden']; } /** - * Sets object_type_id + * Sets hidden * - * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. + * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. * * @return self */ - public function setObjectTypeId($object_type_id) + public function setHidden($hidden) { - if (is_null($object_type_id)) { - throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + if (is_null($hidden)) { + throw new \InvalidArgumentException('non-nullable hidden cannot be null'); } - $this->container['object_type_id'] = $object_type_id; + $this->container['hidden'] = $hidden; return $this; } /** - * Gets name + * Gets default_value * - * @return string + * @return string|null */ - public function getName() + public function getDefaultValue() { - return $this->container['name']; + return $this->container['default_value']; } /** - * Sets name + * Sets default_value * - * @param string $name The identifier of the field. In combination with the object type ID, it must be unique. + * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. * * @return self */ - public function setName($name) + public function setDefaultValue($default_value) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($default_value)) { + throw new \InvalidArgumentException('non-nullable default_value cannot be null'); } - $this->container['name'] = $name; + $this->container['default_value'] = $default_value; return $this; } /** - * Gets label + * Gets name * * @return string */ - public function getLabel() + public function getName() { - return $this->container['label']; + return $this->container['name']; } /** - * Sets label + * Sets name * - * @param string $label The main label for the form field. + * @param string $name The identifier of the field. In combination with the object type ID, it must be unique. * * @return self */ - public function setLabel($label) + public function setName($name) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['label'] = $label; + $this->container['name'] = $name; return $this; } @@ -552,136 +542,146 @@ public function setDescription($description) } /** - * Gets required + * Gets dependent_fields * - * @return bool + * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] */ - public function getRequired() + public function getDependentFields() { - return $this->container['required']; + return $this->container['dependent_fields']; } /** - * Sets required + * Sets dependent_fields * - * @param bool $required Whether a value for this field is required when submitting the form. + * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. * * @return self */ - public function setRequired($required) + public function setDependentFields($dependent_fields) { - if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + if (is_null($dependent_fields)) { + throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); } - $this->container['required'] = $required; + $this->container['dependent_fields'] = $dependent_fields; return $this; } /** - * Gets hidden + * Gets label * - * @return bool + * @return string */ - public function getHidden() + public function getLabel() { - return $this->container['hidden']; + return $this->container['label']; } /** - * Sets hidden + * Sets label * - * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. + * @param string $label The main label for the form field. * * @return self */ - public function setHidden($hidden) + public function setLabel($label) { - if (is_null($hidden)) { - throw new \InvalidArgumentException('non-nullable hidden cannot be null'); + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); } - $this->container['hidden'] = $hidden; + $this->container['label'] = $label; return $this; } /** - * Gets dependent_fields + * Gets placeholder * - * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] + * @return string|null */ - public function getDependentFields() + public function getPlaceholder() { - return $this->container['dependent_fields']; + return $this->container['placeholder']; } /** - * Sets dependent_fields + * Sets placeholder * - * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. + * @param string|null $placeholder The prompt text showing when the field isn't filled in. * * @return self */ - public function setDependentFields($dependent_fields) + public function setPlaceholder($placeholder) { - if (is_null($dependent_fields)) { - throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); + if (is_null($placeholder)) { + throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); } - $this->container['dependent_fields'] = $dependent_fields; + $this->container['placeholder'] = $placeholder; return $this; } /** - * Gets placeholder + * Gets field_type * - * @return string|null + * @return string */ - public function getPlaceholder() + public function getFieldType() { - return $this->container['placeholder']; + return $this->container['field_type']; } /** - * Sets placeholder + * Sets field_type * - * @param string|null $placeholder The prompt text showing when the field isn't filled in. + * @param string $field_type Determines how the field will be displayed and validated. * * @return self */ - public function setPlaceholder($placeholder) + public function setFieldType($field_type) { - if (is_null($placeholder)) { - throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); + if (is_null($field_type)) { + throw new \InvalidArgumentException('non-nullable field_type cannot be null'); } - $this->container['placeholder'] = $placeholder; + $allowedValues = $this->getFieldTypeAllowableValues(); + if (!in_array($field_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'field_type', must be one of '%s'", + $field_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['field_type'] = $field_type; return $this; } /** - * Gets default_value + * Gets required * - * @return string|null + * @return bool */ - public function getDefaultValue() + public function getRequired() { - return $this->container['default_value']; + return $this->container['required']; } /** - * Sets default_value + * Sets required * - * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. + * @param bool $required Whether a value for this field is required when submitting the form. * * @return self */ - public function setDefaultValue($default_value) + public function setRequired($required) { - if (is_null($default_value)) { - throw new \InvalidArgumentException('non-nullable default_value cannot be null'); + if (is_null($required)) { + throw new \InvalidArgumentException('non-nullable required cannot be null'); } - $this->container['default_value'] = $default_value; + $this->container['required'] = $required; return $this; } diff --git a/codegen/Marketing/Forms/Model/ModelInterface.php b/codegen/Marketing/Forms/Model/ModelInterface.php index 8d790308a..7c54c74d9 100644 --- a/codegen/Marketing/Forms/Model/ModelInterface.php +++ b/codegen/Marketing/Forms/Model/ModelInterface.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** diff --git a/codegen/Marketing/Forms/Model/MultiLineTextField.php b/codegen/Marketing/Forms/Model/MultiLineTextField.php index 2e4ee9e9e..92d120197 100644 --- a/codegen/Marketing/Forms/Model/MultiLineTextField.php +++ b/codegen/Marketing/Forms/Model/MultiLineTextField.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -58,16 +58,16 @@ class MultiLineTextField implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'field_type' => 'string', 'object_type_id' => 'string', + 'hidden' => 'bool', + 'default_value' => 'string', 'name' => 'string', - 'label' => 'string', 'description' => 'string', - 'required' => 'bool', - 'hidden' => 'bool', 'dependent_fields' => '\HubSpot\Client\Marketing\Forms\Model\DependentField[]', + 'label' => 'string', 'placeholder' => 'string', - 'default_value' => 'string' + 'field_type' => 'string', + 'required' => 'bool' ]; /** @@ -78,16 +78,16 @@ class MultiLineTextField implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ - 'field_type' => null, 'object_type_id' => null, + 'hidden' => null, + 'default_value' => null, 'name' => null, - 'label' => null, 'description' => null, - 'required' => null, - 'hidden' => null, 'dependent_fields' => null, + 'label' => null, 'placeholder' => null, - 'default_value' => null + 'field_type' => null, + 'required' => null ]; /** @@ -96,16 +96,16 @@ class MultiLineTextField implements ModelInterface, ArrayAccess, \JsonSerializab * @var boolean[] */ protected static array $openAPINullables = [ - 'field_type' => false, 'object_type_id' => false, + 'hidden' => false, + 'default_value' => false, 'name' => false, - 'label' => false, 'description' => false, - 'required' => false, - 'hidden' => false, 'dependent_fields' => false, + 'label' => false, 'placeholder' => false, - 'default_value' => false + 'field_type' => false, + 'required' => false ]; /** @@ -194,16 +194,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'field_type' => 'fieldType', 'object_type_id' => 'objectTypeId', + 'hidden' => 'hidden', + 'default_value' => 'defaultValue', 'name' => 'name', - 'label' => 'label', 'description' => 'description', - 'required' => 'required', - 'hidden' => 'hidden', 'dependent_fields' => 'dependentFields', + 'label' => 'label', 'placeholder' => 'placeholder', - 'default_value' => 'defaultValue' + 'field_type' => 'fieldType', + 'required' => 'required' ]; /** @@ -212,16 +212,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'field_type' => 'setFieldType', 'object_type_id' => 'setObjectTypeId', + 'hidden' => 'setHidden', + 'default_value' => 'setDefaultValue', 'name' => 'setName', - 'label' => 'setLabel', 'description' => 'setDescription', - 'required' => 'setRequired', - 'hidden' => 'setHidden', 'dependent_fields' => 'setDependentFields', + 'label' => 'setLabel', 'placeholder' => 'setPlaceholder', - 'default_value' => 'setDefaultValue' + 'field_type' => 'setFieldType', + 'required' => 'setRequired' ]; /** @@ -230,16 +230,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'field_type' => 'getFieldType', 'object_type_id' => 'getObjectTypeId', + 'hidden' => 'getHidden', + 'default_value' => 'getDefaultValue', 'name' => 'getName', - 'label' => 'getLabel', 'description' => 'getDescription', - 'required' => 'getRequired', - 'hidden' => 'getHidden', 'dependent_fields' => 'getDependentFields', + 'label' => 'getLabel', 'placeholder' => 'getPlaceholder', - 'default_value' => 'getDefaultValue' + 'field_type' => 'getFieldType', + 'required' => 'getRequired' ]; /** @@ -307,21 +307,21 @@ public function getFieldTypeAllowableValues() /** * 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('field_type', $data ?? [], 'multi_line_text'); $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('hidden', $data ?? [], null); + $this->setIfExists('default_value', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('required', $data ?? [], null); - $this->setIfExists('hidden', $data ?? [], null); $this->setIfExists('dependent_fields', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); $this->setIfExists('placeholder', $data ?? [], null); - $this->setIfExists('default_value', $data ?? [], null); + $this->setIfExists('field_type', $data ?? [], 'multi_line_text'); + $this->setIfExists('required', $data ?? [], null); } /** @@ -351,6 +351,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['hidden'] === null) { + $invalidProperties[] = "'hidden' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['dependent_fields'] === null) { + $invalidProperties[] = "'dependent_fields' can't be null"; + } + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } if ($this->container['field_type'] === null) { $invalidProperties[] = "'field_type' can't be null"; } @@ -363,24 +378,9 @@ public function listInvalidProperties() ); } - if ($this->container['object_type_id'] === null) { - $invalidProperties[] = "'object_type_id' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['label'] === null) { - $invalidProperties[] = "'label' can't be null"; - } if ($this->container['required'] === null) { $invalidProperties[] = "'required' can't be null"; } - if ($this->container['hidden'] === null) { - $invalidProperties[] = "'hidden' can't be null"; - } - if ($this->container['dependent_fields'] === null) { - $invalidProperties[] = "'dependent_fields' can't be null"; - } return $invalidProperties; } @@ -397,119 +397,109 @@ public function valid() /** - * Gets field_type + * Gets object_type_id * * @return string */ - public function getFieldType() + public function getObjectTypeId() { - return $this->container['field_type']; + return $this->container['object_type_id']; } /** - * Sets field_type + * Sets object_type_id * - * @param string $field_type Determines how the field will be displayed and validated. + * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. * * @return self */ - public function setFieldType($field_type) + public function setObjectTypeId($object_type_id) { - if (is_null($field_type)) { - throw new \InvalidArgumentException('non-nullable field_type cannot be null'); - } - $allowedValues = $this->getFieldTypeAllowableValues(); - if (!in_array($field_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'field_type', must be one of '%s'", - $field_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); } - $this->container['field_type'] = $field_type; + $this->container['object_type_id'] = $object_type_id; return $this; } /** - * Gets object_type_id + * Gets hidden * - * @return string + * @return bool */ - public function getObjectTypeId() + public function getHidden() { - return $this->container['object_type_id']; + return $this->container['hidden']; } /** - * Sets object_type_id + * Sets hidden * - * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. + * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. * * @return self */ - public function setObjectTypeId($object_type_id) + public function setHidden($hidden) { - if (is_null($object_type_id)) { - throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + if (is_null($hidden)) { + throw new \InvalidArgumentException('non-nullable hidden cannot be null'); } - $this->container['object_type_id'] = $object_type_id; + $this->container['hidden'] = $hidden; return $this; } /** - * Gets name + * Gets default_value * - * @return string + * @return string|null */ - public function getName() + public function getDefaultValue() { - return $this->container['name']; + return $this->container['default_value']; } /** - * Sets name + * Sets default_value * - * @param string $name The identifier of the field. In combination with the object type ID, it must be unique. + * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. * * @return self */ - public function setName($name) + public function setDefaultValue($default_value) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($default_value)) { + throw new \InvalidArgumentException('non-nullable default_value cannot be null'); } - $this->container['name'] = $name; + $this->container['default_value'] = $default_value; return $this; } /** - * Gets label + * Gets name * * @return string */ - public function getLabel() + public function getName() { - return $this->container['label']; + return $this->container['name']; } /** - * Sets label + * Sets name * - * @param string $label The main label for the form field. + * @param string $name The identifier of the field. In combination with the object type ID, it must be unique. * * @return self */ - public function setLabel($label) + public function setName($name) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['label'] = $label; + $this->container['name'] = $name; return $this; } @@ -542,136 +532,146 @@ public function setDescription($description) } /** - * Gets required + * Gets dependent_fields * - * @return bool + * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] */ - public function getRequired() + public function getDependentFields() { - return $this->container['required']; + return $this->container['dependent_fields']; } /** - * Sets required + * Sets dependent_fields * - * @param bool $required Whether a value for this field is required when submitting the form. + * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. * * @return self */ - public function setRequired($required) + public function setDependentFields($dependent_fields) { - if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + if (is_null($dependent_fields)) { + throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); } - $this->container['required'] = $required; + $this->container['dependent_fields'] = $dependent_fields; return $this; } /** - * Gets hidden + * Gets label * - * @return bool + * @return string */ - public function getHidden() + public function getLabel() { - return $this->container['hidden']; + return $this->container['label']; } /** - * Sets hidden + * Sets label * - * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. + * @param string $label The main label for the form field. * * @return self */ - public function setHidden($hidden) + public function setLabel($label) { - if (is_null($hidden)) { - throw new \InvalidArgumentException('non-nullable hidden cannot be null'); + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); } - $this->container['hidden'] = $hidden; + $this->container['label'] = $label; return $this; } /** - * Gets dependent_fields + * Gets placeholder * - * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] + * @return string|null */ - public function getDependentFields() + public function getPlaceholder() { - return $this->container['dependent_fields']; + return $this->container['placeholder']; } /** - * Sets dependent_fields + * Sets placeholder * - * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. + * @param string|null $placeholder The prompt text showing when the field isn't filled in. * * @return self */ - public function setDependentFields($dependent_fields) + public function setPlaceholder($placeholder) { - if (is_null($dependent_fields)) { - throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); + if (is_null($placeholder)) { + throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); } - $this->container['dependent_fields'] = $dependent_fields; + $this->container['placeholder'] = $placeholder; return $this; } /** - * Gets placeholder + * Gets field_type * - * @return string|null + * @return string */ - public function getPlaceholder() + public function getFieldType() { - return $this->container['placeholder']; + return $this->container['field_type']; } /** - * Sets placeholder + * Sets field_type * - * @param string|null $placeholder The prompt text showing when the field isn't filled in. + * @param string $field_type Determines how the field will be displayed and validated. * * @return self */ - public function setPlaceholder($placeholder) + public function setFieldType($field_type) { - if (is_null($placeholder)) { - throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); + if (is_null($field_type)) { + throw new \InvalidArgumentException('non-nullable field_type cannot be null'); } - $this->container['placeholder'] = $placeholder; + $allowedValues = $this->getFieldTypeAllowableValues(); + if (!in_array($field_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'field_type', must be one of '%s'", + $field_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['field_type'] = $field_type; return $this; } /** - * Gets default_value + * Gets required * - * @return string|null + * @return bool */ - public function getDefaultValue() + public function getRequired() { - return $this->container['default_value']; + return $this->container['required']; } /** - * Sets default_value + * Sets required * - * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. + * @param bool $required Whether a value for this field is required when submitting the form. * * @return self */ - public function setDefaultValue($default_value) + public function setRequired($required) { - if (is_null($default_value)) { - throw new \InvalidArgumentException('non-nullable default_value cannot be null'); + if (is_null($required)) { + throw new \InvalidArgumentException('non-nullable required cannot be null'); } - $this->container['default_value'] = $default_value; + $this->container['required'] = $required; return $this; } diff --git a/codegen/Marketing/Forms/Model/MultipleCheckboxesField.php b/codegen/Marketing/Forms/Model/MultipleCheckboxesField.php index b8e4efb03..19bd83c9e 100644 --- a/codegen/Marketing/Forms/Model/MultipleCheckboxesField.php +++ b/codegen/Marketing/Forms/Model/MultipleCheckboxesField.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -58,16 +58,16 @@ class MultipleCheckboxesField implements ModelInterface, ArrayAccess, \JsonSeria * @var string[] */ protected static $openAPITypes = [ - 'field_type' => 'string', 'object_type_id' => 'string', + 'hidden' => 'bool', 'name' => 'string', - 'label' => 'string', + 'options' => '\HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[]', 'description' => 'string', - 'required' => 'bool', - 'hidden' => 'bool', - 'dependent_fields' => '\HubSpot\Client\Marketing\Forms\Model\DependentField[]', 'default_values' => 'string[]', - 'options' => '\HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[]' + 'dependent_fields' => '\HubSpot\Client\Marketing\Forms\Model\DependentField[]', + 'label' => 'string', + 'field_type' => 'string', + 'required' => 'bool' ]; /** @@ -78,16 +78,16 @@ class MultipleCheckboxesField implements ModelInterface, ArrayAccess, \JsonSeria * @psalm-var array */ protected static $openAPIFormats = [ - 'field_type' => null, 'object_type_id' => null, + 'hidden' => null, 'name' => null, - 'label' => null, + 'options' => null, 'description' => null, - 'required' => null, - 'hidden' => null, - 'dependent_fields' => null, 'default_values' => null, - 'options' => null + 'dependent_fields' => null, + 'label' => null, + 'field_type' => null, + 'required' => null ]; /** @@ -96,16 +96,16 @@ class MultipleCheckboxesField implements ModelInterface, ArrayAccess, \JsonSeria * @var boolean[] */ protected static array $openAPINullables = [ - 'field_type' => false, 'object_type_id' => false, + 'hidden' => false, 'name' => false, - 'label' => false, + 'options' => false, 'description' => false, - 'required' => false, - 'hidden' => false, - 'dependent_fields' => false, 'default_values' => false, - 'options' => false + 'dependent_fields' => false, + 'label' => false, + 'field_type' => false, + 'required' => false ]; /** @@ -194,16 +194,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'field_type' => 'fieldType', 'object_type_id' => 'objectTypeId', + 'hidden' => 'hidden', 'name' => 'name', - 'label' => 'label', + 'options' => 'options', 'description' => 'description', - 'required' => 'required', - 'hidden' => 'hidden', - 'dependent_fields' => 'dependentFields', 'default_values' => 'defaultValues', - 'options' => 'options' + 'dependent_fields' => 'dependentFields', + 'label' => 'label', + 'field_type' => 'fieldType', + 'required' => 'required' ]; /** @@ -212,16 +212,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'field_type' => 'setFieldType', 'object_type_id' => 'setObjectTypeId', + 'hidden' => 'setHidden', 'name' => 'setName', - 'label' => 'setLabel', + 'options' => 'setOptions', 'description' => 'setDescription', - 'required' => 'setRequired', - 'hidden' => 'setHidden', - 'dependent_fields' => 'setDependentFields', 'default_values' => 'setDefaultValues', - 'options' => 'setOptions' + 'dependent_fields' => 'setDependentFields', + 'label' => 'setLabel', + 'field_type' => 'setFieldType', + 'required' => 'setRequired' ]; /** @@ -230,16 +230,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'field_type' => 'getFieldType', 'object_type_id' => 'getObjectTypeId', + 'hidden' => 'getHidden', 'name' => 'getName', - 'label' => 'getLabel', + 'options' => 'getOptions', 'description' => 'getDescription', - 'required' => 'getRequired', - 'hidden' => 'getHidden', - 'dependent_fields' => 'getDependentFields', 'default_values' => 'getDefaultValues', - 'options' => 'getOptions' + 'dependent_fields' => 'getDependentFields', + 'label' => 'getLabel', + 'field_type' => 'getFieldType', + 'required' => 'getRequired' ]; /** @@ -307,21 +307,21 @@ public function getFieldTypeAllowableValues() /** * 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('field_type', $data ?? [], 'multiple_checkboxes'); $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('hidden', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); + $this->setIfExists('options', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('required', $data ?? [], null); - $this->setIfExists('hidden', $data ?? [], null); - $this->setIfExists('dependent_fields', $data ?? [], null); $this->setIfExists('default_values', $data ?? [], null); - $this->setIfExists('options', $data ?? [], null); + $this->setIfExists('dependent_fields', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); + $this->setIfExists('field_type', $data ?? [], 'multiple_checkboxes'); + $this->setIfExists('required', $data ?? [], null); } /** @@ -351,6 +351,27 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['hidden'] === null) { + $invalidProperties[] = "'hidden' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['options'] === null) { + $invalidProperties[] = "'options' can't be null"; + } + if ($this->container['default_values'] === null) { + $invalidProperties[] = "'default_values' can't be null"; + } + if ($this->container['dependent_fields'] === null) { + $invalidProperties[] = "'dependent_fields' can't be null"; + } + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } if ($this->container['field_type'] === null) { $invalidProperties[] = "'field_type' can't be null"; } @@ -363,30 +384,9 @@ public function listInvalidProperties() ); } - if ($this->container['object_type_id'] === null) { - $invalidProperties[] = "'object_type_id' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['label'] === null) { - $invalidProperties[] = "'label' can't be null"; - } if ($this->container['required'] === null) { $invalidProperties[] = "'required' can't be null"; } - if ($this->container['hidden'] === null) { - $invalidProperties[] = "'hidden' can't be null"; - } - if ($this->container['dependent_fields'] === null) { - $invalidProperties[] = "'dependent_fields' can't be null"; - } - if ($this->container['default_values'] === null) { - $invalidProperties[] = "'default_values' can't be null"; - } - if ($this->container['options'] === null) { - $invalidProperties[] = "'options' can't be null"; - } return $invalidProperties; } @@ -403,65 +403,55 @@ public function valid() /** - * Gets field_type + * Gets object_type_id * * @return string */ - public function getFieldType() + public function getObjectTypeId() { - return $this->container['field_type']; + return $this->container['object_type_id']; } /** - * Sets field_type + * Sets object_type_id * - * @param string $field_type Determines how the field will be displayed and validated. + * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. * * @return self */ - public function setFieldType($field_type) + public function setObjectTypeId($object_type_id) { - if (is_null($field_type)) { - throw new \InvalidArgumentException('non-nullable field_type cannot be null'); - } - $allowedValues = $this->getFieldTypeAllowableValues(); - if (!in_array($field_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'field_type', must be one of '%s'", - $field_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); } - $this->container['field_type'] = $field_type; + $this->container['object_type_id'] = $object_type_id; return $this; } /** - * Gets object_type_id + * Gets hidden * - * @return string + * @return bool */ - public function getObjectTypeId() + public function getHidden() { - return $this->container['object_type_id']; + return $this->container['hidden']; } /** - * Sets object_type_id + * Sets hidden * - * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. + * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. * * @return self */ - public function setObjectTypeId($object_type_id) + public function setHidden($hidden) { - if (is_null($object_type_id)) { - throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + if (is_null($hidden)) { + throw new \InvalidArgumentException('non-nullable hidden cannot be null'); } - $this->container['object_type_id'] = $object_type_id; + $this->container['hidden'] = $hidden; return $this; } @@ -494,28 +484,28 @@ public function setName($name) } /** - * Gets label + * Gets options * - * @return string + * @return \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] */ - public function getLabel() + public function getOptions() { - return $this->container['label']; + return $this->container['options']; } /** - * Sets label + * Sets options * - * @param string $label The main label for the form field. + * @param \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] $options The list of available choices for this field. * * @return self */ - public function setLabel($label) + public function setOptions($options) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($options)) { + throw new \InvalidArgumentException('non-nullable options cannot be null'); } - $this->container['label'] = $label; + $this->container['options'] = $options; return $this; } @@ -548,136 +538,146 @@ public function setDescription($description) } /** - * Gets required + * Gets default_values * - * @return bool + * @return string[] */ - public function getRequired() + public function getDefaultValues() { - return $this->container['required']; + return $this->container['default_values']; } /** - * Sets required + * Sets default_values * - * @param bool $required Whether a value for this field is required when submitting the form. + * @param string[] $default_values The values selected by default. Those values will be submitted unless the customer modifies them. * * @return self */ - public function setRequired($required) + public function setDefaultValues($default_values) { - if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + if (is_null($default_values)) { + throw new \InvalidArgumentException('non-nullable default_values cannot be null'); } - $this->container['required'] = $required; + $this->container['default_values'] = $default_values; return $this; } /** - * Gets hidden + * Gets dependent_fields * - * @return bool + * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] */ - public function getHidden() + public function getDependentFields() { - return $this->container['hidden']; + return $this->container['dependent_fields']; } /** - * Sets hidden + * Sets dependent_fields * - * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. + * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. * * @return self */ - public function setHidden($hidden) + public function setDependentFields($dependent_fields) { - if (is_null($hidden)) { - throw new \InvalidArgumentException('non-nullable hidden cannot be null'); + if (is_null($dependent_fields)) { + throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); } - $this->container['hidden'] = $hidden; + $this->container['dependent_fields'] = $dependent_fields; return $this; } /** - * Gets dependent_fields + * Gets label * - * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] + * @return string */ - public function getDependentFields() + public function getLabel() { - return $this->container['dependent_fields']; + return $this->container['label']; } /** - * Sets dependent_fields + * Sets label * - * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. + * @param string $label The main label for the form field. * * @return self */ - public function setDependentFields($dependent_fields) + public function setLabel($label) { - if (is_null($dependent_fields)) { - throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); } - $this->container['dependent_fields'] = $dependent_fields; + $this->container['label'] = $label; return $this; } /** - * Gets default_values + * Gets field_type * - * @return string[] + * @return string */ - public function getDefaultValues() + public function getFieldType() { - return $this->container['default_values']; + return $this->container['field_type']; } /** - * Sets default_values + * Sets field_type * - * @param string[] $default_values The values selected by default. Those values will be submitted unless the customer modifies them. + * @param string $field_type Determines how the field will be displayed and validated. * * @return self */ - public function setDefaultValues($default_values) + public function setFieldType($field_type) { - if (is_null($default_values)) { - throw new \InvalidArgumentException('non-nullable default_values cannot be null'); + if (is_null($field_type)) { + throw new \InvalidArgumentException('non-nullable field_type cannot be null'); } - $this->container['default_values'] = $default_values; + $allowedValues = $this->getFieldTypeAllowableValues(); + if (!in_array($field_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'field_type', must be one of '%s'", + $field_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['field_type'] = $field_type; return $this; } /** - * Gets options + * Gets required * - * @return \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] + * @return bool */ - public function getOptions() + public function getRequired() { - return $this->container['options']; + return $this->container['required']; } /** - * Sets options + * Sets required * - * @param \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] $options The list of available choices for this field. + * @param bool $required Whether a value for this field is required when submitting the form. * * @return self */ - public function setOptions($options) + public function setRequired($required) { - if (is_null($options)) { - throw new \InvalidArgumentException('non-nullable options cannot be null'); + if (is_null($required)) { + throw new \InvalidArgumentException('non-nullable required cannot be null'); } - $this->container['options'] = $options; + $this->container['required'] = $required; return $this; } diff --git a/codegen/Marketing/Forms/Model/NextPage.php b/codegen/Marketing/Forms/Model/NextPage.php index 4f28556ad..ff3345ce6 100644 --- a/codegen/Marketing/Forms/Model/NextPage.php +++ b/codegen/Marketing/Forms/Model/NextPage.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -245,10 +245,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('link', $data ?? [], null); $this->setIfExists('after', $data ?? [], null); diff --git a/codegen/Marketing/Forms/Model/NumberField.php b/codegen/Marketing/Forms/Model/NumberField.php index 447e93bf2..568ccf21d 100644 --- a/codegen/Marketing/Forms/Model/NumberField.php +++ b/codegen/Marketing/Forms/Model/NumberField.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -58,16 +58,16 @@ class NumberField implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'field_type' => 'string', 'object_type_id' => 'string', + 'hidden' => 'bool', + 'default_value' => 'string', 'name' => 'string', - 'label' => 'string', 'description' => 'string', - 'required' => 'bool', - 'hidden' => 'bool', 'dependent_fields' => '\HubSpot\Client\Marketing\Forms\Model\DependentField[]', + 'label' => 'string', 'placeholder' => 'string', - 'default_value' => 'string', + 'field_type' => 'string', + 'required' => 'bool', 'validation' => '\HubSpot\Client\Marketing\Forms\Model\NumberFieldValidation' ]; @@ -79,16 +79,16 @@ class NumberField implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'field_type' => null, 'object_type_id' => null, + 'hidden' => null, + 'default_value' => null, 'name' => null, - 'label' => null, 'description' => null, - 'required' => null, - 'hidden' => null, 'dependent_fields' => null, + 'label' => null, 'placeholder' => null, - 'default_value' => null, + 'field_type' => null, + 'required' => null, 'validation' => null ]; @@ -98,16 +98,16 @@ class NumberField implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'field_type' => false, 'object_type_id' => false, + 'hidden' => false, + 'default_value' => false, 'name' => false, - 'label' => false, 'description' => false, - 'required' => false, - 'hidden' => false, 'dependent_fields' => false, + 'label' => false, 'placeholder' => false, - 'default_value' => false, + 'field_type' => false, + 'required' => false, 'validation' => false ]; @@ -197,16 +197,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'field_type' => 'fieldType', 'object_type_id' => 'objectTypeId', + 'hidden' => 'hidden', + 'default_value' => 'defaultValue', 'name' => 'name', - 'label' => 'label', 'description' => 'description', - 'required' => 'required', - 'hidden' => 'hidden', 'dependent_fields' => 'dependentFields', + 'label' => 'label', 'placeholder' => 'placeholder', - 'default_value' => 'defaultValue', + 'field_type' => 'fieldType', + 'required' => 'required', 'validation' => 'validation' ]; @@ -216,16 +216,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'field_type' => 'setFieldType', 'object_type_id' => 'setObjectTypeId', + 'hidden' => 'setHidden', + 'default_value' => 'setDefaultValue', 'name' => 'setName', - 'label' => 'setLabel', 'description' => 'setDescription', - 'required' => 'setRequired', - 'hidden' => 'setHidden', 'dependent_fields' => 'setDependentFields', + 'label' => 'setLabel', 'placeholder' => 'setPlaceholder', - 'default_value' => 'setDefaultValue', + 'field_type' => 'setFieldType', + 'required' => 'setRequired', 'validation' => 'setValidation' ]; @@ -235,16 +235,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'field_type' => 'getFieldType', 'object_type_id' => 'getObjectTypeId', + 'hidden' => 'getHidden', + 'default_value' => 'getDefaultValue', 'name' => 'getName', - 'label' => 'getLabel', 'description' => 'getDescription', - 'required' => 'getRequired', - 'hidden' => 'getHidden', 'dependent_fields' => 'getDependentFields', + 'label' => 'getLabel', 'placeholder' => 'getPlaceholder', - 'default_value' => 'getDefaultValue', + 'field_type' => 'getFieldType', + 'required' => 'getRequired', 'validation' => 'getValidation' ]; @@ -313,21 +313,21 @@ public function getFieldTypeAllowableValues() /** * 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('field_type', $data ?? [], 'number'); $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('hidden', $data ?? [], null); + $this->setIfExists('default_value', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('required', $data ?? [], null); - $this->setIfExists('hidden', $data ?? [], null); $this->setIfExists('dependent_fields', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); $this->setIfExists('placeholder', $data ?? [], null); - $this->setIfExists('default_value', $data ?? [], null); + $this->setIfExists('field_type', $data ?? [], 'number'); + $this->setIfExists('required', $data ?? [], null); $this->setIfExists('validation', $data ?? [], null); } @@ -358,6 +358,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['hidden'] === null) { + $invalidProperties[] = "'hidden' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['dependent_fields'] === null) { + $invalidProperties[] = "'dependent_fields' can't be null"; + } + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } if ($this->container['field_type'] === null) { $invalidProperties[] = "'field_type' can't be null"; } @@ -370,24 +385,9 @@ public function listInvalidProperties() ); } - if ($this->container['object_type_id'] === null) { - $invalidProperties[] = "'object_type_id' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['label'] === null) { - $invalidProperties[] = "'label' can't be null"; - } if ($this->container['required'] === null) { $invalidProperties[] = "'required' can't be null"; } - if ($this->container['hidden'] === null) { - $invalidProperties[] = "'hidden' can't be null"; - } - if ($this->container['dependent_fields'] === null) { - $invalidProperties[] = "'dependent_fields' can't be null"; - } return $invalidProperties; } @@ -404,119 +404,109 @@ public function valid() /** - * Gets field_type + * Gets object_type_id * * @return string */ - public function getFieldType() + public function getObjectTypeId() { - return $this->container['field_type']; + return $this->container['object_type_id']; } /** - * Sets field_type + * Sets object_type_id * - * @param string $field_type Determines how the field will be displayed and validated. + * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. * * @return self */ - public function setFieldType($field_type) + public function setObjectTypeId($object_type_id) { - if (is_null($field_type)) { - throw new \InvalidArgumentException('non-nullable field_type cannot be null'); - } - $allowedValues = $this->getFieldTypeAllowableValues(); - if (!in_array($field_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'field_type', must be one of '%s'", - $field_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); } - $this->container['field_type'] = $field_type; + $this->container['object_type_id'] = $object_type_id; return $this; } /** - * Gets object_type_id + * Gets hidden * - * @return string + * @return bool */ - public function getObjectTypeId() + public function getHidden() { - return $this->container['object_type_id']; + return $this->container['hidden']; } /** - * Sets object_type_id + * Sets hidden * - * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. + * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. * * @return self */ - public function setObjectTypeId($object_type_id) + public function setHidden($hidden) { - if (is_null($object_type_id)) { - throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + if (is_null($hidden)) { + throw new \InvalidArgumentException('non-nullable hidden cannot be null'); } - $this->container['object_type_id'] = $object_type_id; + $this->container['hidden'] = $hidden; return $this; } /** - * Gets name + * Gets default_value * - * @return string + * @return string|null */ - public function getName() + public function getDefaultValue() { - return $this->container['name']; + return $this->container['default_value']; } /** - * Sets name + * Sets default_value * - * @param string $name The identifier of the field. In combination with the object type ID, it must be unique. + * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. * * @return self */ - public function setName($name) + public function setDefaultValue($default_value) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($default_value)) { + throw new \InvalidArgumentException('non-nullable default_value cannot be null'); } - $this->container['name'] = $name; + $this->container['default_value'] = $default_value; return $this; } /** - * Gets label + * Gets name * * @return string */ - public function getLabel() + public function getName() { - return $this->container['label']; + return $this->container['name']; } /** - * Sets label + * Sets name * - * @param string $label The main label for the form field. + * @param string $name The identifier of the field. In combination with the object type ID, it must be unique. * * @return self */ - public function setLabel($label) + public function setName($name) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['label'] = $label; + $this->container['name'] = $name; return $this; } @@ -549,136 +539,146 @@ public function setDescription($description) } /** - * Gets required + * Gets dependent_fields * - * @return bool + * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] */ - public function getRequired() + public function getDependentFields() { - return $this->container['required']; + return $this->container['dependent_fields']; } /** - * Sets required + * Sets dependent_fields * - * @param bool $required Whether a value for this field is required when submitting the form. + * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. * * @return self */ - public function setRequired($required) + public function setDependentFields($dependent_fields) { - if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + if (is_null($dependent_fields)) { + throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); } - $this->container['required'] = $required; + $this->container['dependent_fields'] = $dependent_fields; return $this; } /** - * Gets hidden + * Gets label * - * @return bool + * @return string */ - public function getHidden() + public function getLabel() { - return $this->container['hidden']; + return $this->container['label']; } /** - * Sets hidden + * Sets label * - * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. + * @param string $label The main label for the form field. * * @return self */ - public function setHidden($hidden) + public function setLabel($label) { - if (is_null($hidden)) { - throw new \InvalidArgumentException('non-nullable hidden cannot be null'); + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); } - $this->container['hidden'] = $hidden; + $this->container['label'] = $label; return $this; } /** - * Gets dependent_fields + * Gets placeholder * - * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] + * @return string|null */ - public function getDependentFields() + public function getPlaceholder() { - return $this->container['dependent_fields']; + return $this->container['placeholder']; } /** - * Sets dependent_fields + * Sets placeholder * - * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. + * @param string|null $placeholder The prompt text showing when the field isn't filled in. * * @return self */ - public function setDependentFields($dependent_fields) + public function setPlaceholder($placeholder) { - if (is_null($dependent_fields)) { - throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); + if (is_null($placeholder)) { + throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); } - $this->container['dependent_fields'] = $dependent_fields; + $this->container['placeholder'] = $placeholder; return $this; } /** - * Gets placeholder + * Gets field_type * - * @return string|null + * @return string */ - public function getPlaceholder() + public function getFieldType() { - return $this->container['placeholder']; + return $this->container['field_type']; } /** - * Sets placeholder + * Sets field_type * - * @param string|null $placeholder The prompt text showing when the field isn't filled in. + * @param string $field_type Determines how the field will be displayed and validated. * * @return self */ - public function setPlaceholder($placeholder) + public function setFieldType($field_type) { - if (is_null($placeholder)) { - throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); + if (is_null($field_type)) { + throw new \InvalidArgumentException('non-nullable field_type cannot be null'); } - $this->container['placeholder'] = $placeholder; + $allowedValues = $this->getFieldTypeAllowableValues(); + if (!in_array($field_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'field_type', must be one of '%s'", + $field_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['field_type'] = $field_type; return $this; } /** - * Gets default_value + * Gets required * - * @return string|null + * @return bool */ - public function getDefaultValue() + public function getRequired() { - return $this->container['default_value']; + return $this->container['required']; } /** - * Sets default_value + * Sets required * - * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. + * @param bool $required Whether a value for this field is required when submitting the form. * * @return self */ - public function setDefaultValue($default_value) + public function setRequired($required) { - if (is_null($default_value)) { - throw new \InvalidArgumentException('non-nullable default_value cannot be null'); + if (is_null($required)) { + throw new \InvalidArgumentException('non-nullable required cannot be null'); } - $this->container['default_value'] = $default_value; + $this->container['required'] = $required; return $this; } diff --git a/codegen/Marketing/Forms/Model/NumberFieldValidation.php b/codegen/Marketing/Forms/Model/NumberFieldValidation.php index 4c0a98e6f..842a1f46e 100644 --- a/codegen/Marketing/Forms/Model/NumberFieldValidation.php +++ b/codegen/Marketing/Forms/Model/NumberFieldValidation.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -246,10 +246,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('min_allowed_digits', $data ?? [], null); $this->setIfExists('max_allowed_digits', $data ?? [], null); @@ -316,7 +316,7 @@ public function getMinAllowedDigits() /** * Sets min_allowed_digits * - * @param int $min_allowed_digits min_allowed_digits + * @param int $min_allowed_digits * * @return self */ @@ -343,7 +343,7 @@ public function getMaxAllowedDigits() /** * Sets max_allowed_digits * - * @param int $max_allowed_digits max_allowed_digits + * @param int $max_allowed_digits * * @return self */ diff --git a/codegen/Marketing/Forms/Model/PaymentLinkRadioField.php b/codegen/Marketing/Forms/Model/PaymentLinkRadioField.php index c6d4bd5a5..7aae3b06a 100644 --- a/codegen/Marketing/Forms/Model/PaymentLinkRadioField.php +++ b/codegen/Marketing/Forms/Model/PaymentLinkRadioField.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -57,16 +57,16 @@ class PaymentLinkRadioField implements ModelInterface, ArrayAccess, \JsonSeriali * @var string[] */ protected static $openAPITypes = [ - 'field_type' => 'string', 'object_type_id' => 'string', + 'hidden' => 'bool', 'name' => 'string', - 'label' => 'string', + 'options' => '\HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[]', 'description' => 'string', - 'required' => 'bool', - 'hidden' => 'bool', - 'dependent_fields' => '\HubSpot\Client\Marketing\Forms\Model\DependentField[]', 'default_values' => 'string[]', - 'options' => '\HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[]' + 'dependent_fields' => '\HubSpot\Client\Marketing\Forms\Model\DependentField[]', + 'label' => 'string', + 'field_type' => 'string', + 'required' => 'bool' ]; /** @@ -77,16 +77,16 @@ class PaymentLinkRadioField implements ModelInterface, ArrayAccess, \JsonSeriali * @psalm-var array */ protected static $openAPIFormats = [ - 'field_type' => null, 'object_type_id' => null, + 'hidden' => null, 'name' => null, - 'label' => null, + 'options' => null, 'description' => null, - 'required' => null, - 'hidden' => null, - 'dependent_fields' => null, 'default_values' => null, - 'options' => null + 'dependent_fields' => null, + 'label' => null, + 'field_type' => null, + 'required' => null ]; /** @@ -95,16 +95,16 @@ class PaymentLinkRadioField implements ModelInterface, ArrayAccess, \JsonSeriali * @var boolean[] */ protected static array $openAPINullables = [ - 'field_type' => false, 'object_type_id' => false, + 'hidden' => false, 'name' => false, - 'label' => false, + 'options' => false, 'description' => false, - 'required' => false, - 'hidden' => false, - 'dependent_fields' => false, 'default_values' => false, - 'options' => false + 'dependent_fields' => false, + 'label' => false, + 'field_type' => false, + 'required' => false ]; /** @@ -193,16 +193,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'field_type' => 'fieldType', 'object_type_id' => 'objectTypeId', + 'hidden' => 'hidden', 'name' => 'name', - 'label' => 'label', + 'options' => 'options', 'description' => 'description', - 'required' => 'required', - 'hidden' => 'hidden', - 'dependent_fields' => 'dependentFields', 'default_values' => 'defaultValues', - 'options' => 'options' + 'dependent_fields' => 'dependentFields', + 'label' => 'label', + 'field_type' => 'fieldType', + 'required' => 'required' ]; /** @@ -211,16 +211,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'field_type' => 'setFieldType', 'object_type_id' => 'setObjectTypeId', + 'hidden' => 'setHidden', 'name' => 'setName', - 'label' => 'setLabel', + 'options' => 'setOptions', 'description' => 'setDescription', - 'required' => 'setRequired', - 'hidden' => 'setHidden', - 'dependent_fields' => 'setDependentFields', 'default_values' => 'setDefaultValues', - 'options' => 'setOptions' + 'dependent_fields' => 'setDependentFields', + 'label' => 'setLabel', + 'field_type' => 'setFieldType', + 'required' => 'setRequired' ]; /** @@ -229,16 +229,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'field_type' => 'getFieldType', 'object_type_id' => 'getObjectTypeId', + 'hidden' => 'getHidden', 'name' => 'getName', - 'label' => 'getLabel', + 'options' => 'getOptions', 'description' => 'getDescription', - 'required' => 'getRequired', - 'hidden' => 'getHidden', - 'dependent_fields' => 'getDependentFields', 'default_values' => 'getDefaultValues', - 'options' => 'getOptions' + 'dependent_fields' => 'getDependentFields', + 'label' => 'getLabel', + 'field_type' => 'getFieldType', + 'required' => 'getRequired' ]; /** @@ -306,21 +306,21 @@ public function getFieldTypeAllowableValues() /** * 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('field_type', $data ?? [], 'payment_link_radio'); $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('hidden', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); + $this->setIfExists('options', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('required', $data ?? [], null); - $this->setIfExists('hidden', $data ?? [], null); - $this->setIfExists('dependent_fields', $data ?? [], null); $this->setIfExists('default_values', $data ?? [], null); - $this->setIfExists('options', $data ?? [], null); + $this->setIfExists('dependent_fields', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); + $this->setIfExists('field_type', $data ?? [], 'payment_link_radio'); + $this->setIfExists('required', $data ?? [], null); } /** @@ -350,6 +350,27 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['hidden'] === null) { + $invalidProperties[] = "'hidden' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['options'] === null) { + $invalidProperties[] = "'options' can't be null"; + } + if ($this->container['default_values'] === null) { + $invalidProperties[] = "'default_values' can't be null"; + } + if ($this->container['dependent_fields'] === null) { + $invalidProperties[] = "'dependent_fields' can't be null"; + } + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } if ($this->container['field_type'] === null) { $invalidProperties[] = "'field_type' can't be null"; } @@ -362,30 +383,9 @@ public function listInvalidProperties() ); } - if ($this->container['object_type_id'] === null) { - $invalidProperties[] = "'object_type_id' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['label'] === null) { - $invalidProperties[] = "'label' can't be null"; - } if ($this->container['required'] === null) { $invalidProperties[] = "'required' can't be null"; } - if ($this->container['hidden'] === null) { - $invalidProperties[] = "'hidden' can't be null"; - } - if ($this->container['dependent_fields'] === null) { - $invalidProperties[] = "'dependent_fields' can't be null"; - } - if ($this->container['default_values'] === null) { - $invalidProperties[] = "'default_values' can't be null"; - } - if ($this->container['options'] === null) { - $invalidProperties[] = "'options' can't be null"; - } return $invalidProperties; } @@ -402,65 +402,55 @@ public function valid() /** - * Gets field_type + * Gets object_type_id * * @return string */ - public function getFieldType() + public function getObjectTypeId() { - return $this->container['field_type']; + return $this->container['object_type_id']; } /** - * Sets field_type + * Sets object_type_id * - * @param string $field_type field_type + * @param string $object_type_id object_type_id * * @return self */ - public function setFieldType($field_type) + public function setObjectTypeId($object_type_id) { - if (is_null($field_type)) { - throw new \InvalidArgumentException('non-nullable field_type cannot be null'); - } - $allowedValues = $this->getFieldTypeAllowableValues(); - if (!in_array($field_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'field_type', must be one of '%s'", - $field_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); } - $this->container['field_type'] = $field_type; + $this->container['object_type_id'] = $object_type_id; return $this; } /** - * Gets object_type_id + * Gets hidden * - * @return string + * @return bool */ - public function getObjectTypeId() + public function getHidden() { - return $this->container['object_type_id']; + return $this->container['hidden']; } /** - * Sets object_type_id + * Sets hidden * - * @param string $object_type_id object_type_id + * @param bool $hidden hidden * * @return self */ - public function setObjectTypeId($object_type_id) + public function setHidden($hidden) { - if (is_null($object_type_id)) { - throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + if (is_null($hidden)) { + throw new \InvalidArgumentException('non-nullable hidden cannot be null'); } - $this->container['object_type_id'] = $object_type_id; + $this->container['hidden'] = $hidden; return $this; } @@ -493,28 +483,28 @@ public function setName($name) } /** - * Gets label + * Gets options * - * @return string + * @return \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] */ - public function getLabel() + public function getOptions() { - return $this->container['label']; + return $this->container['options']; } /** - * Sets label + * Sets options * - * @param string $label label + * @param \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] $options options * * @return self */ - public function setLabel($label) + public function setOptions($options) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($options)) { + throw new \InvalidArgumentException('non-nullable options cannot be null'); } - $this->container['label'] = $label; + $this->container['options'] = $options; return $this; } @@ -547,136 +537,146 @@ public function setDescription($description) } /** - * Gets required + * Gets default_values * - * @return bool + * @return string[] */ - public function getRequired() + public function getDefaultValues() { - return $this->container['required']; + return $this->container['default_values']; } /** - * Sets required + * Sets default_values * - * @param bool $required required + * @param string[] $default_values default_values * * @return self */ - public function setRequired($required) + public function setDefaultValues($default_values) { - if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + if (is_null($default_values)) { + throw new \InvalidArgumentException('non-nullable default_values cannot be null'); } - $this->container['required'] = $required; + $this->container['default_values'] = $default_values; return $this; } /** - * Gets hidden + * Gets dependent_fields * - * @return bool + * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] */ - public function getHidden() + public function getDependentFields() { - return $this->container['hidden']; + return $this->container['dependent_fields']; } /** - * Sets hidden + * Sets dependent_fields * - * @param bool $hidden hidden + * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields dependent_fields * * @return self */ - public function setHidden($hidden) + public function setDependentFields($dependent_fields) { - if (is_null($hidden)) { - throw new \InvalidArgumentException('non-nullable hidden cannot be null'); + if (is_null($dependent_fields)) { + throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); } - $this->container['hidden'] = $hidden; + $this->container['dependent_fields'] = $dependent_fields; return $this; } /** - * Gets dependent_fields + * Gets label * - * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] + * @return string */ - public function getDependentFields() + public function getLabel() { - return $this->container['dependent_fields']; + return $this->container['label']; } /** - * Sets dependent_fields + * Sets label * - * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields dependent_fields + * @param string $label label * * @return self */ - public function setDependentFields($dependent_fields) + public function setLabel($label) { - if (is_null($dependent_fields)) { - throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); } - $this->container['dependent_fields'] = $dependent_fields; + $this->container['label'] = $label; return $this; } /** - * Gets default_values + * Gets field_type * - * @return string[] + * @return string */ - public function getDefaultValues() + public function getFieldType() { - return $this->container['default_values']; + return $this->container['field_type']; } /** - * Sets default_values + * Sets field_type * - * @param string[] $default_values default_values + * @param string $field_type field_type * * @return self */ - public function setDefaultValues($default_values) + public function setFieldType($field_type) { - if (is_null($default_values)) { - throw new \InvalidArgumentException('non-nullable default_values cannot be null'); + if (is_null($field_type)) { + throw new \InvalidArgumentException('non-nullable field_type cannot be null'); } - $this->container['default_values'] = $default_values; + $allowedValues = $this->getFieldTypeAllowableValues(); + if (!in_array($field_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'field_type', must be one of '%s'", + $field_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['field_type'] = $field_type; return $this; } /** - * Gets options + * Gets required * - * @return \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] + * @return bool */ - public function getOptions() + public function getRequired() { - return $this->container['options']; + return $this->container['required']; } /** - * Sets options + * Sets required * - * @param \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] $options options + * @param bool $required required * * @return self */ - public function setOptions($options) + public function setRequired($required) { - if (is_null($options)) { - throw new \InvalidArgumentException('non-nullable options cannot be null'); + if (is_null($required)) { + throw new \InvalidArgumentException('non-nullable required cannot be null'); } - $this->container['options'] = $options; + $this->container['required'] = $required; return $this; } diff --git a/codegen/Marketing/Forms/Model/PhoneField.php b/codegen/Marketing/Forms/Model/PhoneField.php index 704d86dcf..9be9a24f0 100644 --- a/codegen/Marketing/Forms/Model/PhoneField.php +++ b/codegen/Marketing/Forms/Model/PhoneField.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -58,17 +58,17 @@ class PhoneField implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'field_type' => 'string', 'object_type_id' => 'string', + 'hidden' => 'bool', + 'default_value' => 'string', + 'use_country_code_select' => 'bool', 'name' => 'string', - 'label' => 'string', 'description' => 'string', - 'required' => 'bool', - 'hidden' => 'bool', 'dependent_fields' => '\HubSpot\Client\Marketing\Forms\Model\DependentField[]', + 'label' => 'string', 'placeholder' => 'string', - 'default_value' => 'string', - 'use_country_code_select' => 'bool', + 'field_type' => 'string', + 'required' => 'bool', 'validation' => '\HubSpot\Client\Marketing\Forms\Model\PhoneFieldValidation' ]; @@ -80,17 +80,17 @@ class PhoneField implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'field_type' => null, 'object_type_id' => null, + 'hidden' => null, + 'default_value' => null, + 'use_country_code_select' => null, 'name' => null, - 'label' => null, 'description' => null, - 'required' => null, - 'hidden' => null, 'dependent_fields' => null, + 'label' => null, 'placeholder' => null, - 'default_value' => null, - 'use_country_code_select' => null, + 'field_type' => null, + 'required' => null, 'validation' => null ]; @@ -100,17 +100,17 @@ class PhoneField implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'field_type' => false, 'object_type_id' => false, + 'hidden' => false, + 'default_value' => false, + 'use_country_code_select' => false, 'name' => false, - 'label' => false, 'description' => false, - 'required' => false, - 'hidden' => false, 'dependent_fields' => false, + 'label' => false, 'placeholder' => false, - 'default_value' => false, - 'use_country_code_select' => false, + 'field_type' => false, + 'required' => false, 'validation' => false ]; @@ -200,17 +200,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'field_type' => 'fieldType', 'object_type_id' => 'objectTypeId', + 'hidden' => 'hidden', + 'default_value' => 'defaultValue', + 'use_country_code_select' => 'useCountryCodeSelect', 'name' => 'name', - 'label' => 'label', 'description' => 'description', - 'required' => 'required', - 'hidden' => 'hidden', 'dependent_fields' => 'dependentFields', + 'label' => 'label', 'placeholder' => 'placeholder', - 'default_value' => 'defaultValue', - 'use_country_code_select' => 'useCountryCodeSelect', + 'field_type' => 'fieldType', + 'required' => 'required', 'validation' => 'validation' ]; @@ -220,17 +220,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'field_type' => 'setFieldType', 'object_type_id' => 'setObjectTypeId', + 'hidden' => 'setHidden', + 'default_value' => 'setDefaultValue', + 'use_country_code_select' => 'setUseCountryCodeSelect', 'name' => 'setName', - 'label' => 'setLabel', 'description' => 'setDescription', - 'required' => 'setRequired', - 'hidden' => 'setHidden', 'dependent_fields' => 'setDependentFields', + 'label' => 'setLabel', 'placeholder' => 'setPlaceholder', - 'default_value' => 'setDefaultValue', - 'use_country_code_select' => 'setUseCountryCodeSelect', + 'field_type' => 'setFieldType', + 'required' => 'setRequired', 'validation' => 'setValidation' ]; @@ -240,17 +240,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'field_type' => 'getFieldType', 'object_type_id' => 'getObjectTypeId', + 'hidden' => 'getHidden', + 'default_value' => 'getDefaultValue', + 'use_country_code_select' => 'getUseCountryCodeSelect', 'name' => 'getName', - 'label' => 'getLabel', 'description' => 'getDescription', - 'required' => 'getRequired', - 'hidden' => 'getHidden', 'dependent_fields' => 'getDependentFields', + 'label' => 'getLabel', 'placeholder' => 'getPlaceholder', - 'default_value' => 'getDefaultValue', - 'use_country_code_select' => 'getUseCountryCodeSelect', + 'field_type' => 'getFieldType', + 'required' => 'getRequired', 'validation' => 'getValidation' ]; @@ -319,22 +319,22 @@ public function getFieldTypeAllowableValues() /** * 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('field_type', $data ?? [], 'phone'); $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('hidden', $data ?? [], null); + $this->setIfExists('default_value', $data ?? [], null); + $this->setIfExists('use_country_code_select', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('required', $data ?? [], null); - $this->setIfExists('hidden', $data ?? [], null); $this->setIfExists('dependent_fields', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); $this->setIfExists('placeholder', $data ?? [], null); - $this->setIfExists('default_value', $data ?? [], null); - $this->setIfExists('use_country_code_select', $data ?? [], null); + $this->setIfExists('field_type', $data ?? [], 'phone'); + $this->setIfExists('required', $data ?? [], null); $this->setIfExists('validation', $data ?? [], null); } @@ -365,6 +365,24 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['hidden'] === null) { + $invalidProperties[] = "'hidden' can't be null"; + } + if ($this->container['use_country_code_select'] === null) { + $invalidProperties[] = "'use_country_code_select' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['dependent_fields'] === null) { + $invalidProperties[] = "'dependent_fields' can't be null"; + } + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } if ($this->container['field_type'] === null) { $invalidProperties[] = "'field_type' can't be null"; } @@ -377,27 +395,9 @@ public function listInvalidProperties() ); } - if ($this->container['object_type_id'] === null) { - $invalidProperties[] = "'object_type_id' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['label'] === null) { - $invalidProperties[] = "'label' can't be null"; - } if ($this->container['required'] === null) { $invalidProperties[] = "'required' can't be null"; } - if ($this->container['hidden'] === null) { - $invalidProperties[] = "'hidden' can't be null"; - } - if ($this->container['dependent_fields'] === null) { - $invalidProperties[] = "'dependent_fields' can't be null"; - } - if ($this->container['use_country_code_select'] === null) { - $invalidProperties[] = "'use_country_code_select' can't be null"; - } if ($this->container['validation'] === null) { $invalidProperties[] = "'validation' can't be null"; } @@ -416,43 +416,6 @@ public function valid() } - /** - * Gets field_type - * - * @return string - */ - public function getFieldType() - { - return $this->container['field_type']; - } - - /** - * Sets field_type - * - * @param string $field_type Determines how the field will be displayed and validated. - * - * @return self - */ - public function setFieldType($field_type) - { - if (is_null($field_type)) { - throw new \InvalidArgumentException('non-nullable field_type cannot be null'); - } - $allowedValues = $this->getFieldTypeAllowableValues(); - if (!in_array($field_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'field_type', must be one of '%s'", - $field_type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['field_type'] = $field_type; - - return $this; - } - /** * Gets object_type_id * @@ -481,136 +444,136 @@ public function setObjectTypeId($object_type_id) } /** - * Gets name + * Gets hidden * - * @return string + * @return bool */ - public function getName() + public function getHidden() { - return $this->container['name']; + return $this->container['hidden']; } /** - * Sets name + * Sets hidden * - * @param string $name The identifier of the field. In combination with the object type ID, it must be unique. + * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. * * @return self */ - public function setName($name) + public function setHidden($hidden) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($hidden)) { + throw new \InvalidArgumentException('non-nullable hidden cannot be null'); } - $this->container['name'] = $name; + $this->container['hidden'] = $hidden; return $this; } /** - * Gets label + * Gets default_value * - * @return string + * @return string|null */ - public function getLabel() + public function getDefaultValue() { - return $this->container['label']; + return $this->container['default_value']; } /** - * Sets label + * Sets default_value * - * @param string $label The main label for the form field. + * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. * * @return self */ - public function setLabel($label) + public function setDefaultValue($default_value) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($default_value)) { + throw new \InvalidArgumentException('non-nullable default_value cannot be null'); } - $this->container['label'] = $label; + $this->container['default_value'] = $default_value; return $this; } /** - * Gets description + * Gets use_country_code_select * - * @return string|null + * @return bool */ - public function getDescription() + public function getUseCountryCodeSelect() { - return $this->container['description']; + return $this->container['use_country_code_select']; } /** - * Sets description + * Sets use_country_code_select * - * @param string|null $description Additional text helping the customer to complete the field. + * @param bool $use_country_code_select Whether to display a country code drop down next to the phone field. * * @return self */ - public function setDescription($description) + public function setUseCountryCodeSelect($use_country_code_select) { - if (is_null($description)) { - throw new \InvalidArgumentException('non-nullable description cannot be null'); + if (is_null($use_country_code_select)) { + throw new \InvalidArgumentException('non-nullable use_country_code_select cannot be null'); } - $this->container['description'] = $description; + $this->container['use_country_code_select'] = $use_country_code_select; return $this; } /** - * Gets required + * Gets name * - * @return bool + * @return string */ - public function getRequired() + public function getName() { - return $this->container['required']; + return $this->container['name']; } /** - * Sets required + * Sets name * - * @param bool $required Whether a value for this field is required when submitting the form. + * @param string $name The identifier of the field. In combination with the object type ID, it must be unique. * * @return self */ - public function setRequired($required) + public function setName($name) { - if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['required'] = $required; + $this->container['name'] = $name; return $this; } /** - * Gets hidden + * Gets description * - * @return bool + * @return string|null */ - public function getHidden() + public function getDescription() { - return $this->container['hidden']; + return $this->container['description']; } /** - * Sets hidden + * Sets description * - * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. + * @param string|null $description Additional text helping the customer to complete the field. * * @return self */ - public function setHidden($hidden) + public function setDescription($description) { - if (is_null($hidden)) { - throw new \InvalidArgumentException('non-nullable hidden cannot be null'); + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); } - $this->container['hidden'] = $hidden; + $this->container['description'] = $description; return $this; } @@ -642,6 +605,33 @@ public function setDependentFields($dependent_fields) return $this; } + /** + * Gets label + * + * @return string + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string $label The main label for the form field. + * + * @return self + */ + public function setLabel($label) + { + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); + } + $this->container['label'] = $label; + + return $this; + } + /** * Gets placeholder * @@ -670,55 +660,65 @@ public function setPlaceholder($placeholder) } /** - * Gets default_value + * Gets field_type * - * @return string|null + * @return string */ - public function getDefaultValue() + public function getFieldType() { - return $this->container['default_value']; + return $this->container['field_type']; } /** - * Sets default_value + * Sets field_type * - * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. + * @param string $field_type Determines how the field will be displayed and validated. * * @return self */ - public function setDefaultValue($default_value) + public function setFieldType($field_type) { - if (is_null($default_value)) { - throw new \InvalidArgumentException('non-nullable default_value cannot be null'); + if (is_null($field_type)) { + throw new \InvalidArgumentException('non-nullable field_type cannot be null'); } - $this->container['default_value'] = $default_value; + $allowedValues = $this->getFieldTypeAllowableValues(); + if (!in_array($field_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'field_type', must be one of '%s'", + $field_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['field_type'] = $field_type; return $this; } /** - * Gets use_country_code_select + * Gets required * * @return bool */ - public function getUseCountryCodeSelect() + public function getRequired() { - return $this->container['use_country_code_select']; + return $this->container['required']; } /** - * Sets use_country_code_select + * Sets required * - * @param bool $use_country_code_select Whether to display a country code drop down next to the phone field. + * @param bool $required Whether a value for this field is required when submitting the form. * * @return self */ - public function setUseCountryCodeSelect($use_country_code_select) + public function setRequired($required) { - if (is_null($use_country_code_select)) { - throw new \InvalidArgumentException('non-nullable use_country_code_select cannot be null'); + if (is_null($required)) { + throw new \InvalidArgumentException('non-nullable required cannot be null'); } - $this->container['use_country_code_select'] = $use_country_code_select; + $this->container['required'] = $required; return $this; } diff --git a/codegen/Marketing/Forms/Model/PhoneFieldValidation.php b/codegen/Marketing/Forms/Model/PhoneFieldValidation.php index 29ea45631..576336ee4 100644 --- a/codegen/Marketing/Forms/Model/PhoneFieldValidation.php +++ b/codegen/Marketing/Forms/Model/PhoneFieldValidation.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -246,10 +246,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('min_allowed_digits', $data ?? [], null); $this->setIfExists('max_allowed_digits', $data ?? [], null); @@ -316,7 +316,7 @@ public function getMinAllowedDigits() /** * Sets min_allowed_digits * - * @param int $min_allowed_digits min_allowed_digits + * @param int $min_allowed_digits * * @return self */ @@ -343,7 +343,7 @@ public function getMaxAllowedDigits() /** * Sets max_allowed_digits * - * @param int $max_allowed_digits max_allowed_digits + * @param int $max_allowed_digits * * @return self */ diff --git a/codegen/Marketing/Forms/Model/RadioField.php b/codegen/Marketing/Forms/Model/RadioField.php index 7eafcb1f0..4d58bb478 100644 --- a/codegen/Marketing/Forms/Model/RadioField.php +++ b/codegen/Marketing/Forms/Model/RadioField.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -58,17 +58,17 @@ class RadioField implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'field_type' => 'string', 'object_type_id' => 'string', + 'hidden' => 'bool', 'name' => 'string', - 'label' => 'string', + 'options' => '\HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[]', 'description' => 'string', - 'required' => 'bool', - 'hidden' => 'bool', - 'dependent_fields' => '\HubSpot\Client\Marketing\Forms\Model\DependentField[]', 'default_values' => 'string[]', - 'options' => '\HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[]', - 'placeholder' => 'string' + 'dependent_fields' => '\HubSpot\Client\Marketing\Forms\Model\DependentField[]', + 'label' => 'string', + 'placeholder' => 'string', + 'field_type' => 'string', + 'required' => 'bool' ]; /** @@ -79,17 +79,17 @@ class RadioField implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'field_type' => null, 'object_type_id' => null, + 'hidden' => null, 'name' => null, - 'label' => null, + 'options' => null, 'description' => null, - 'required' => null, - 'hidden' => null, - 'dependent_fields' => null, 'default_values' => null, - 'options' => null, - 'placeholder' => null + 'dependent_fields' => null, + 'label' => null, + 'placeholder' => null, + 'field_type' => null, + 'required' => null ]; /** @@ -98,17 +98,17 @@ class RadioField implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'field_type' => false, 'object_type_id' => false, + 'hidden' => false, 'name' => false, - 'label' => false, + 'options' => false, 'description' => false, - 'required' => false, - 'hidden' => false, - 'dependent_fields' => false, 'default_values' => false, - 'options' => false, - 'placeholder' => false + 'dependent_fields' => false, + 'label' => false, + 'placeholder' => false, + 'field_type' => false, + 'required' => false ]; /** @@ -197,17 +197,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'field_type' => 'fieldType', 'object_type_id' => 'objectTypeId', + 'hidden' => 'hidden', 'name' => 'name', - 'label' => 'label', + 'options' => 'options', 'description' => 'description', - 'required' => 'required', - 'hidden' => 'hidden', - 'dependent_fields' => 'dependentFields', 'default_values' => 'defaultValues', - 'options' => 'options', - 'placeholder' => 'placeholder' + 'dependent_fields' => 'dependentFields', + 'label' => 'label', + 'placeholder' => 'placeholder', + 'field_type' => 'fieldType', + 'required' => 'required' ]; /** @@ -216,17 +216,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'field_type' => 'setFieldType', 'object_type_id' => 'setObjectTypeId', + 'hidden' => 'setHidden', 'name' => 'setName', - 'label' => 'setLabel', + 'options' => 'setOptions', 'description' => 'setDescription', - 'required' => 'setRequired', - 'hidden' => 'setHidden', - 'dependent_fields' => 'setDependentFields', 'default_values' => 'setDefaultValues', - 'options' => 'setOptions', - 'placeholder' => 'setPlaceholder' + 'dependent_fields' => 'setDependentFields', + 'label' => 'setLabel', + 'placeholder' => 'setPlaceholder', + 'field_type' => 'setFieldType', + 'required' => 'setRequired' ]; /** @@ -235,17 +235,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'field_type' => 'getFieldType', 'object_type_id' => 'getObjectTypeId', + 'hidden' => 'getHidden', 'name' => 'getName', - 'label' => 'getLabel', + 'options' => 'getOptions', 'description' => 'getDescription', - 'required' => 'getRequired', - 'hidden' => 'getHidden', - 'dependent_fields' => 'getDependentFields', 'default_values' => 'getDefaultValues', - 'options' => 'getOptions', - 'placeholder' => 'getPlaceholder' + 'dependent_fields' => 'getDependentFields', + 'label' => 'getLabel', + 'placeholder' => 'getPlaceholder', + 'field_type' => 'getFieldType', + 'required' => 'getRequired' ]; /** @@ -313,22 +313,22 @@ public function getFieldTypeAllowableValues() /** * 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('field_type', $data ?? [], 'radio'); $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('hidden', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); + $this->setIfExists('options', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('required', $data ?? [], null); - $this->setIfExists('hidden', $data ?? [], null); - $this->setIfExists('dependent_fields', $data ?? [], null); $this->setIfExists('default_values', $data ?? [], null); - $this->setIfExists('options', $data ?? [], null); + $this->setIfExists('dependent_fields', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); $this->setIfExists('placeholder', $data ?? [], null); + $this->setIfExists('field_type', $data ?? [], 'radio'); + $this->setIfExists('required', $data ?? [], null); } /** @@ -358,6 +358,27 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['hidden'] === null) { + $invalidProperties[] = "'hidden' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['options'] === null) { + $invalidProperties[] = "'options' can't be null"; + } + if ($this->container['default_values'] === null) { + $invalidProperties[] = "'default_values' can't be null"; + } + if ($this->container['dependent_fields'] === null) { + $invalidProperties[] = "'dependent_fields' can't be null"; + } + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } if ($this->container['field_type'] === null) { $invalidProperties[] = "'field_type' can't be null"; } @@ -370,30 +391,9 @@ public function listInvalidProperties() ); } - if ($this->container['object_type_id'] === null) { - $invalidProperties[] = "'object_type_id' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['label'] === null) { - $invalidProperties[] = "'label' can't be null"; - } if ($this->container['required'] === null) { $invalidProperties[] = "'required' can't be null"; } - if ($this->container['hidden'] === null) { - $invalidProperties[] = "'hidden' can't be null"; - } - if ($this->container['dependent_fields'] === null) { - $invalidProperties[] = "'dependent_fields' can't be null"; - } - if ($this->container['default_values'] === null) { - $invalidProperties[] = "'default_values' can't be null"; - } - if ($this->container['options'] === null) { - $invalidProperties[] = "'options' can't be null"; - } return $invalidProperties; } @@ -410,65 +410,55 @@ public function valid() /** - * Gets field_type + * Gets object_type_id * * @return string */ - public function getFieldType() + public function getObjectTypeId() { - return $this->container['field_type']; + return $this->container['object_type_id']; } /** - * Sets field_type + * Sets object_type_id * - * @param string $field_type Determines how the field will be displayed and validated. + * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. * * @return self */ - public function setFieldType($field_type) + public function setObjectTypeId($object_type_id) { - if (is_null($field_type)) { - throw new \InvalidArgumentException('non-nullable field_type cannot be null'); - } - $allowedValues = $this->getFieldTypeAllowableValues(); - if (!in_array($field_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'field_type', must be one of '%s'", - $field_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); } - $this->container['field_type'] = $field_type; + $this->container['object_type_id'] = $object_type_id; return $this; } /** - * Gets object_type_id + * Gets hidden * - * @return string + * @return bool */ - public function getObjectTypeId() + public function getHidden() { - return $this->container['object_type_id']; + return $this->container['hidden']; } /** - * Sets object_type_id + * Sets hidden * - * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. + * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. * * @return self */ - public function setObjectTypeId($object_type_id) + public function setHidden($hidden) { - if (is_null($object_type_id)) { - throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + if (is_null($hidden)) { + throw new \InvalidArgumentException('non-nullable hidden cannot be null'); } - $this->container['object_type_id'] = $object_type_id; + $this->container['hidden'] = $hidden; return $this; } @@ -501,28 +491,28 @@ public function setName($name) } /** - * Gets label + * Gets options * - * @return string + * @return \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] */ - public function getLabel() + public function getOptions() { - return $this->container['label']; + return $this->container['options']; } /** - * Sets label + * Sets options * - * @param string $label The main label for the form field. + * @param \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] $options The list of available choices for this field. * * @return self */ - public function setLabel($label) + public function setOptions($options) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($options)) { + throw new \InvalidArgumentException('non-nullable options cannot be null'); } - $this->container['label'] = $label; + $this->container['options'] = $options; return $this; } @@ -555,163 +545,173 @@ public function setDescription($description) } /** - * Gets required + * Gets default_values * - * @return bool + * @return string[] */ - public function getRequired() + public function getDefaultValues() { - return $this->container['required']; + return $this->container['default_values']; } /** - * Sets required + * Sets default_values * - * @param bool $required Whether a value for this field is required when submitting the form. + * @param string[] $default_values The values selected by default. Those values will be submitted unless the customer modifies them. * * @return self */ - public function setRequired($required) + public function setDefaultValues($default_values) { - if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + if (is_null($default_values)) { + throw new \InvalidArgumentException('non-nullable default_values cannot be null'); } - $this->container['required'] = $required; + $this->container['default_values'] = $default_values; return $this; } /** - * Gets hidden + * Gets dependent_fields * - * @return bool + * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] */ - public function getHidden() + public function getDependentFields() { - return $this->container['hidden']; + return $this->container['dependent_fields']; } /** - * Sets hidden + * Sets dependent_fields * - * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. + * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. * * @return self */ - public function setHidden($hidden) + public function setDependentFields($dependent_fields) { - if (is_null($hidden)) { - throw new \InvalidArgumentException('non-nullable hidden cannot be null'); + if (is_null($dependent_fields)) { + throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); } - $this->container['hidden'] = $hidden; + $this->container['dependent_fields'] = $dependent_fields; return $this; } /** - * Gets dependent_fields + * Gets label * - * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] + * @return string */ - public function getDependentFields() + public function getLabel() { - return $this->container['dependent_fields']; + return $this->container['label']; } /** - * Sets dependent_fields + * Sets label * - * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. + * @param string $label The main label for the form field. * * @return self */ - public function setDependentFields($dependent_fields) + public function setLabel($label) { - if (is_null($dependent_fields)) { - throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); } - $this->container['dependent_fields'] = $dependent_fields; + $this->container['label'] = $label; return $this; } /** - * Gets default_values + * Gets placeholder * - * @return string[] + * @return string|null */ - public function getDefaultValues() + public function getPlaceholder() { - return $this->container['default_values']; + return $this->container['placeholder']; } /** - * Sets default_values + * Sets placeholder * - * @param string[] $default_values The values selected by default. Those values will be submitted unless the customer modifies them. + * @param string|null $placeholder The prompt text showing when the field isn't filled in. * * @return self */ - public function setDefaultValues($default_values) + public function setPlaceholder($placeholder) { - if (is_null($default_values)) { - throw new \InvalidArgumentException('non-nullable default_values cannot be null'); + if (is_null($placeholder)) { + throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); } - $this->container['default_values'] = $default_values; + $this->container['placeholder'] = $placeholder; return $this; } /** - * Gets options + * Gets field_type * - * @return \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] + * @return string */ - public function getOptions() + public function getFieldType() { - return $this->container['options']; + return $this->container['field_type']; } /** - * Sets options + * Sets field_type * - * @param \HubSpot\Client\Marketing\Forms\Model\EnumeratedFieldOption[] $options The list of available choices for this field. + * @param string $field_type Determines how the field will be displayed and validated. * * @return self */ - public function setOptions($options) + public function setFieldType($field_type) { - if (is_null($options)) { - throw new \InvalidArgumentException('non-nullable options cannot be null'); + if (is_null($field_type)) { + throw new \InvalidArgumentException('non-nullable field_type cannot be null'); } - $this->container['options'] = $options; + $allowedValues = $this->getFieldTypeAllowableValues(); + if (!in_array($field_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'field_type', must be one of '%s'", + $field_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['field_type'] = $field_type; return $this; } /** - * Gets placeholder + * Gets required * - * @return string|null + * @return bool */ - public function getPlaceholder() + public function getRequired() { - return $this->container['placeholder']; + return $this->container['required']; } /** - * Sets placeholder + * Sets required * - * @param string|null $placeholder The prompt text showing when the field isn't filled in. + * @param bool $required Whether a value for this field is required when submitting the form. * * @return self */ - public function setPlaceholder($placeholder) + public function setRequired($required) { - if (is_null($placeholder)) { - throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); + if (is_null($required)) { + throw new \InvalidArgumentException('non-nullable required cannot be null'); } - $this->container['placeholder'] = $placeholder; + $this->container['required'] = $required; return $this; } diff --git a/codegen/Marketing/Forms/Model/SingleCheckboxField.php b/codegen/Marketing/Forms/Model/SingleCheckboxField.php index 78b64ac39..3d34d14e5 100644 --- a/codegen/Marketing/Forms/Model/SingleCheckboxField.php +++ b/codegen/Marketing/Forms/Model/SingleCheckboxField.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -58,15 +58,15 @@ class SingleCheckboxField implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'field_type' => 'string', 'object_type_id' => 'string', + 'hidden' => 'bool', + 'default_value' => 'string', 'name' => 'string', - 'label' => 'string', 'description' => 'string', - 'required' => 'bool', - 'hidden' => 'bool', 'dependent_fields' => '\HubSpot\Client\Marketing\Forms\Model\DependentField[]', - 'default_value' => 'string' + 'label' => 'string', + 'field_type' => 'string', + 'required' => 'bool' ]; /** @@ -77,15 +77,15 @@ class SingleCheckboxField implements ModelInterface, ArrayAccess, \JsonSerializa * @psalm-var array */ protected static $openAPIFormats = [ - 'field_type' => null, 'object_type_id' => null, + 'hidden' => null, + 'default_value' => null, 'name' => null, - 'label' => null, 'description' => null, - 'required' => null, - 'hidden' => null, 'dependent_fields' => null, - 'default_value' => null + 'label' => null, + 'field_type' => null, + 'required' => null ]; /** @@ -94,15 +94,15 @@ class SingleCheckboxField implements ModelInterface, ArrayAccess, \JsonSerializa * @var boolean[] */ protected static array $openAPINullables = [ - 'field_type' => false, 'object_type_id' => false, + 'hidden' => false, + 'default_value' => false, 'name' => false, - 'label' => false, 'description' => false, - 'required' => false, - 'hidden' => false, 'dependent_fields' => false, - 'default_value' => false + 'label' => false, + 'field_type' => false, + 'required' => false ]; /** @@ -191,15 +191,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'field_type' => 'fieldType', 'object_type_id' => 'objectTypeId', + 'hidden' => 'hidden', + 'default_value' => 'defaultValue', 'name' => 'name', - 'label' => 'label', 'description' => 'description', - 'required' => 'required', - 'hidden' => 'hidden', 'dependent_fields' => 'dependentFields', - 'default_value' => 'defaultValue' + 'label' => 'label', + 'field_type' => 'fieldType', + 'required' => 'required' ]; /** @@ -208,15 +208,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'field_type' => 'setFieldType', 'object_type_id' => 'setObjectTypeId', + 'hidden' => 'setHidden', + 'default_value' => 'setDefaultValue', 'name' => 'setName', - 'label' => 'setLabel', 'description' => 'setDescription', - 'required' => 'setRequired', - 'hidden' => 'setHidden', 'dependent_fields' => 'setDependentFields', - 'default_value' => 'setDefaultValue' + 'label' => 'setLabel', + 'field_type' => 'setFieldType', + 'required' => 'setRequired' ]; /** @@ -225,15 +225,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'field_type' => 'getFieldType', 'object_type_id' => 'getObjectTypeId', + 'hidden' => 'getHidden', + 'default_value' => 'getDefaultValue', 'name' => 'getName', - 'label' => 'getLabel', 'description' => 'getDescription', - 'required' => 'getRequired', - 'hidden' => 'getHidden', 'dependent_fields' => 'getDependentFields', - 'default_value' => 'getDefaultValue' + 'label' => 'getLabel', + 'field_type' => 'getFieldType', + 'required' => 'getRequired' ]; /** @@ -301,20 +301,20 @@ public function getFieldTypeAllowableValues() /** * 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('field_type', $data ?? [], 'single_checkbox'); $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('hidden', $data ?? [], null); + $this->setIfExists('default_value', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('required', $data ?? [], null); - $this->setIfExists('hidden', $data ?? [], null); $this->setIfExists('dependent_fields', $data ?? [], null); - $this->setIfExists('default_value', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); + $this->setIfExists('field_type', $data ?? [], 'single_checkbox'); + $this->setIfExists('required', $data ?? [], null); } /** @@ -344,6 +344,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['hidden'] === null) { + $invalidProperties[] = "'hidden' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['dependent_fields'] === null) { + $invalidProperties[] = "'dependent_fields' can't be null"; + } + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } if ($this->container['field_type'] === null) { $invalidProperties[] = "'field_type' can't be null"; } @@ -356,24 +371,9 @@ public function listInvalidProperties() ); } - if ($this->container['object_type_id'] === null) { - $invalidProperties[] = "'object_type_id' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['label'] === null) { - $invalidProperties[] = "'label' can't be null"; - } if ($this->container['required'] === null) { $invalidProperties[] = "'required' can't be null"; } - if ($this->container['hidden'] === null) { - $invalidProperties[] = "'hidden' can't be null"; - } - if ($this->container['dependent_fields'] === null) { - $invalidProperties[] = "'dependent_fields' can't be null"; - } return $invalidProperties; } @@ -390,119 +390,109 @@ public function valid() /** - * Gets field_type + * Gets object_type_id * * @return string */ - public function getFieldType() + public function getObjectTypeId() { - return $this->container['field_type']; + return $this->container['object_type_id']; } /** - * Sets field_type + * Sets object_type_id * - * @param string $field_type Determines how the field will be displayed and validated. + * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. * * @return self */ - public function setFieldType($field_type) + public function setObjectTypeId($object_type_id) { - if (is_null($field_type)) { - throw new \InvalidArgumentException('non-nullable field_type cannot be null'); - } - $allowedValues = $this->getFieldTypeAllowableValues(); - if (!in_array($field_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'field_type', must be one of '%s'", - $field_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); } - $this->container['field_type'] = $field_type; + $this->container['object_type_id'] = $object_type_id; return $this; } /** - * Gets object_type_id + * Gets hidden * - * @return string + * @return bool */ - public function getObjectTypeId() + public function getHidden() { - return $this->container['object_type_id']; + return $this->container['hidden']; } /** - * Sets object_type_id + * Sets hidden * - * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. + * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. * * @return self */ - public function setObjectTypeId($object_type_id) + public function setHidden($hidden) { - if (is_null($object_type_id)) { - throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + if (is_null($hidden)) { + throw new \InvalidArgumentException('non-nullable hidden cannot be null'); } - $this->container['object_type_id'] = $object_type_id; + $this->container['hidden'] = $hidden; return $this; } /** - * Gets name + * Gets default_value * - * @return string + * @return string|null */ - public function getName() + public function getDefaultValue() { - return $this->container['name']; + return $this->container['default_value']; } /** - * Sets name + * Sets default_value * - * @param string $name The identifier of the field. In combination with the object type ID, it must be unique. + * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. * * @return self */ - public function setName($name) + public function setDefaultValue($default_value) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($default_value)) { + throw new \InvalidArgumentException('non-nullable default_value cannot be null'); } - $this->container['name'] = $name; + $this->container['default_value'] = $default_value; return $this; } /** - * Gets label + * Gets name * * @return string */ - public function getLabel() + public function getName() { - return $this->container['label']; + return $this->container['name']; } /** - * Sets label + * Sets name * - * @param string $label The main label for the form field. + * @param string $name The identifier of the field. In combination with the object type ID, it must be unique. * * @return self */ - public function setLabel($label) + public function setName($name) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['label'] = $label; + $this->container['name'] = $name; return $this; } @@ -535,109 +525,119 @@ public function setDescription($description) } /** - * Gets required + * Gets dependent_fields * - * @return bool + * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] */ - public function getRequired() + public function getDependentFields() { - return $this->container['required']; + return $this->container['dependent_fields']; } /** - * Sets required + * Sets dependent_fields * - * @param bool $required Whether a value for this field is required when submitting the form. + * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. * * @return self */ - public function setRequired($required) + public function setDependentFields($dependent_fields) { - if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + if (is_null($dependent_fields)) { + throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); } - $this->container['required'] = $required; + $this->container['dependent_fields'] = $dependent_fields; return $this; } /** - * Gets hidden + * Gets label * - * @return bool + * @return string */ - public function getHidden() + public function getLabel() { - return $this->container['hidden']; + return $this->container['label']; } /** - * Sets hidden + * Sets label * - * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. + * @param string $label The main label for the form field. * * @return self */ - public function setHidden($hidden) + public function setLabel($label) { - if (is_null($hidden)) { - throw new \InvalidArgumentException('non-nullable hidden cannot be null'); + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); } - $this->container['hidden'] = $hidden; + $this->container['label'] = $label; return $this; } /** - * Gets dependent_fields + * Gets field_type * - * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] + * @return string */ - public function getDependentFields() + public function getFieldType() { - return $this->container['dependent_fields']; + return $this->container['field_type']; } /** - * Sets dependent_fields + * Sets field_type * - * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. + * @param string $field_type Determines how the field will be displayed and validated. * * @return self */ - public function setDependentFields($dependent_fields) + public function setFieldType($field_type) { - if (is_null($dependent_fields)) { - throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); + if (is_null($field_type)) { + throw new \InvalidArgumentException('non-nullable field_type cannot be null'); } - $this->container['dependent_fields'] = $dependent_fields; + $allowedValues = $this->getFieldTypeAllowableValues(); + if (!in_array($field_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'field_type', must be one of '%s'", + $field_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['field_type'] = $field_type; return $this; } /** - * Gets default_value + * Gets required * - * @return string|null + * @return bool */ - public function getDefaultValue() + public function getRequired() { - return $this->container['default_value']; + return $this->container['required']; } /** - * Sets default_value + * Sets required * - * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. + * @param bool $required Whether a value for this field is required when submitting the form. * * @return self */ - public function setDefaultValue($default_value) + public function setRequired($required) { - if (is_null($default_value)) { - throw new \InvalidArgumentException('non-nullable default_value cannot be null'); + if (is_null($required)) { + throw new \InvalidArgumentException('non-nullable required cannot be null'); } - $this->container['default_value'] = $default_value; + $this->container['required'] = $required; return $this; } diff --git a/codegen/Marketing/Forms/Model/SingleLineTextField.php b/codegen/Marketing/Forms/Model/SingleLineTextField.php index 5561023ee..fd9492d69 100644 --- a/codegen/Marketing/Forms/Model/SingleLineTextField.php +++ b/codegen/Marketing/Forms/Model/SingleLineTextField.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -58,16 +58,16 @@ class SingleLineTextField implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'field_type' => 'string', 'object_type_id' => 'string', + 'hidden' => 'bool', + 'default_value' => 'string', 'name' => 'string', - 'label' => 'string', 'description' => 'string', - 'required' => 'bool', - 'hidden' => 'bool', 'dependent_fields' => '\HubSpot\Client\Marketing\Forms\Model\DependentField[]', + 'label' => 'string', 'placeholder' => 'string', - 'default_value' => 'string' + 'field_type' => 'string', + 'required' => 'bool' ]; /** @@ -78,16 +78,16 @@ class SingleLineTextField implements ModelInterface, ArrayAccess, \JsonSerializa * @psalm-var array */ protected static $openAPIFormats = [ - 'field_type' => null, 'object_type_id' => null, + 'hidden' => null, + 'default_value' => null, 'name' => null, - 'label' => null, 'description' => null, - 'required' => null, - 'hidden' => null, 'dependent_fields' => null, + 'label' => null, 'placeholder' => null, - 'default_value' => null + 'field_type' => null, + 'required' => null ]; /** @@ -96,16 +96,16 @@ class SingleLineTextField implements ModelInterface, ArrayAccess, \JsonSerializa * @var boolean[] */ protected static array $openAPINullables = [ - 'field_type' => false, 'object_type_id' => false, + 'hidden' => false, + 'default_value' => false, 'name' => false, - 'label' => false, 'description' => false, - 'required' => false, - 'hidden' => false, 'dependent_fields' => false, + 'label' => false, 'placeholder' => false, - 'default_value' => false + 'field_type' => false, + 'required' => false ]; /** @@ -194,16 +194,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'field_type' => 'fieldType', 'object_type_id' => 'objectTypeId', + 'hidden' => 'hidden', + 'default_value' => 'defaultValue', 'name' => 'name', - 'label' => 'label', 'description' => 'description', - 'required' => 'required', - 'hidden' => 'hidden', 'dependent_fields' => 'dependentFields', + 'label' => 'label', 'placeholder' => 'placeholder', - 'default_value' => 'defaultValue' + 'field_type' => 'fieldType', + 'required' => 'required' ]; /** @@ -212,16 +212,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'field_type' => 'setFieldType', 'object_type_id' => 'setObjectTypeId', + 'hidden' => 'setHidden', + 'default_value' => 'setDefaultValue', 'name' => 'setName', - 'label' => 'setLabel', 'description' => 'setDescription', - 'required' => 'setRequired', - 'hidden' => 'setHidden', 'dependent_fields' => 'setDependentFields', + 'label' => 'setLabel', 'placeholder' => 'setPlaceholder', - 'default_value' => 'setDefaultValue' + 'field_type' => 'setFieldType', + 'required' => 'setRequired' ]; /** @@ -230,16 +230,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'field_type' => 'getFieldType', 'object_type_id' => 'getObjectTypeId', + 'hidden' => 'getHidden', + 'default_value' => 'getDefaultValue', 'name' => 'getName', - 'label' => 'getLabel', 'description' => 'getDescription', - 'required' => 'getRequired', - 'hidden' => 'getHidden', 'dependent_fields' => 'getDependentFields', + 'label' => 'getLabel', 'placeholder' => 'getPlaceholder', - 'default_value' => 'getDefaultValue' + 'field_type' => 'getFieldType', + 'required' => 'getRequired' ]; /** @@ -307,21 +307,21 @@ public function getFieldTypeAllowableValues() /** * 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('field_type', $data ?? [], 'single_line_text'); $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('hidden', $data ?? [], null); + $this->setIfExists('default_value', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('required', $data ?? [], null); - $this->setIfExists('hidden', $data ?? [], null); $this->setIfExists('dependent_fields', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); $this->setIfExists('placeholder', $data ?? [], null); - $this->setIfExists('default_value', $data ?? [], null); + $this->setIfExists('field_type', $data ?? [], 'single_line_text'); + $this->setIfExists('required', $data ?? [], null); } /** @@ -351,6 +351,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['hidden'] === null) { + $invalidProperties[] = "'hidden' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['dependent_fields'] === null) { + $invalidProperties[] = "'dependent_fields' can't be null"; + } + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } if ($this->container['field_type'] === null) { $invalidProperties[] = "'field_type' can't be null"; } @@ -363,24 +378,9 @@ public function listInvalidProperties() ); } - if ($this->container['object_type_id'] === null) { - $invalidProperties[] = "'object_type_id' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['label'] === null) { - $invalidProperties[] = "'label' can't be null"; - } if ($this->container['required'] === null) { $invalidProperties[] = "'required' can't be null"; } - if ($this->container['hidden'] === null) { - $invalidProperties[] = "'hidden' can't be null"; - } - if ($this->container['dependent_fields'] === null) { - $invalidProperties[] = "'dependent_fields' can't be null"; - } return $invalidProperties; } @@ -397,119 +397,109 @@ public function valid() /** - * Gets field_type + * Gets object_type_id * * @return string */ - public function getFieldType() + public function getObjectTypeId() { - return $this->container['field_type']; + return $this->container['object_type_id']; } /** - * Sets field_type + * Sets object_type_id * - * @param string $field_type Determines how the field will be displayed and validated. + * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. * * @return self */ - public function setFieldType($field_type) + public function setObjectTypeId($object_type_id) { - if (is_null($field_type)) { - throw new \InvalidArgumentException('non-nullable field_type cannot be null'); - } - $allowedValues = $this->getFieldTypeAllowableValues(); - if (!in_array($field_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'field_type', must be one of '%s'", - $field_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); } - $this->container['field_type'] = $field_type; + $this->container['object_type_id'] = $object_type_id; return $this; } /** - * Gets object_type_id + * Gets hidden * - * @return string + * @return bool */ - public function getObjectTypeId() + public function getHidden() { - return $this->container['object_type_id']; + return $this->container['hidden']; } /** - * Sets object_type_id + * Sets hidden * - * @param string $object_type_id A unique ID for this field's CRM object type. For example a CONTACT field will have the object type ID 0-1. + * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. * * @return self */ - public function setObjectTypeId($object_type_id) + public function setHidden($hidden) { - if (is_null($object_type_id)) { - throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + if (is_null($hidden)) { + throw new \InvalidArgumentException('non-nullable hidden cannot be null'); } - $this->container['object_type_id'] = $object_type_id; + $this->container['hidden'] = $hidden; return $this; } /** - * Gets name + * Gets default_value * - * @return string + * @return string|null */ - public function getName() + public function getDefaultValue() { - return $this->container['name']; + return $this->container['default_value']; } /** - * Sets name + * Sets default_value * - * @param string $name The identifier of the field. In combination with the object type ID, it must be unique. + * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. * * @return self */ - public function setName($name) + public function setDefaultValue($default_value) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($default_value)) { + throw new \InvalidArgumentException('non-nullable default_value cannot be null'); } - $this->container['name'] = $name; + $this->container['default_value'] = $default_value; return $this; } /** - * Gets label + * Gets name * * @return string */ - public function getLabel() + public function getName() { - return $this->container['label']; + return $this->container['name']; } /** - * Sets label + * Sets name * - * @param string $label The main label for the form field. + * @param string $name The identifier of the field. In combination with the object type ID, it must be unique. * * @return self */ - public function setLabel($label) + public function setName($name) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['label'] = $label; + $this->container['name'] = $name; return $this; } @@ -542,136 +532,146 @@ public function setDescription($description) } /** - * Gets required + * Gets dependent_fields * - * @return bool + * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] */ - public function getRequired() + public function getDependentFields() { - return $this->container['required']; + return $this->container['dependent_fields']; } /** - * Sets required + * Sets dependent_fields * - * @param bool $required Whether a value for this field is required when submitting the form. + * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. * * @return self */ - public function setRequired($required) + public function setDependentFields($dependent_fields) { - if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + if (is_null($dependent_fields)) { + throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); } - $this->container['required'] = $required; + $this->container['dependent_fields'] = $dependent_fields; return $this; } /** - * Gets hidden + * Gets label * - * @return bool + * @return string */ - public function getHidden() + public function getLabel() { - return $this->container['hidden']; + return $this->container['label']; } /** - * Sets hidden + * Sets label * - * @param bool $hidden Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. + * @param string $label The main label for the form field. * * @return self */ - public function setHidden($hidden) + public function setLabel($label) { - if (is_null($hidden)) { - throw new \InvalidArgumentException('non-nullable hidden cannot be null'); + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); } - $this->container['hidden'] = $hidden; + $this->container['label'] = $label; return $this; } /** - * Gets dependent_fields + * Gets placeholder * - * @return \HubSpot\Client\Marketing\Forms\Model\DependentField[] + * @return string|null */ - public function getDependentFields() + public function getPlaceholder() { - return $this->container['dependent_fields']; + return $this->container['placeholder']; } /** - * Sets dependent_fields + * Sets placeholder * - * @param \HubSpot\Client\Marketing\Forms\Model\DependentField[] $dependent_fields A list of other fields to make visible based on the value filled in for this field. + * @param string|null $placeholder The prompt text showing when the field isn't filled in. * * @return self */ - public function setDependentFields($dependent_fields) + public function setPlaceholder($placeholder) { - if (is_null($dependent_fields)) { - throw new \InvalidArgumentException('non-nullable dependent_fields cannot be null'); + if (is_null($placeholder)) { + throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); } - $this->container['dependent_fields'] = $dependent_fields; + $this->container['placeholder'] = $placeholder; return $this; } /** - * Gets placeholder + * Gets field_type * - * @return string|null + * @return string */ - public function getPlaceholder() + public function getFieldType() { - return $this->container['placeholder']; + return $this->container['field_type']; } /** - * Sets placeholder + * Sets field_type * - * @param string|null $placeholder The prompt text showing when the field isn't filled in. + * @param string $field_type Determines how the field will be displayed and validated. * * @return self */ - public function setPlaceholder($placeholder) + public function setFieldType($field_type) { - if (is_null($placeholder)) { - throw new \InvalidArgumentException('non-nullable placeholder cannot be null'); + if (is_null($field_type)) { + throw new \InvalidArgumentException('non-nullable field_type cannot be null'); } - $this->container['placeholder'] = $placeholder; + $allowedValues = $this->getFieldTypeAllowableValues(); + if (!in_array($field_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'field_type', must be one of '%s'", + $field_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['field_type'] = $field_type; return $this; } /** - * Gets default_value + * Gets required * - * @return string|null + * @return bool */ - public function getDefaultValue() + public function getRequired() { - return $this->container['default_value']; + return $this->container['required']; } /** - * Sets default_value + * Sets required * - * @param string|null $default_value The value filled in by default. This value will be submitted unless the customer modifies it. + * @param bool $required Whether a value for this field is required when submitting the form. * * @return self */ - public function setDefaultValue($default_value) + public function setRequired($required) { - if (is_null($default_value)) { - throw new \InvalidArgumentException('non-nullable default_value cannot be null'); + if (is_null($required)) { + throw new \InvalidArgumentException('non-nullable required cannot be null'); } - $this->container['default_value'] = $default_value; + $this->container['required'] = $required; return $this; } diff --git a/codegen/Marketing/Forms/ObjectSerializer.php b/codegen/Marketing/Forms/ObjectSerializer.php index 0e55e67a7..8592ef3eb 100644 --- a/codegen/Marketing/Forms/ObjectSerializer.php +++ b/codegen/Marketing/Forms/ObjectSerializer.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -58,8 +58,8 @@ public static function setDateTimeFormat($format) * Serialize data * * @param mixed $data the data to serialize - * @param string $type the OpenAPIToolsType of the data - * @param string $format the format of the OpenAPITools type of the data + * @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 */ @@ -194,6 +194,10 @@ private static function isEmptyValue($value, string $openApiType): bool 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; @@ -265,6 +269,11 @@ public static function toQueryValue( $value = $flattenArray($value, $paramName); + // https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values + if ($openApiType === 'array' && $style === 'deepObject' && $explode) { + return $value; + } + if ($openApiType === 'object' && ($style === 'deepObject' || $explode)) { return $value; } @@ -338,7 +347,7 @@ public static function toFormValue($value) * If it's a datetime object, format it in ISO8601 * If it's a boolean, convert it to "true" or "false". * - * @param string|bool|\DateTime $value the value of the parameter + * @param float|int|bool|\DateTime $value the value of the parameter * * @return string the header string */ @@ -395,8 +404,7 @@ public static function serializeCollection(array $collection, $style, $allowColl * * @param mixed $data object or primitive to be deserialized * @param string $class class name is passed as a string - * @param string[] $httpHeaders HTTP headers - * @param string $discriminator discriminator if polymorphism is used + * @param string[]|null $httpHeaders HTTP headers * * @return object|array|null a single or an array of $class instances */ @@ -473,7 +481,7 @@ public static function deserialize($data, $class, $httpHeaders = null) // determine file name if ( is_array($httpHeaders) - && array_key_exists('Content-Disposition', $httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); @@ -546,22 +554,64 @@ public static function deserialize($data, $class, $httpHeaders = null) } /** - * Native `http_build_query` wrapper. - * @see https://www.php.net/manual/en/function.http-build-query - * - * @param array|object $data May be an array or object containing properties. - * @param string $numeric_prefix If numeric indices are used in the base array and this parameter is provided, it will be prepended to the numeric index for elements in the base array only. - * @param string|null $arg_separator arg_separator.output is used to separate arguments but may be overridden by specifying this parameter. - * @param int $encoding_type Encoding type. By default, PHP_QUERY_RFC1738. - * - * @return string - */ - public static function buildQuery( - $data, - string $numeric_prefix = '', - ?string $arg_separator = null, - int $encoding_type = \PHP_QUERY_RFC3986 - ): string { - return \GuzzleHttp\Psr7\Query::build($data, $encoding_type); + * 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) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $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); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? $castBool($v) : $v; + if ($v !== null) { + $qs .= '='.$encoder((string) $v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? $castBool($vv) : $vv; + if ($vv !== null) { + $qs .= '='.$encoder((string) $vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; } }