From 676fb616f81fb46449de7edb169f7780fffd6263 Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Tue, 8 Apr 2025 17:10:25 +0300 Subject: [PATCH 1/2] Codegen: Update generator version only for new clients --- .../Crm/Commerce/Invoices/Api/BasicApi.php | 244 ++++--- .../Crm/Commerce/Invoices/Api/BatchApi.php | 134 ++-- .../Crm/Commerce/Invoices/Api/SearchApi.php | 37 +- .../Crm/Commerce/Invoices/ApiException.php | 8 +- .../Crm/Commerce/Invoices/Configuration.php | 4 +- .../Crm/Commerce/Invoices/HeaderSelector.php | 32 +- .../Commerce/Invoices/Model/AssociatedId.php | 6 +- .../Invoices/Model/AssociationSpec.php | 6 +- ...BatchInputSimplePublicObjectBatchInput.php | 6 +- ...tSimplePublicObjectBatchInputForCreate.php | 6 +- ...nputSimplePublicObjectBatchInputUpsert.php | 6 +- .../Model/BatchInputSimplePublicObjectId.php | 6 +- .../BatchReadInputSimplePublicObjectId.php | 6 +- .../Model/BatchResponseSimplePublicObject.php | 6 +- ...chResponseSimplePublicObjectWithErrors.php | 6 +- .../BatchResponseSimplePublicUpsertObject.php | 6 +- ...onseSimplePublicUpsertObjectWithErrors.php | 6 +- .../Model/CollectionResponseAssociatedId.php | 6 +- ...licObjectWithAssociationsForwardPaging.php | 6 +- ...thTotalSimplePublicObjectForwardPaging.php | 6 +- codegen/Crm/Commerce/Invoices/Model/Error.php | 6 +- .../Commerce/Invoices/Model/ErrorDetail.php | 6 +- .../Crm/Commerce/Invoices/Model/Filter.php | 6 +- .../Commerce/Invoices/Model/FilterGroup.php | 6 +- .../Commerce/Invoices/Model/ForwardPaging.php | 6 +- .../Invoices/Model/ModelInterface.php | 2 +- .../Crm/Commerce/Invoices/Model/NextPage.php | 6 +- .../Crm/Commerce/Invoices/Model/Paging.php | 6 +- .../Commerce/Invoices/Model/PreviousPage.php | 6 +- .../Model/PublicAssociationsForObject.php | 6 +- .../Invoices/Model/PublicObjectId.php | 6 +- .../Model/PublicObjectSearchRequest.php | 6 +- .../Invoices/Model/SimplePublicObject.php | 6 +- .../Model/SimplePublicObjectBatchInput.php | 6 +- .../SimplePublicObjectBatchInputForCreate.php | 6 +- .../SimplePublicObjectBatchInputUpsert.php | 6 +- .../Invoices/Model/SimplePublicObjectId.php | 6 +- .../Model/SimplePublicObjectInput.php | 6 +- .../SimplePublicObjectInputForCreate.php | 6 +- .../SimplePublicObjectWithAssociations.php | 6 +- .../Model/SimplePublicUpsertObject.php | 6 +- .../Commerce/Invoices/Model/StandardError.php | 6 +- .../Invoices/Model/ValueWithTimestamp.php | 6 +- .../Commerce/Invoices/ObjectSerializer.php | 98 ++- codegen/Crm/Exports/Api/PublicExportsApi.php | 62 +- codegen/Crm/Exports/ApiException.php | 8 +- codegen/Crm/Exports/Configuration.php | 4 +- codegen/Crm/Exports/HeaderSelector.php | 32 +- .../ActionResponseWithSingleResultURI.php | 6 +- codegen/Crm/Exports/Model/Error.php | 6 +- codegen/Crm/Exports/Model/ErrorDetail.php | 6 +- codegen/Crm/Exports/Model/Filter.php | 6 +- codegen/Crm/Exports/Model/ModelInterface.php | 2 +- .../Exports/Model/PublicCrmSearchRequest.php | 6 +- .../Exports/Model/PublicExportListRequest.php | 6 +- .../Crm/Exports/Model/PublicExportRequest.php | 6 +- .../Exports/Model/PublicExportViewRequest.php | 6 +- codegen/Crm/Exports/Model/StandardError.php | 6 +- codegen/Crm/Exports/Model/TaskLocator.php | 6 +- codegen/Crm/Exports/ObjectSerializer.php | 98 ++- .../Crm/Objects/DealSplits/Api/BatchApi.php | 62 +- .../Crm/Objects/DealSplits/ApiException.php | 8 +- .../Crm/Objects/DealSplits/Configuration.php | 4 +- .../Crm/Objects/DealSplits/HeaderSelector.php | 32 +- .../Model/BatchInputPublicObjectId.php | 6 +- .../Model/BatchResponseDealToDealSplits.php | 6 +- ...atchResponseDealToDealSplitsWithErrors.php | 6 +- .../DealSplits/Model/DealToDealSplits.php | 6 +- .../Crm/Objects/DealSplits/Model/Error.php | 6 +- .../Objects/DealSplits/Model/ErrorDetail.php | 6 +- .../DealSplits/Model/ModelInterface.php | 2 +- .../DealSplits/Model/PublicDealSplitInput.php | 6 +- .../PublicDealSplitsBatchCreateRequest.php | 6 +- .../Model/PublicDealSplitsCreateRequest.php | 6 +- .../DealSplits/Model/PublicObjectId.php | 6 +- .../DealSplits/Model/SimplePublicObject.php | 6 +- .../DealSplits/Model/StandardError.php | 6 +- .../DealSplits/Model/ValueWithTimestamp.php | 6 +- .../Objects/DealSplits/ObjectSerializer.php | 98 ++- .../Emails/Api/MarketingEmailsApi.php | 632 ++++++++---------- .../Marketing/Emails/Api/StatisticsApi.php | 142 ++-- codegen/Marketing/Emails/ApiException.php | 8 +- codegen/Marketing/Emails/Configuration.php | 4 +- codegen/Marketing/Emails/HeaderSelector.php | 32 +- .../Emails/Model/AbTestCreateRequestVNext.php | 6 +- .../Emails/Model/AggregateEmailStatistics.php | 6 +- ...ithTotalEmailStatisticIntervalNoPaging.php | 6 +- ...ponseWithTotalPublicEmailForwardPaging.php | 6 +- ...ionResponseWithTotalVersionPublicEmail.php | 6 +- .../Emails/Model/ContentCloneRequestVNext.php | 6 +- .../Emails/Model/EmailCreateRequest.php | 6 +- .../Emails/Model/EmailStatisticInterval.php | 6 +- .../Emails/Model/EmailStatisticsData.php | 6 +- .../Emails/Model/EmailUpdateRequest.php | 6 +- codegen/Marketing/Emails/Model/Error.php | 6 +- .../Marketing/Emails/Model/ErrorDetail.php | 6 +- .../Marketing/Emails/Model/ForwardPaging.php | 6 +- codegen/Marketing/Emails/Model/Interval.php | 6 +- .../Marketing/Emails/Model/ModelInterface.php | 2 +- codegen/Marketing/Emails/Model/NextPage.php | 6 +- codegen/Marketing/Emails/Model/Paging.php | 6 +- .../Marketing/Emails/Model/PreviousPage.php | 6 +- .../Model/PublicButtonStyleSettings.php | 6 +- .../Model/PublicDividerStyleSettings.php | 6 +- .../Marketing/Emails/Model/PublicEmail.php | 6 +- .../Emails/Model/PublicEmailContent.php | 6 +- .../Emails/Model/PublicEmailFromDetails.php | 6 +- .../Emails/Model/PublicEmailRecipients.php | 6 +- .../Emails/Model/PublicEmailStyleSettings.php | 6 +- .../Model/PublicEmailSubscriptionDetails.php | 6 +- .../Model/PublicEmailTestingDetails.php | 6 +- .../Emails/Model/PublicEmailToDetails.php | 6 +- .../Emails/Model/PublicFontStyle.php | 6 +- .../Emails/Model/PublicRssEmailDetails.php | 6 +- .../Emails/Model/PublicWebversionDetails.php | 6 +- .../Emails/Model/VersionPublicEmail.php | 6 +- .../Marketing/Emails/Model/VersionUser.php | 6 +- codegen/Marketing/Emails/ObjectSerializer.php | 98 ++- 118 files changed, 1345 insertions(+), 1090 deletions(-) diff --git a/codegen/Crm/Commerce/Invoices/Api/BasicApi.php b/codegen/Crm/Commerce/Invoices/Api/BasicApi.php index 48f9d36a0..e1a39487a 100644 --- a/codegen/Crm/Commerce/Invoices/Api/BasicApi.php +++ b/codegen/Crm/Commerce/Invoices/Api/BasicApi.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 */ /** @@ -95,13 +95,13 @@ class BasicApi * @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; } @@ -189,18 +189,6 @@ public function archiveWithHttpInfo($invoice_id, string $contentType = self::con $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()]; @@ -431,18 +419,6 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 201: @@ -501,6 +477,19 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin ]; } + 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\Crm\Commerce\Invoices\Model\SimplePublicObject'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -726,11 +715,11 @@ public function createRequest($simple_public_object_input_for_create, string $co * Read * * @param string $invoice_id invoice_id (required) - * @param string[] $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[] $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[] $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) - * @param bool $archived Whether to return only results that have been archived. (optional, default to false) - * @param string $id_property The name of a property whose values are unique for this object (optional) + * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) + * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) + * @param string|null $id_property The name of a property whose values are unique for this object (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\Crm\Commerce\Invoices\ApiException on non-2xx response or if the response body is not in the expected format @@ -749,11 +738,11 @@ public function getById($invoice_id, $properties = null, $properties_with_histor * Read * * @param string $invoice_id (required) - * @param string[] $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[] $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[] $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) - * @param bool $archived Whether to return only results that have been archived. (optional, default to false) - * @param string $id_property The name of a property whose values are unique for this object (optional) + * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) + * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) + * @param string|null $id_property The name of a property whose values are unique for this object (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\Crm\Commerce\Invoices\ApiException on non-2xx response or if the response body is not in the expected format @@ -786,18 +775,6 @@ public function getByIdWithHttpInfo($invoice_id, $properties = null, $properties $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: @@ -856,6 +833,19 @@ public function getByIdWithHttpInfo($invoice_id, $properties = null, $properties ]; } + 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\Crm\Commerce\Invoices\Model\SimplePublicObjectWithAssociations'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -913,11 +903,11 @@ public function getByIdWithHttpInfo($invoice_id, $properties = null, $properties * Read * * @param string $invoice_id (required) - * @param string[] $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[] $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[] $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) - * @param bool $archived Whether to return only results that have been archived. (optional, default to false) - * @param string $id_property The name of a property whose values are unique for this object (optional) + * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) + * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) + * @param string|null $id_property The name of a property whose values are unique for this object (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 @@ -939,11 +929,11 @@ function ($response) { * Read * * @param string $invoice_id (required) - * @param string[] $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[] $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[] $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) - * @param bool $archived Whether to return only results that have been archived. (optional, default to false) - * @param string $id_property The name of a property whose values are unique for this object (optional) + * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) + * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) + * @param string|null $id_property The name of a property whose values are unique for this object (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 @@ -994,11 +984,11 @@ function ($exception) { * Create request for operation 'getById' * * @param string $invoice_id (required) - * @param string[] $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[] $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[] $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) - * @param bool $archived Whether to return only results that have been archived. (optional, default to false) - * @param string $id_property The name of a property whose values are unique for this object (optional) + * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) + * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) + * @param string|null $id_property The name of a property whose values are unique for this object (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 @@ -1146,12 +1136,12 @@ public function getByIdRequest($invoice_id, $properties = null, $properties_with * * List * - * @param int $limit The maximum number of results to display per page. (optional, default to 10) - * @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 string[] $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[] $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) - * @param string[] $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) - * @param bool $archived Whether to return only results that have been archived. (optional, default to false) + * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) + * @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 string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @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\Crm\Commerce\Invoices\ApiException on non-2xx response or if the response body is not in the expected format @@ -1169,12 +1159,12 @@ public function getPage($limit = 10, $after = null, $properties = null, $propert * * List * - * @param int $limit The maximum number of results to display per page. (optional, default to 10) - * @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 string[] $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[] $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) - * @param string[] $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) - * @param bool $archived Whether to return only results that have been archived. (optional, default to false) + * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) + * @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 string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @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\Crm\Commerce\Invoices\ApiException on non-2xx response or if the response body is not in the expected format @@ -1207,18 +1197,6 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = 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: @@ -1277,6 +1255,19 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = 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\Crm\Commerce\Invoices\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1333,12 +1324,12 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu * * List * - * @param int $limit The maximum number of results to display per page. (optional, default to 10) - * @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 string[] $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[] $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) - * @param string[] $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) - * @param bool $archived Whether to return only results that have been archived. (optional, default to false) + * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) + * @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 string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1359,12 +1350,12 @@ function ($response) { * * List * - * @param int $limit The maximum number of results to display per page. (optional, default to 10) - * @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 string[] $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[] $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) - * @param string[] $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) - * @param bool $archived Whether to return only results that have been archived. (optional, default to false) + * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) + * @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 string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1414,12 +1405,12 @@ function ($exception) { /** * Create request for operation 'getPage' * - * @param int $limit The maximum number of results to display per page. (optional, default to 10) - * @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 string[] $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[] $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) - * @param string[] $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) - * @param bool $archived Whether to return only results that have been archived. (optional, default to false) + * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) + * @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 string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) + * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1564,7 +1555,7 @@ public function getPageRequest($limit = 10, $after = null, $properties = null, $ * * @param string $invoice_id invoice_id (required) * @param \HubSpot\Client\Crm\Commerce\Invoices\Model\SimplePublicObjectInput $simple_public_object_input simple_public_object_input (required) - * @param string $id_property The name of a property whose values are unique for this object (optional) + * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Commerce\Invoices\ApiException on non-2xx response or if the response body is not in the expected format @@ -1584,7 +1575,7 @@ public function update($invoice_id, $simple_public_object_input, $id_property = * * @param string $invoice_id (required) * @param \HubSpot\Client\Crm\Commerce\Invoices\Model\SimplePublicObjectInput $simple_public_object_input (required) - * @param string $id_property The name of a property whose values are unique for this object (optional) + * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Commerce\Invoices\ApiException on non-2xx response or if the response body is not in the expected format @@ -1617,18 +1608,6 @@ public function updateWithHttpInfo($invoice_id, $simple_public_object_input, $id $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -1687,6 +1666,19 @@ public function updateWithHttpInfo($invoice_id, $simple_public_object_input, $id ]; } + 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\Crm\Commerce\Invoices\Model\SimplePublicObject'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1745,7 +1737,7 @@ public function updateWithHttpInfo($invoice_id, $simple_public_object_input, $id * * @param string $invoice_id (required) * @param \HubSpot\Client\Crm\Commerce\Invoices\Model\SimplePublicObjectInput $simple_public_object_input (required) - * @param string $id_property The name of a property whose values are unique for this object (optional) + * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1768,7 +1760,7 @@ function ($response) { * * @param string $invoice_id (required) * @param \HubSpot\Client\Crm\Commerce\Invoices\Model\SimplePublicObjectInput $simple_public_object_input (required) - * @param string $id_property The name of a property whose values are unique for this object (optional) + * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1820,7 +1812,7 @@ function ($exception) { * * @param string $invoice_id (required) * @param \HubSpot\Client\Crm\Commerce\Invoices\Model\SimplePublicObjectInput $simple_public_object_input (required) - * @param string $id_property The name of a property whose values are unique for this object (optional) + * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation * * @throws \InvalidArgumentException diff --git a/codegen/Crm/Commerce/Invoices/Api/BatchApi.php b/codegen/Crm/Commerce/Invoices/Api/BatchApi.php index c8936ab0f..7d1b3631a 100644 --- a/codegen/Crm/Commerce/Invoices/Api/BatchApi.php +++ b/codegen/Crm/Commerce/Invoices/Api/BatchApi.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 */ /** @@ -95,13 +95,13 @@ class BatchApi * @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; } @@ -189,18 +189,6 @@ public function archiveWithHttpInfo($batch_input_simple_public_object_id, string $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } return [null, $statusCode, $response->getHeaders()]; @@ -430,18 +418,6 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input $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: @@ -527,6 +503,19 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input ]; } + 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\Crm\Commerce\Invoices\Model\BatchResponseSimplePublicObject'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -760,7 +749,7 @@ public function createRequest($batch_input_simple_public_object_batch_input_for_ * Read a batch of invoices by internal ID, or unique property values * * @param \HubSpot\Client\Crm\Commerce\Invoices\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id batch_read_input_simple_public_object_id (required) - * @param bool $archived Whether to return only results that have been archived. (optional, default to false) + * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Commerce\Invoices\ApiException on non-2xx response or if the response body is not in the expected format @@ -779,7 +768,7 @@ public function read($batch_read_input_simple_public_object_id, $archived = fals * Read a batch of invoices by internal ID, or unique property values * * @param \HubSpot\Client\Crm\Commerce\Invoices\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id (required) - * @param bool $archived Whether to return only results that have been archived. (optional, default to false) + * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Commerce\Invoices\ApiException on non-2xx response or if the response body is not in the expected format @@ -812,18 +801,6 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc $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: @@ -909,6 +886,19 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc ]; } + 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\Crm\Commerce\Invoices\Model\BatchResponseSimplePublicObject'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -974,7 +964,7 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc * Read a batch of invoices by internal ID, or unique property values * * @param \HubSpot\Client\Crm\Commerce\Invoices\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id (required) - * @param bool $archived Whether to return only results that have been archived. (optional, default to false) + * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -996,7 +986,7 @@ function ($response) { * Read a batch of invoices by internal ID, or unique property values * * @param \HubSpot\Client\Crm\Commerce\Invoices\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id (required) - * @param bool $archived Whether to return only results that have been archived. (optional, default to false) + * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1047,7 +1037,7 @@ function ($exception) { * Create request for operation 'read' * * @param \HubSpot\Client\Crm\Commerce\Invoices\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id (required) - * @param bool $archived Whether to return only results that have been archived. (optional, default to false) + * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1205,18 +1195,6 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input $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: @@ -1302,6 +1280,19 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input ]; } + 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\Crm\Commerce\Invoices\Model\BatchResponseSimplePublicObject'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1585,18 +1576,6 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input $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: @@ -1682,6 +1661,19 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input ]; } + 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\Crm\Commerce\Invoices\Model\BatchResponseSimplePublicUpsertObject'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer diff --git a/codegen/Crm/Commerce/Invoices/Api/SearchApi.php b/codegen/Crm/Commerce/Invoices/Api/SearchApi.php index e7fb792e5..066a67f44 100644 --- a/codegen/Crm/Commerce/Invoices/Api/SearchApi.php +++ b/codegen/Crm/Commerce/Invoices/Api/SearchApi.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 */ /** @@ -83,13 +83,13 @@ class SearchApi * @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; } @@ -178,18 +178,6 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont $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: @@ -248,6 +236,19 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont ]; } + 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\Crm\Commerce\Invoices\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer diff --git a/codegen/Crm/Commerce/Invoices/ApiException.php b/codegen/Crm/Commerce/Invoices/ApiException.php index 0e1e3c871..1f685770a 100644 --- a/codegen/Crm/Commerce/Invoices/ApiException.php +++ b/codegen/Crm/Commerce/Invoices/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/Crm/Commerce/Invoices/Configuration.php b/codegen/Crm/Commerce/Invoices/Configuration.php index 8d8821a53..b0d698c39 100644 --- a/codegen/Crm/Commerce/Invoices/Configuration.php +++ b/codegen/Crm/Commerce/Invoices/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/Crm/Commerce/Invoices/HeaderSelector.php b/codegen/Crm/Commerce/Invoices/HeaderSelector.php index 319381090..28c941917 100644 --- a/codegen/Crm/Commerce/Invoices/HeaderSelector.php +++ b/codegen/Crm/Commerce/Invoices/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/Crm/Commerce/Invoices/Model/AssociatedId.php b/codegen/Crm/Commerce/Invoices/Model/AssociatedId.php index 06fc48d36..ece184bd9 100644 --- a/codegen/Crm/Commerce/Invoices/Model/AssociatedId.php +++ b/codegen/Crm/Commerce/Invoices/Model/AssociatedId.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('id', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/AssociationSpec.php b/codegen/Crm/Commerce/Invoices/Model/AssociationSpec.php index ac22199d3..7e50752bb 100644 --- a/codegen/Crm/Commerce/Invoices/Model/AssociationSpec.php +++ b/codegen/Crm/Commerce/Invoices/Model/AssociationSpec.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 */ /** @@ -262,10 +262,10 @@ public function getAssociationCategoryAllowableValues() /** * 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('association_category', $data ?? [], null); $this->setIfExists('association_type_id', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/BatchInputSimplePublicObjectBatchInput.php b/codegen/Crm/Commerce/Invoices/Model/BatchInputSimplePublicObjectBatchInput.php index 7715d9eda..52bee0cb3 100644 --- a/codegen/Crm/Commerce/Invoices/Model/BatchInputSimplePublicObjectBatchInput.php +++ b/codegen/Crm/Commerce/Invoices/Model/BatchInputSimplePublicObjectBatchInput.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('inputs', $data ?? [], null); } diff --git a/codegen/Crm/Commerce/Invoices/Model/BatchInputSimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Commerce/Invoices/Model/BatchInputSimplePublicObjectBatchInputForCreate.php index 016eaa656..742d8d127 100644 --- a/codegen/Crm/Commerce/Invoices/Model/BatchInputSimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Commerce/Invoices/Model/BatchInputSimplePublicObjectBatchInputForCreate.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('inputs', $data ?? [], null); } diff --git a/codegen/Crm/Commerce/Invoices/Model/BatchInputSimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Commerce/Invoices/Model/BatchInputSimplePublicObjectBatchInputUpsert.php index 6844c7f86..e987c210a 100644 --- a/codegen/Crm/Commerce/Invoices/Model/BatchInputSimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Commerce/Invoices/Model/BatchInputSimplePublicObjectBatchInputUpsert.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('inputs', $data ?? [], null); } diff --git a/codegen/Crm/Commerce/Invoices/Model/BatchInputSimplePublicObjectId.php b/codegen/Crm/Commerce/Invoices/Model/BatchInputSimplePublicObjectId.php index 728608f0a..c3fab0bc6 100644 --- a/codegen/Crm/Commerce/Invoices/Model/BatchInputSimplePublicObjectId.php +++ b/codegen/Crm/Commerce/Invoices/Model/BatchInputSimplePublicObjectId.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('inputs', $data ?? [], null); } diff --git a/codegen/Crm/Commerce/Invoices/Model/BatchReadInputSimplePublicObjectId.php b/codegen/Crm/Commerce/Invoices/Model/BatchReadInputSimplePublicObjectId.php index 59a49f640..d32fdbe03 100644 --- a/codegen/Crm/Commerce/Invoices/Model/BatchReadInputSimplePublicObjectId.php +++ b/codegen/Crm/Commerce/Invoices/Model/BatchReadInputSimplePublicObjectId.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 */ /** @@ -257,10 +257,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('properties_with_history', $data ?? [], null); $this->setIfExists('id_property', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/BatchResponseSimplePublicObject.php b/codegen/Crm/Commerce/Invoices/Model/BatchResponseSimplePublicObject.php index e835aa05b..5380b1432 100644 --- a/codegen/Crm/Commerce/Invoices/Model/BatchResponseSimplePublicObject.php +++ b/codegen/Crm/Commerce/Invoices/Model/BatchResponseSimplePublicObject.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 */ /** @@ -288,10 +288,10 @@ public function getStatusAllowableValues() /** * 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('completed_at', $data ?? [], null); $this->setIfExists('requested_at', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/BatchResponseSimplePublicObjectWithErrors.php b/codegen/Crm/Commerce/Invoices/Model/BatchResponseSimplePublicObjectWithErrors.php index 462713d8a..2340d055f 100644 --- a/codegen/Crm/Commerce/Invoices/Model/BatchResponseSimplePublicObjectWithErrors.php +++ b/codegen/Crm/Commerce/Invoices/Model/BatchResponseSimplePublicObjectWithErrors.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 */ /** @@ -300,10 +300,10 @@ public function getStatusAllowableValues() /** * 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('completed_at', $data ?? [], null); $this->setIfExists('num_errors', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/BatchResponseSimplePublicUpsertObject.php b/codegen/Crm/Commerce/Invoices/Model/BatchResponseSimplePublicUpsertObject.php index 75c1ec9f2..c79e74724 100644 --- a/codegen/Crm/Commerce/Invoices/Model/BatchResponseSimplePublicUpsertObject.php +++ b/codegen/Crm/Commerce/Invoices/Model/BatchResponseSimplePublicUpsertObject.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 */ /** @@ -288,10 +288,10 @@ public function getStatusAllowableValues() /** * 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('completed_at', $data ?? [], null); $this->setIfExists('requested_at', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php b/codegen/Crm/Commerce/Invoices/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php index d42718ddf..8635da7f5 100644 --- a/codegen/Crm/Commerce/Invoices/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php +++ b/codegen/Crm/Commerce/Invoices/Model/BatchResponseSimplePublicUpsertObjectWithErrors.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 */ /** @@ -300,10 +300,10 @@ public function getStatusAllowableValues() /** * 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('completed_at', $data ?? [], null); $this->setIfExists('num_errors', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/CollectionResponseAssociatedId.php b/codegen/Crm/Commerce/Invoices/Model/CollectionResponseAssociatedId.php index e36935046..9f2a57e57 100644 --- a/codegen/Crm/Commerce/Invoices/Model/CollectionResponseAssociatedId.php +++ b/codegen/Crm/Commerce/Invoices/Model/CollectionResponseAssociatedId.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/Crm/Commerce/Invoices/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php b/codegen/Crm/Commerce/Invoices/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php index 0f3180fb6..5204a10e9 100644 --- a/codegen/Crm/Commerce/Invoices/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php +++ b/codegen/Crm/Commerce/Invoices/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.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/Crm/Commerce/Invoices/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php b/codegen/Crm/Commerce/Invoices/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php index 790d93629..176f5c005 100644 --- a/codegen/Crm/Commerce/Invoices/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php +++ b/codegen/Crm/Commerce/Invoices/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.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 */ /** @@ -251,10 +251,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('total', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/Error.php b/codegen/Crm/Commerce/Invoices/Model/Error.php index d53994f79..d40a8746d 100644 --- a/codegen/Crm/Commerce/Invoices/Model/Error.php +++ b/codegen/Crm/Commerce/Invoices/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/Crm/Commerce/Invoices/Model/ErrorDetail.php b/codegen/Crm/Commerce/Invoices/Model/ErrorDetail.php index bfa3909ee..72f28813f 100644 --- a/codegen/Crm/Commerce/Invoices/Model/ErrorDetail.php +++ b/codegen/Crm/Commerce/Invoices/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/Crm/Commerce/Invoices/Model/Filter.php b/codegen/Crm/Commerce/Invoices/Model/Filter.php index db212f1f5..a1e45c9ea 100644 --- a/codegen/Crm/Commerce/Invoices/Model/Filter.php +++ b/codegen/Crm/Commerce/Invoices/Model/Filter.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 */ /** @@ -300,10 +300,10 @@ public function getOperatorAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('high_value', $data ?? [], null); $this->setIfExists('property_name', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/FilterGroup.php b/codegen/Crm/Commerce/Invoices/Model/FilterGroup.php index f86db0929..124259385 100644 --- a/codegen/Crm/Commerce/Invoices/Model/FilterGroup.php +++ b/codegen/Crm/Commerce/Invoices/Model/FilterGroup.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('filters', $data ?? [], null); } diff --git a/codegen/Crm/Commerce/Invoices/Model/ForwardPaging.php b/codegen/Crm/Commerce/Invoices/Model/ForwardPaging.php index af647683e..19a3fb0d1 100644 --- a/codegen/Crm/Commerce/Invoices/Model/ForwardPaging.php +++ b/codegen/Crm/Commerce/Invoices/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/Crm/Commerce/Invoices/Model/ModelInterface.php b/codegen/Crm/Commerce/Invoices/Model/ModelInterface.php index 07b2c54b2..ecf62e26d 100644 --- a/codegen/Crm/Commerce/Invoices/Model/ModelInterface.php +++ b/codegen/Crm/Commerce/Invoices/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/Crm/Commerce/Invoices/Model/NextPage.php b/codegen/Crm/Commerce/Invoices/Model/NextPage.php index 7b44c0259..dd0c50b4d 100644 --- a/codegen/Crm/Commerce/Invoices/Model/NextPage.php +++ b/codegen/Crm/Commerce/Invoices/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/Crm/Commerce/Invoices/Model/Paging.php b/codegen/Crm/Commerce/Invoices/Model/Paging.php index 66946fd40..03ab64b47 100644 --- a/codegen/Crm/Commerce/Invoices/Model/Paging.php +++ b/codegen/Crm/Commerce/Invoices/Model/Paging.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('next', $data ?? [], null); $this->setIfExists('prev', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/PreviousPage.php b/codegen/Crm/Commerce/Invoices/Model/PreviousPage.php index f029cccf4..583b429bc 100644 --- a/codegen/Crm/Commerce/Invoices/Model/PreviousPage.php +++ b/codegen/Crm/Commerce/Invoices/Model/PreviousPage.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('before', $data ?? [], null); $this->setIfExists('link', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/PublicAssociationsForObject.php b/codegen/Crm/Commerce/Invoices/Model/PublicAssociationsForObject.php index e61daef3e..d8f9a555c 100644 --- a/codegen/Crm/Commerce/Invoices/Model/PublicAssociationsForObject.php +++ b/codegen/Crm/Commerce/Invoices/Model/PublicAssociationsForObject.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('types', $data ?? [], null); $this->setIfExists('to', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/PublicObjectId.php b/codegen/Crm/Commerce/Invoices/Model/PublicObjectId.php index 6bdc25d87..30fc6de4d 100644 --- a/codegen/Crm/Commerce/Invoices/Model/PublicObjectId.php +++ b/codegen/Crm/Commerce/Invoices/Model/PublicObjectId.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('id', $data ?? [], null); } diff --git a/codegen/Crm/Commerce/Invoices/Model/PublicObjectSearchRequest.php b/codegen/Crm/Commerce/Invoices/Model/PublicObjectSearchRequest.php index e83c07596..c6484d76a 100644 --- a/codegen/Crm/Commerce/Invoices/Model/PublicObjectSearchRequest.php +++ b/codegen/Crm/Commerce/Invoices/Model/PublicObjectSearchRequest.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('query', $data ?? [], null); $this->setIfExists('limit', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/SimplePublicObject.php b/codegen/Crm/Commerce/Invoices/Model/SimplePublicObject.php index ef11ce71d..fe605ed3a 100644 --- a/codegen/Crm/Commerce/Invoices/Model/SimplePublicObject.php +++ b/codegen/Crm/Commerce/Invoices/Model/SimplePublicObject.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 */ /** @@ -281,10 +281,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('created_at', $data ?? [], null); $this->setIfExists('archived', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectBatchInput.php b/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectBatchInput.php index d126424ca..df3885e08 100644 --- a/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectBatchInput.php +++ b/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectBatchInput.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 */ /** @@ -257,10 +257,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id_property', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectBatchInputForCreate.php index 62a1f8690..e38875898 100644 --- a/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectBatchInputForCreate.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 */ /** @@ -251,10 +251,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('associations', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectBatchInputUpsert.php index fa61f4249..728d0251b 100644 --- a/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectBatchInputUpsert.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 */ /** @@ -257,10 +257,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id_property', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectId.php b/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectId.php index 05eb67904..b4b9a8bc5 100644 --- a/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectId.php +++ b/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectId.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('id', $data ?? [], null); } diff --git a/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectInput.php b/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectInput.php index 29e30786f..1c9f0e9a7 100644 --- a/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectInput.php +++ b/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectInput.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('properties', $data ?? [], null); } diff --git a/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectInputForCreate.php b/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectInputForCreate.php index 72f7abfd5..15fd717fc 100644 --- a/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectInputForCreate.php +++ b/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectInputForCreate.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('associations', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectWithAssociations.php b/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectWithAssociations.php index 5d93ca069..9ec9a7040 100644 --- a/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectWithAssociations.php +++ b/codegen/Crm/Commerce/Invoices/Model/SimplePublicObjectWithAssociations.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 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('associations', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/SimplePublicUpsertObject.php b/codegen/Crm/Commerce/Invoices/Model/SimplePublicUpsertObject.php index 7f00f2541..c1d61a700 100644 --- a/codegen/Crm/Commerce/Invoices/Model/SimplePublicUpsertObject.php +++ b/codegen/Crm/Commerce/Invoices/Model/SimplePublicUpsertObject.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 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('created_at', $data ?? [], null); $this->setIfExists('archived', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/Model/StandardError.php b/codegen/Crm/Commerce/Invoices/Model/StandardError.php index e039248fc..2033d3c31 100644 --- a/codegen/Crm/Commerce/Invoices/Model/StandardError.php +++ b/codegen/Crm/Commerce/Invoices/Model/StandardError.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 */ /** @@ -281,10 +281,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/Crm/Commerce/Invoices/Model/ValueWithTimestamp.php b/codegen/Crm/Commerce/Invoices/Model/ValueWithTimestamp.php index 075ea497c..da33a5cff 100644 --- a/codegen/Crm/Commerce/Invoices/Model/ValueWithTimestamp.php +++ b/codegen/Crm/Commerce/Invoices/Model/ValueWithTimestamp.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('source_id', $data ?? [], null); $this->setIfExists('source_type', $data ?? [], null); diff --git a/codegen/Crm/Commerce/Invoices/ObjectSerializer.php b/codegen/Crm/Commerce/Invoices/ObjectSerializer.php index 0bb87b2ac..d45ac671d 100644 --- a/codegen/Crm/Commerce/Invoices/ObjectSerializer.php +++ b/codegen/Crm/Commerce/Invoices/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) : ''; } } diff --git a/codegen/Crm/Exports/Api/PublicExportsApi.php b/codegen/Crm/Exports/Api/PublicExportsApi.php index 40eda65b1..9a5e751df 100644 --- a/codegen/Crm/Exports/Api/PublicExportsApi.php +++ b/codegen/Crm/Exports/Api/PublicExportsApi.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 */ /** @@ -86,13 +86,13 @@ class PublicExportsApi * @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; } @@ -181,18 +181,6 @@ public function getStatusWithHttpInfo($task_id, string $contentType = self::cont $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: @@ -251,6 +239,19 @@ public function getStatusWithHttpInfo($task_id, string $contentType = self::cont ]; } + 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\Crm\Exports\Model\ActionResponseWithSingleResultURI'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -527,18 +528,6 @@ public function startWithHttpInfo($public_export_request, string $contentType = $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 202: @@ -597,6 +586,19 @@ public function startWithHttpInfo($public_export_request, string $contentType = ]; } + 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\Crm\Exports\Model\TaskLocator'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer diff --git a/codegen/Crm/Exports/ApiException.php b/codegen/Crm/Exports/ApiException.php index c9726b879..77c559aa7 100644 --- a/codegen/Crm/Exports/ApiException.php +++ b/codegen/Crm/Exports/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/Crm/Exports/Configuration.php b/codegen/Crm/Exports/Configuration.php index 96c02ddaa..83e209bd2 100644 --- a/codegen/Crm/Exports/Configuration.php +++ b/codegen/Crm/Exports/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/Crm/Exports/HeaderSelector.php b/codegen/Crm/Exports/HeaderSelector.php index 08ba0bc2f..0756e1307 100644 --- a/codegen/Crm/Exports/HeaderSelector.php +++ b/codegen/Crm/Exports/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/Crm/Exports/Model/ActionResponseWithSingleResultURI.php b/codegen/Crm/Exports/Model/ActionResponseWithSingleResultURI.php index d8ca1cae1..8e987df07 100644 --- a/codegen/Crm/Exports/Model/ActionResponseWithSingleResultURI.php +++ b/codegen/Crm/Exports/Model/ActionResponseWithSingleResultURI.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 */ /** @@ -300,10 +300,10 @@ public function getStatusAllowableValues() /** * 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('result', $data ?? [], null); $this->setIfExists('completed_at', $data ?? [], null); diff --git a/codegen/Crm/Exports/Model/Error.php b/codegen/Crm/Exports/Model/Error.php index 367351c9b..21149fe24 100644 --- a/codegen/Crm/Exports/Model/Error.php +++ b/codegen/Crm/Exports/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/Crm/Exports/Model/ErrorDetail.php b/codegen/Crm/Exports/Model/ErrorDetail.php index c88486a22..40f0311dc 100644 --- a/codegen/Crm/Exports/Model/ErrorDetail.php +++ b/codegen/Crm/Exports/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/Crm/Exports/Model/Filter.php b/codegen/Crm/Exports/Model/Filter.php index c7d01fee0..6d3c0694a 100644 --- a/codegen/Crm/Exports/Model/Filter.php +++ b/codegen/Crm/Exports/Model/Filter.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 */ /** @@ -296,10 +296,10 @@ public function getOperatorAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('high_value', $data ?? [], null); $this->setIfExists('property_name', $data ?? [], null); diff --git a/codegen/Crm/Exports/Model/ModelInterface.php b/codegen/Crm/Exports/Model/ModelInterface.php index ddcbed30f..322049a36 100644 --- a/codegen/Crm/Exports/Model/ModelInterface.php +++ b/codegen/Crm/Exports/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/Crm/Exports/Model/PublicCrmSearchRequest.php b/codegen/Crm/Exports/Model/PublicCrmSearchRequest.php index 4b3a38d5b..d9e1d489f 100644 --- a/codegen/Crm/Exports/Model/PublicCrmSearchRequest.php +++ b/codegen/Crm/Exports/Model/PublicCrmSearchRequest.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 */ /** @@ -251,10 +251,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('query', $data ?? [], null); $this->setIfExists('filters', $data ?? [], null); diff --git a/codegen/Crm/Exports/Model/PublicExportListRequest.php b/codegen/Crm/Exports/Model/PublicExportListRequest.php index c50629370..b320adaaa 100644 --- a/codegen/Crm/Exports/Model/PublicExportListRequest.php +++ b/codegen/Crm/Exports/Model/PublicExportListRequest.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 */ /** @@ -383,10 +383,10 @@ public function getExportInternalValuesOptionsAllowableValues() /** * 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('export_type', $data ?? [], 'LIST'); $this->setIfExists('format', $data ?? [], null); diff --git a/codegen/Crm/Exports/Model/PublicExportRequest.php b/codegen/Crm/Exports/Model/PublicExportRequest.php index fe97027e7..a6dfe3241 100644 --- a/codegen/Crm/Exports/Model/PublicExportRequest.php +++ b/codegen/Crm/Exports/Model/PublicExportRequest.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 */ /** @@ -383,10 +383,10 @@ public function getExportInternalValuesOptionsAllowableValues() /** * 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('export_type', $data ?? [], 'LIST'); $this->setIfExists('format', $data ?? [], null); diff --git a/codegen/Crm/Exports/Model/PublicExportViewRequest.php b/codegen/Crm/Exports/Model/PublicExportViewRequest.php index f302ad82c..fbd19cd5e 100644 --- a/codegen/Crm/Exports/Model/PublicExportViewRequest.php +++ b/codegen/Crm/Exports/Model/PublicExportViewRequest.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 */ /** @@ -383,10 +383,10 @@ public function getExportInternalValuesOptionsAllowableValues() /** * 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('export_type', $data ?? [], 'VIEW'); $this->setIfExists('format', $data ?? [], null); diff --git a/codegen/Crm/Exports/Model/StandardError.php b/codegen/Crm/Exports/Model/StandardError.php index 5dc1c38e6..6300ce128 100644 --- a/codegen/Crm/Exports/Model/StandardError.php +++ b/codegen/Crm/Exports/Model/StandardError.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 */ /** @@ -281,10 +281,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/Crm/Exports/Model/TaskLocator.php b/codegen/Crm/Exports/Model/TaskLocator.php index 825cfe40e..2f1bdf6a4 100644 --- a/codegen/Crm/Exports/Model/TaskLocator.php +++ b/codegen/Crm/Exports/Model/TaskLocator.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('links', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); diff --git a/codegen/Crm/Exports/ObjectSerializer.php b/codegen/Crm/Exports/ObjectSerializer.php index 13d7492cb..415f1f42f 100644 --- a/codegen/Crm/Exports/ObjectSerializer.php +++ b/codegen/Crm/Exports/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) : ''; } } diff --git a/codegen/Crm/Objects/DealSplits/Api/BatchApi.php b/codegen/Crm/Objects/DealSplits/Api/BatchApi.php index 456078b9f..1bc7a755e 100644 --- a/codegen/Crm/Objects/DealSplits/Api/BatchApi.php +++ b/codegen/Crm/Objects/DealSplits/Api/BatchApi.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 */ /** @@ -86,13 +86,13 @@ class BatchApi * @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; } @@ -181,18 +181,6 @@ public function readWithHttpInfo($batch_input_public_object_id, string $contentT $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -278,6 +266,19 @@ public function readWithHttpInfo($batch_input_public_object_id, 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\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplits'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -561,18 +562,6 @@ public function upsertWithHttpInfo($public_deal_splits_batch_create_request, str $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: @@ -658,6 +647,19 @@ public function upsertWithHttpInfo($public_deal_splits_batch_create_request, str ]; } + 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\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplits'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer diff --git a/codegen/Crm/Objects/DealSplits/ApiException.php b/codegen/Crm/Objects/DealSplits/ApiException.php index 102f86b43..4f24fb6d3 100644 --- a/codegen/Crm/Objects/DealSplits/ApiException.php +++ b/codegen/Crm/Objects/DealSplits/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/Crm/Objects/DealSplits/Configuration.php b/codegen/Crm/Objects/DealSplits/Configuration.php index a4a60c3a7..597f732a9 100644 --- a/codegen/Crm/Objects/DealSplits/Configuration.php +++ b/codegen/Crm/Objects/DealSplits/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/Crm/Objects/DealSplits/HeaderSelector.php b/codegen/Crm/Objects/DealSplits/HeaderSelector.php index 42e7291c3..76773f283 100644 --- a/codegen/Crm/Objects/DealSplits/HeaderSelector.php +++ b/codegen/Crm/Objects/DealSplits/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/Crm/Objects/DealSplits/Model/BatchInputPublicObjectId.php b/codegen/Crm/Objects/DealSplits/Model/BatchInputPublicObjectId.php index 6b12776e0..7d8e3800c 100644 --- a/codegen/Crm/Objects/DealSplits/Model/BatchInputPublicObjectId.php +++ b/codegen/Crm/Objects/DealSplits/Model/BatchInputPublicObjectId.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('inputs', $data ?? [], null); } diff --git a/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplits.php b/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplits.php index 133ca900b..ddcbae548 100644 --- a/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplits.php +++ b/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplits.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 */ /** @@ -288,10 +288,10 @@ public function getStatusAllowableValues() /** * 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('completed_at', $data ?? [], null); $this->setIfExists('requested_at', $data ?? [], null); diff --git a/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplitsWithErrors.php b/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplitsWithErrors.php index 67479f388..6dddfdd8d 100644 --- a/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplitsWithErrors.php +++ b/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplitsWithErrors.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 */ /** @@ -300,10 +300,10 @@ public function getStatusAllowableValues() /** * 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('completed_at', $data ?? [], null); $this->setIfExists('num_errors', $data ?? [], null); diff --git a/codegen/Crm/Objects/DealSplits/Model/DealToDealSplits.php b/codegen/Crm/Objects/DealSplits/Model/DealToDealSplits.php index a9d977dad..64b72ae45 100644 --- a/codegen/Crm/Objects/DealSplits/Model/DealToDealSplits.php +++ b/codegen/Crm/Objects/DealSplits/Model/DealToDealSplits.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('splits', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); diff --git a/codegen/Crm/Objects/DealSplits/Model/Error.php b/codegen/Crm/Objects/DealSplits/Model/Error.php index 3dc56c854..c0a97e7a1 100644 --- a/codegen/Crm/Objects/DealSplits/Model/Error.php +++ b/codegen/Crm/Objects/DealSplits/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/Crm/Objects/DealSplits/Model/ErrorDetail.php b/codegen/Crm/Objects/DealSplits/Model/ErrorDetail.php index a8b902977..02f017951 100644 --- a/codegen/Crm/Objects/DealSplits/Model/ErrorDetail.php +++ b/codegen/Crm/Objects/DealSplits/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/Crm/Objects/DealSplits/Model/ModelInterface.php b/codegen/Crm/Objects/DealSplits/Model/ModelInterface.php index 21686a24c..960047d81 100644 --- a/codegen/Crm/Objects/DealSplits/Model/ModelInterface.php +++ b/codegen/Crm/Objects/DealSplits/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/Crm/Objects/DealSplits/Model/PublicDealSplitInput.php b/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitInput.php index fb5573e15..dc3e40406 100644 --- a/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitInput.php +++ b/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitInput.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('percentage', $data ?? [], null); $this->setIfExists('owner_id', $data ?? [], null); diff --git a/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsBatchCreateRequest.php b/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsBatchCreateRequest.php index 1c228be91..a7796ccf6 100644 --- a/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsBatchCreateRequest.php +++ b/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsBatchCreateRequest.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('inputs', $data ?? [], null); } diff --git a/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsCreateRequest.php b/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsCreateRequest.php index 4d533cccc..01b3123e2 100644 --- a/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsCreateRequest.php +++ b/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsCreateRequest.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('splits', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); diff --git a/codegen/Crm/Objects/DealSplits/Model/PublicObjectId.php b/codegen/Crm/Objects/DealSplits/Model/PublicObjectId.php index 1118a7c57..e682009f9 100644 --- a/codegen/Crm/Objects/DealSplits/Model/PublicObjectId.php +++ b/codegen/Crm/Objects/DealSplits/Model/PublicObjectId.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('id', $data ?? [], null); } diff --git a/codegen/Crm/Objects/DealSplits/Model/SimplePublicObject.php b/codegen/Crm/Objects/DealSplits/Model/SimplePublicObject.php index 449a77c5f..12579b106 100644 --- a/codegen/Crm/Objects/DealSplits/Model/SimplePublicObject.php +++ b/codegen/Crm/Objects/DealSplits/Model/SimplePublicObject.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('created_at', $data ?? [], null); $this->setIfExists('archived', $data ?? [], null); diff --git a/codegen/Crm/Objects/DealSplits/Model/StandardError.php b/codegen/Crm/Objects/DealSplits/Model/StandardError.php index f6704d70c..cf5e8f5dc 100644 --- a/codegen/Crm/Objects/DealSplits/Model/StandardError.php +++ b/codegen/Crm/Objects/DealSplits/Model/StandardError.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 */ /** @@ -281,10 +281,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/Crm/Objects/DealSplits/Model/ValueWithTimestamp.php b/codegen/Crm/Objects/DealSplits/Model/ValueWithTimestamp.php index 6bbdbda92..2fd868312 100644 --- a/codegen/Crm/Objects/DealSplits/Model/ValueWithTimestamp.php +++ b/codegen/Crm/Objects/DealSplits/Model/ValueWithTimestamp.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('source_id', $data ?? [], null); $this->setIfExists('source_type', $data ?? [], null); diff --git a/codegen/Crm/Objects/DealSplits/ObjectSerializer.php b/codegen/Crm/Objects/DealSplits/ObjectSerializer.php index 7044c658f..e13415781 100644 --- a/codegen/Crm/Objects/DealSplits/ObjectSerializer.php +++ b/codegen/Crm/Objects/DealSplits/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) : ''; } } diff --git a/codegen/Marketing/Emails/Api/MarketingEmailsApi.php b/codegen/Marketing/Emails/Api/MarketingEmailsApi.php index cb4efe504..ccb8e977d 100644 --- a/codegen/Marketing/Emails/Api/MarketingEmailsApi.php +++ b/codegen/Marketing/Emails/Api/MarketingEmailsApi.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 */ /** @@ -131,13 +131,13 @@ class MarketingEmailsApi * @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; } @@ -176,7 +176,7 @@ public function getConfig() * Delete a marketing email. * * @param string $email_id The ID of the marketing email to delete. (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['archive'] to see the possible values for this operation * * @throws \HubSpot\Client\Marketing\Emails\ApiException on non-2xx response or if the response body is not in the expected format @@ -194,7 +194,7 @@ public function archive($email_id, $archived = null, string $contentType = self: * Delete a marketing email. * * @param string $email_id The ID of the marketing email to delete. (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['archive'] to see the possible values for this operation * * @throws \HubSpot\Client\Marketing\Emails\ApiException on non-2xx response or if the response body is not in the expected format @@ -227,18 +227,6 @@ public function archiveWithHttpInfo($email_id, $archived = null, string $content $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()]; @@ -263,7 +251,7 @@ public function archiveWithHttpInfo($email_id, $archived = null, string $content * Delete a marketing email. * * @param string $email_id The ID of the marketing email to delete. (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['archive'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -285,7 +273,7 @@ function ($response) { * Delete a marketing email. * * @param string $email_id The ID of the marketing email to delete. (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['archive'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -323,7 +311,7 @@ function ($exception) { * Create request for operation 'archive' * * @param string $email_id The ID of the marketing email to delete. (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['archive'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -482,18 +470,6 @@ public function callCloneWithHttpInfo($content_clone_request_v_next, string $con $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: @@ -552,6 +528,19 @@ public function callCloneWithHttpInfo($content_clone_request_v_next, string $con ]; } + 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\Emails\Model\PublicEmail'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -827,18 +816,6 @@ public function createWithHttpInfo($email_create_request, string $contentType = $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 201: @@ -897,6 +874,19 @@ public function createWithHttpInfo($email_create_request, string $contentType = ]; } + 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\Emails\Model\PublicEmail'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1172,18 +1162,6 @@ public function createAbTestVariationWithHttpInfo($ab_test_create_request_v_next $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: @@ -1242,6 +1220,19 @@ public function createAbTestVariationWithHttpInfo($ab_test_create_request_v_next ]; } + 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\Emails\Model\PublicEmail'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1517,18 +1508,6 @@ public function getAbTestVariationWithHttpInfo($email_id, string $contentType = $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -1587,6 +1566,19 @@ public function getAbTestVariationWithHttpInfo($email_id, string $contentType = ]; } + 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\Emails\Model\PublicEmail'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1813,11 +1805,11 @@ public function getAbTestVariationRequest($email_id, string $contentType = self: * Get the details of a specified marketing email. * * @param string $email_id The marketing email ID. (required) - * @param bool $include_stats Include statistics with email (optional) - * @param bool $marketing_campaign_names marketing_campaign_names (optional) - * @param bool $workflow_names workflow_names (optional) - * @param string[] $included_properties included_properties (optional) - * @param bool $archived Whether to return only results that have been archived. (optional) + * @param bool|null $include_stats Include statistics with email (optional) + * @param bool|null $marketing_campaign_names marketing_campaign_names (optional) + * @param bool|null $workflow_names workflow_names (optional) + * @param string[]|null $included_properties included_properties (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\Emails\ApiException on non-2xx response or if the response body is not in the expected format @@ -1836,11 +1828,11 @@ public function getById($email_id, $include_stats = null, $marketing_campaign_na * Get the details of a specified marketing email. * * @param string $email_id The marketing email ID. (required) - * @param bool $include_stats Include statistics with email (optional) - * @param bool $marketing_campaign_names (optional) - * @param bool $workflow_names (optional) - * @param string[] $included_properties (optional) - * @param bool $archived Whether to return only results that have been archived. (optional) + * @param bool|null $include_stats Include statistics with email (optional) + * @param bool|null $marketing_campaign_names (optional) + * @param bool|null $workflow_names (optional) + * @param string[]|null $included_properties (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\Emails\ApiException on non-2xx response or if the response body is not in the expected format @@ -1873,18 +1865,6 @@ public function getByIdWithHttpInfo($email_id, $include_stats = null, $marketing $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: @@ -1943,6 +1923,19 @@ public function getByIdWithHttpInfo($email_id, $include_stats = null, $marketing ]; } + 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\Emails\Model\PublicEmail'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2000,11 +1993,11 @@ public function getByIdWithHttpInfo($email_id, $include_stats = null, $marketing * Get the details of a specified marketing email. * * @param string $email_id The marketing email ID. (required) - * @param bool $include_stats Include statistics with email (optional) - * @param bool $marketing_campaign_names (optional) - * @param bool $workflow_names (optional) - * @param string[] $included_properties (optional) - * @param bool $archived Whether to return only results that have been archived. (optional) + * @param bool|null $include_stats Include statistics with email (optional) + * @param bool|null $marketing_campaign_names (optional) + * @param bool|null $workflow_names (optional) + * @param string[]|null $included_properties (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 @@ -2026,11 +2019,11 @@ function ($response) { * Get the details of a specified marketing email. * * @param string $email_id The marketing email ID. (required) - * @param bool $include_stats Include statistics with email (optional) - * @param bool $marketing_campaign_names (optional) - * @param bool $workflow_names (optional) - * @param string[] $included_properties (optional) - * @param bool $archived Whether to return only results that have been archived. (optional) + * @param bool|null $include_stats Include statistics with email (optional) + * @param bool|null $marketing_campaign_names (optional) + * @param bool|null $workflow_names (optional) + * @param string[]|null $included_properties (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 @@ -2081,11 +2074,11 @@ function ($exception) { * Create request for operation 'getById' * * @param string $email_id The marketing email ID. (required) - * @param bool $include_stats Include statistics with email (optional) - * @param bool $marketing_campaign_names (optional) - * @param bool $workflow_names (optional) - * @param string[] $included_properties (optional) - * @param bool $archived Whether to return only results that have been archived. (optional) + * @param bool|null $include_stats Include statistics with email (optional) + * @param bool|null $marketing_campaign_names (optional) + * @param bool|null $workflow_names (optional) + * @param string[]|null $included_properties (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 @@ -2284,18 +2277,6 @@ public function getDraftWithHttpInfo($email_id, string $contentType = self::cont $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: @@ -2354,6 +2335,19 @@ public function getDraftWithHttpInfo($email_id, string $contentType = self::cont ]; } + 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\Emails\Model\PublicEmail'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2579,22 +2573,22 @@ public function getDraftRequest($email_id, string $contentType = self::contentTy * * Get all marketing emails for a HubSpot account. * - * @param \DateTime $created_at Only return emails created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return emails created after the specified time. (optional) - * @param \DateTime $created_before Only return emails created before the specified time. (optional) - * @param \DateTime $updated_at Only return emails last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return emails last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return emails last updated before the specified time. (optional) - * @param string[] $sort Specifies which fields to use for sorting results. Valid fields are `name`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy`. `createdAt` will be used by default. (optional) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to return. Default is 100. (optional) - * @param bool $include_stats Include statistics with emails. (optional) - * @param bool $marketing_campaign_names marketing_campaign_names (optional) - * @param bool $workflow_names workflow_names (optional) - * @param string $type Email types to be filtered by. Multiple types can be included. All emails will be returned if not present. (optional) - * @param bool $is_published Filter by published/draft emails. All emails will be returned if not present. (optional) - * @param string[] $included_properties included_properties (optional) - * @param bool $archived Specifies whether to return archived emails. Defaults to `false`. (optional) + * @param \DateTime|null $created_at Only return emails created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return emails created after the specified time. (optional) + * @param \DateTime|null $created_before Only return emails created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return emails last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return emails last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return emails last updated before the specified time. (optional) + * @param string[]|null $sort Specifies which fields to use for sorting results. Valid fields are `name`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy`. `createdAt` will be used by default. (optional) + * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to return. Default is 100. (optional) + * @param bool|null $include_stats Include statistics with emails. (optional) + * @param bool|null $marketing_campaign_names marketing_campaign_names (optional) + * @param bool|null $workflow_names workflow_names (optional) + * @param string|null $type Email types to be filtered by. Multiple types can be included. All emails will be returned if not present. (optional) + * @param bool|null $is_published Filter by published/draft emails. All emails will be returned if not present. (optional) + * @param string[]|null $included_properties included_properties (optional) + * @param bool|null $archived Specifies whether to return archived emails. Defaults to `false`. (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\Emails\ApiException on non-2xx response or if the response body is not in the expected format @@ -2612,22 +2606,22 @@ public function getPage($created_at = null, $created_after = null, $created_befo * * Get all marketing emails for a HubSpot account. * - * @param \DateTime $created_at Only return emails created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return emails created after the specified time. (optional) - * @param \DateTime $created_before Only return emails created before the specified time. (optional) - * @param \DateTime $updated_at Only return emails last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return emails last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return emails last updated before the specified time. (optional) - * @param string[] $sort Specifies which fields to use for sorting results. Valid fields are `name`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy`. `createdAt` will be used by default. (optional) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to return. Default is 100. (optional) - * @param bool $include_stats Include statistics with emails. (optional) - * @param bool $marketing_campaign_names (optional) - * @param bool $workflow_names (optional) - * @param string $type Email types to be filtered by. Multiple types can be included. All emails will be returned if not present. (optional) - * @param bool $is_published Filter by published/draft emails. All emails will be returned if not present. (optional) - * @param string[] $included_properties (optional) - * @param bool $archived Specifies whether to return archived emails. Defaults to `false`. (optional) + * @param \DateTime|null $created_at Only return emails created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return emails created after the specified time. (optional) + * @param \DateTime|null $created_before Only return emails created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return emails last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return emails last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return emails last updated before the specified time. (optional) + * @param string[]|null $sort Specifies which fields to use for sorting results. Valid fields are `name`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy`. `createdAt` will be used by default. (optional) + * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to return. Default is 100. (optional) + * @param bool|null $include_stats Include statistics with emails. (optional) + * @param bool|null $marketing_campaign_names (optional) + * @param bool|null $workflow_names (optional) + * @param string|null $type Email types to be filtered by. Multiple types can be included. All emails will be returned if not present. (optional) + * @param bool|null $is_published Filter by published/draft emails. All emails will be returned if not present. (optional) + * @param string[]|null $included_properties (optional) + * @param bool|null $archived Specifies whether to return archived emails. Defaults to `false`. (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\Emails\ApiException on non-2xx response or if the response body is not in the expected format @@ -2660,18 +2654,6 @@ public function getPageWithHttpInfo($created_at = null, $created_after = null, $ $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -2730,6 +2712,19 @@ public function getPageWithHttpInfo($created_at = null, $created_after = null, $ ]; } + 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\Emails\Model\CollectionResponseWithTotalPublicEmailForwardPaging'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2786,22 +2781,22 @@ public function getPageWithHttpInfo($created_at = null, $created_after = null, $ * * Get all marketing emails for a HubSpot account. * - * @param \DateTime $created_at Only return emails created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return emails created after the specified time. (optional) - * @param \DateTime $created_before Only return emails created before the specified time. (optional) - * @param \DateTime $updated_at Only return emails last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return emails last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return emails last updated before the specified time. (optional) - * @param string[] $sort Specifies which fields to use for sorting results. Valid fields are `name`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy`. `createdAt` will be used by default. (optional) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to return. Default is 100. (optional) - * @param bool $include_stats Include statistics with emails. (optional) - * @param bool $marketing_campaign_names (optional) - * @param bool $workflow_names (optional) - * @param string $type Email types to be filtered by. Multiple types can be included. All emails will be returned if not present. (optional) - * @param bool $is_published Filter by published/draft emails. All emails will be returned if not present. (optional) - * @param string[] $included_properties (optional) - * @param bool $archived Specifies whether to return archived emails. Defaults to `false`. (optional) + * @param \DateTime|null $created_at Only return emails created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return emails created after the specified time. (optional) + * @param \DateTime|null $created_before Only return emails created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return emails last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return emails last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return emails last updated before the specified time. (optional) + * @param string[]|null $sort Specifies which fields to use for sorting results. Valid fields are `name`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy`. `createdAt` will be used by default. (optional) + * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to return. Default is 100. (optional) + * @param bool|null $include_stats Include statistics with emails. (optional) + * @param bool|null $marketing_campaign_names (optional) + * @param bool|null $workflow_names (optional) + * @param string|null $type Email types to be filtered by. Multiple types can be included. All emails will be returned if not present. (optional) + * @param bool|null $is_published Filter by published/draft emails. All emails will be returned if not present. (optional) + * @param string[]|null $included_properties (optional) + * @param bool|null $archived Specifies whether to return archived emails. Defaults to `false`. (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 @@ -2822,22 +2817,22 @@ function ($response) { * * Get all marketing emails for a HubSpot account. * - * @param \DateTime $created_at Only return emails created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return emails created after the specified time. (optional) - * @param \DateTime $created_before Only return emails created before the specified time. (optional) - * @param \DateTime $updated_at Only return emails last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return emails last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return emails last updated before the specified time. (optional) - * @param string[] $sort Specifies which fields to use for sorting results. Valid fields are `name`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy`. `createdAt` will be used by default. (optional) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to return. Default is 100. (optional) - * @param bool $include_stats Include statistics with emails. (optional) - * @param bool $marketing_campaign_names (optional) - * @param bool $workflow_names (optional) - * @param string $type Email types to be filtered by. Multiple types can be included. All emails will be returned if not present. (optional) - * @param bool $is_published Filter by published/draft emails. All emails will be returned if not present. (optional) - * @param string[] $included_properties (optional) - * @param bool $archived Specifies whether to return archived emails. Defaults to `false`. (optional) + * @param \DateTime|null $created_at Only return emails created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return emails created after the specified time. (optional) + * @param \DateTime|null $created_before Only return emails created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return emails last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return emails last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return emails last updated before the specified time. (optional) + * @param string[]|null $sort Specifies which fields to use for sorting results. Valid fields are `name`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy`. `createdAt` will be used by default. (optional) + * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to return. Default is 100. (optional) + * @param bool|null $include_stats Include statistics with emails. (optional) + * @param bool|null $marketing_campaign_names (optional) + * @param bool|null $workflow_names (optional) + * @param string|null $type Email types to be filtered by. Multiple types can be included. All emails will be returned if not present. (optional) + * @param bool|null $is_published Filter by published/draft emails. All emails will be returned if not present. (optional) + * @param string[]|null $included_properties (optional) + * @param bool|null $archived Specifies whether to return archived emails. Defaults to `false`. (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 @@ -2887,22 +2882,22 @@ function ($exception) { /** * Create request for operation 'getPage' * - * @param \DateTime $created_at Only return emails created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return emails created after the specified time. (optional) - * @param \DateTime $created_before Only return emails created before the specified time. (optional) - * @param \DateTime $updated_at Only return emails last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return emails last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return emails last updated before the specified time. (optional) - * @param string[] $sort Specifies which fields to use for sorting results. Valid fields are `name`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy`. `createdAt` will be used by default. (optional) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to return. Default is 100. (optional) - * @param bool $include_stats Include statistics with emails. (optional) - * @param bool $marketing_campaign_names (optional) - * @param bool $workflow_names (optional) - * @param string $type Email types to be filtered by. Multiple types can be included. All emails will be returned if not present. (optional) - * @param bool $is_published Filter by published/draft emails. All emails will be returned if not present. (optional) - * @param string[] $included_properties (optional) - * @param bool $archived Specifies whether to return archived emails. Defaults to `false`. (optional) + * @param \DateTime|null $created_at Only return emails created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return emails created after the specified time. (optional) + * @param \DateTime|null $created_before Only return emails created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return emails last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return emails last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return emails last updated before the specified time. (optional) + * @param string[]|null $sort Specifies which fields to use for sorting results. Valid fields are `name`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy`. `createdAt` will be used by default. (optional) + * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to return. Default is 100. (optional) + * @param bool|null $include_stats Include statistics with emails. (optional) + * @param bool|null $marketing_campaign_names (optional) + * @param bool|null $workflow_names (optional) + * @param string|null $type Email types to be filtered by. Multiple types can be included. All emails will be returned if not present. (optional) + * @param bool|null $is_published Filter by published/draft emails. All emails will be returned if not present. (optional) + * @param string[]|null $included_properties (optional) + * @param bool|null $archived Specifies whether to return archived emails. Defaults to `false`. (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 @@ -3198,18 +3193,6 @@ public function getRevisionByIdWithHttpInfo($email_id, $revision_id, string $con $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: @@ -3268,6 +3251,19 @@ public function getRevisionByIdWithHttpInfo($email_id, $revision_id, string $con ]; } + 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\Emails\Model\VersionPublicEmail'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -3512,9 +3508,9 @@ public function getRevisionByIdRequest($email_id, $revision_id, string $contentT * Get revisions of a marketing email * * @param string $email_id The marketing email ID. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before The cursor token value to get the previous set of results. You can get this from the `paging.prev.before` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to return. Default is 100. (optional) + * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param string|null $before The cursor token value to get the previous set of results. You can get this from the `paging.prev.before` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to return. Default is 100. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRevisions'] to see the possible values for this operation * * @throws \HubSpot\Client\Marketing\Emails\ApiException on non-2xx response or if the response body is not in the expected format @@ -3533,9 +3529,9 @@ public function getRevisions($email_id, $after = null, $before = null, $limit = * Get revisions of a marketing email * * @param string $email_id The marketing email ID. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before The cursor token value to get the previous set of results. You can get this from the `paging.prev.before` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to return. Default is 100. (optional) + * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param string|null $before The cursor token value to get the previous set of results. You can get this from the `paging.prev.before` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to return. Default is 100. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRevisions'] to see the possible values for this operation * * @throws \HubSpot\Client\Marketing\Emails\ApiException on non-2xx response or if the response body is not in the expected format @@ -3568,18 +3564,6 @@ public function getRevisionsWithHttpInfo($email_id, $after = null, $before = nul $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: @@ -3638,6 +3622,19 @@ public function getRevisionsWithHttpInfo($email_id, $after = null, $before = nul ]; } + 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\Emails\Model\CollectionResponseWithTotalVersionPublicEmail'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -3695,9 +3692,9 @@ public function getRevisionsWithHttpInfo($email_id, $after = null, $before = nul * Get revisions of a marketing email * * @param string $email_id The marketing email ID. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before The cursor token value to get the previous set of results. You can get this from the `paging.prev.before` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to return. Default is 100. (optional) + * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param string|null $before The cursor token value to get the previous set of results. You can get this from the `paging.prev.before` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to return. Default is 100. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRevisions'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -3719,9 +3716,9 @@ function ($response) { * Get revisions of a marketing email * * @param string $email_id The marketing email ID. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before The cursor token value to get the previous set of results. You can get this from the `paging.prev.before` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to return. Default is 100. (optional) + * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param string|null $before The cursor token value to get the previous set of results. You can get this from the `paging.prev.before` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to return. Default is 100. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRevisions'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -3772,9 +3769,9 @@ function ($exception) { * Create request for operation 'getRevisions' * * @param string $email_id The marketing email ID. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before The cursor token value to get the previous set of results. You can get this from the `paging.prev.before` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to return. Default is 100. (optional) + * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param string|null $before The cursor token value to get the previous set of results. You can get this from the `paging.prev.before` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to return. Default is 100. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRevisions'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -3952,18 +3949,6 @@ public function publishOrSendWithHttpInfo($email_id, string $contentType = self: $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } return [null, $statusCode, $response->getHeaders()]; @@ -4193,18 +4178,6 @@ public function resetDraftWithHttpInfo($email_id, string $contentType = self::co $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } return [null, $statusCode, $response->getHeaders()]; @@ -4437,18 +4410,6 @@ public function restoreDraftRevisionWithHttpInfo($email_id, $revision_id, string $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -4507,6 +4468,19 @@ public function restoreDraftRevisionWithHttpInfo($email_id, $revision_id, 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\Emails\Model\PublicEmail'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -4802,18 +4776,6 @@ public function restoreRevisionWithHttpInfo($email_id, $revision_id, string $con $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()]; @@ -5061,18 +5023,6 @@ public function unpublishOrCancelWithHttpInfo($email_id, string $contentType = s $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } return [null, $statusCode, $response->getHeaders()]; @@ -5254,7 +5204,7 @@ public function unpublishOrCancelRequest($email_id, string $contentType = self:: * * @param string $email_id The ID of the marketing email that should get updated (required) * @param \HubSpot\Client\Marketing\Emails\Model\EmailUpdateRequest $email_update_request A marketing email object with properties that should overwrite the corresponding properties of the marketing email. (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['update'] to see the possible values for this operation * * @throws \HubSpot\Client\Marketing\Emails\ApiException on non-2xx response or if the response body is not in the expected format @@ -5274,7 +5224,7 @@ public function update($email_id, $email_update_request, $archived = null, strin * * @param string $email_id The ID of the marketing email that should get updated (required) * @param \HubSpot\Client\Marketing\Emails\Model\EmailUpdateRequest $email_update_request A marketing email object with properties that should overwrite the corresponding properties of the marketing email. (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['update'] to see the possible values for this operation * * @throws \HubSpot\Client\Marketing\Emails\ApiException on non-2xx response or if the response body is not in the expected format @@ -5307,18 +5257,6 @@ public function updateWithHttpInfo($email_id, $email_update_request, $archived = $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: @@ -5377,6 +5315,19 @@ public function updateWithHttpInfo($email_id, $email_update_request, $archived = ]; } + 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\Emails\Model\PublicEmail'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -5435,7 +5386,7 @@ public function updateWithHttpInfo($email_id, $email_update_request, $archived = * * @param string $email_id The ID of the marketing email that should get updated (required) * @param \HubSpot\Client\Marketing\Emails\Model\EmailUpdateRequest $email_update_request A marketing email object with properties that should overwrite the corresponding properties of the marketing email. (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['update'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -5458,7 +5409,7 @@ function ($response) { * * @param string $email_id The ID of the marketing email that should get updated (required) * @param \HubSpot\Client\Marketing\Emails\Model\EmailUpdateRequest $email_update_request A marketing email object with properties that should overwrite the corresponding properties of the marketing email. (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['update'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -5510,7 +5461,7 @@ function ($exception) { * * @param string $email_id The ID of the marketing email that should get updated (required) * @param \HubSpot\Client\Marketing\Emails\Model\EmailUpdateRequest $email_update_request A marketing email object with properties that should overwrite the corresponding properties of the marketing email. (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['update'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -5685,18 +5636,6 @@ public function upsertDraftWithHttpInfo($email_id, $email_update_request, 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: @@ -5755,6 +5694,19 @@ public function upsertDraftWithHttpInfo($email_id, $email_update_request, 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\Emails\Model\PublicEmail'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer diff --git a/codegen/Marketing/Emails/Api/StatisticsApi.php b/codegen/Marketing/Emails/Api/StatisticsApi.php index 48e902bdc..a1ee6264a 100644 --- a/codegen/Marketing/Emails/Api/StatisticsApi.php +++ b/codegen/Marketing/Emails/Api/StatisticsApi.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 */ /** @@ -86,13 +86,13 @@ class StatisticsApi * @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; } @@ -130,10 +130,10 @@ public function getConfig() * * Get aggregated statistics. * - * @param string $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) - * @param string $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) - * @param int[] $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) - * @param string $property Specifies which email properties should be returned. All properties will be returned by default. (optional) + * @param string|null $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) + * @param string|null $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) + * @param int[]|null $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) + * @param string|null $property Specifies which email properties should be returned. All properties will be returned by default. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailsList'] to see the possible values for this operation * * @throws \HubSpot\Client\Marketing\Emails\ApiException on non-2xx response or if the response body is not in the expected format @@ -151,10 +151,10 @@ public function getEmailsList($start_timestamp = null, $end_timestamp = null, $e * * Get aggregated statistics. * - * @param string $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) - * @param string $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) - * @param int[] $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) - * @param string $property Specifies which email properties should be returned. All properties will be returned by default. (optional) + * @param string|null $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) + * @param string|null $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) + * @param int[]|null $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) + * @param string|null $property Specifies which email properties should be returned. All properties will be returned by default. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailsList'] to see the possible values for this operation * * @throws \HubSpot\Client\Marketing\Emails\ApiException on non-2xx response or if the response body is not in the expected format @@ -187,18 +187,6 @@ public function getEmailsListWithHttpInfo($start_timestamp = null, $end_timestam $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: @@ -257,6 +245,19 @@ public function getEmailsListWithHttpInfo($start_timestamp = null, $end_timestam ]; } + 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\Emails\Model\AggregateEmailStatistics'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -313,10 +314,10 @@ public function getEmailsListWithHttpInfo($start_timestamp = null, $end_timestam * * Get aggregated statistics. * - * @param string $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) - * @param string $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) - * @param int[] $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) - * @param string $property Specifies which email properties should be returned. All properties will be returned by default. (optional) + * @param string|null $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) + * @param string|null $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) + * @param int[]|null $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) + * @param string|null $property Specifies which email properties should be returned. All properties will be returned by default. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailsList'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -337,10 +338,10 @@ function ($response) { * * Get aggregated statistics. * - * @param string $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) - * @param string $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) - * @param int[] $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) - * @param string $property Specifies which email properties should be returned. All properties will be returned by default. (optional) + * @param string|null $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) + * @param string|null $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) + * @param int[]|null $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) + * @param string|null $property Specifies which email properties should be returned. All properties will be returned by default. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailsList'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -390,10 +391,10 @@ function ($exception) { /** * Create request for operation 'getEmailsList' * - * @param string $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) - * @param string $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) - * @param int[] $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) - * @param string $property Specifies which email properties should be returned. All properties will be returned by default. (optional) + * @param string|null $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) + * @param string|null $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) + * @param int[]|null $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) + * @param string|null $property Specifies which email properties should be returned. All properties will be returned by default. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailsList'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -516,10 +517,10 @@ public function getEmailsListRequest($start_timestamp = null, $end_timestamp = n * * Get aggregated statistic intervals. * - * @param string $interval The interval to aggregate statistics for. (optional) - * @param string $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) - * @param string $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) - * @param int[] $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) + * @param string|null $interval The interval to aggregate statistics for. (optional) + * @param string|null $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) + * @param string|null $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) + * @param int[]|null $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHistogram'] to see the possible values for this operation * * @throws \HubSpot\Client\Marketing\Emails\ApiException on non-2xx response or if the response body is not in the expected format @@ -537,10 +538,10 @@ public function getHistogram($interval = null, $start_timestamp = null, $end_tim * * Get aggregated statistic intervals. * - * @param string $interval The interval to aggregate statistics for. (optional) - * @param string $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) - * @param string $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) - * @param int[] $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) + * @param string|null $interval The interval to aggregate statistics for. (optional) + * @param string|null $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) + * @param string|null $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) + * @param int[]|null $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHistogram'] to see the possible values for this operation * * @throws \HubSpot\Client\Marketing\Emails\ApiException on non-2xx response or if the response body is not in the expected format @@ -573,18 +574,6 @@ public function getHistogramWithHttpInfo($interval = null, $start_timestamp = 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: @@ -643,6 +632,19 @@ public function getHistogramWithHttpInfo($interval = null, $start_timestamp = 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\Emails\Model\CollectionResponseWithTotalEmailStatisticIntervalNoPaging'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -699,10 +701,10 @@ public function getHistogramWithHttpInfo($interval = null, $start_timestamp = nu * * Get aggregated statistic intervals. * - * @param string $interval The interval to aggregate statistics for. (optional) - * @param string $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) - * @param string $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) - * @param int[] $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) + * @param string|null $interval The interval to aggregate statistics for. (optional) + * @param string|null $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) + * @param string|null $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) + * @param int[]|null $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHistogram'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -723,10 +725,10 @@ function ($response) { * * Get aggregated statistic intervals. * - * @param string $interval The interval to aggregate statistics for. (optional) - * @param string $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) - * @param string $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) - * @param int[] $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) + * @param string|null $interval The interval to aggregate statistics for. (optional) + * @param string|null $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) + * @param string|null $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) + * @param int[]|null $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHistogram'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -776,10 +778,10 @@ function ($exception) { /** * Create request for operation 'getHistogram' * - * @param string $interval The interval to aggregate statistics for. (optional) - * @param string $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) - * @param string $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) - * @param int[] $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) + * @param string|null $interval The interval to aggregate statistics for. (optional) + * @param string|null $start_timestamp The start timestamp of the time span, in ISO8601 representation. (optional) + * @param string|null $end_timestamp The end timestamp of the time span, in ISO8601 representation. (optional) + * @param int[]|null $email_ids Filter by email IDs. Only include statistics of emails with these IDs. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHistogram'] to see the possible values for this operation * * @throws \InvalidArgumentException diff --git a/codegen/Marketing/Emails/ApiException.php b/codegen/Marketing/Emails/ApiException.php index 600d585c3..00e17f028 100644 --- a/codegen/Marketing/Emails/ApiException.php +++ b/codegen/Marketing/Emails/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/Emails/Configuration.php b/codegen/Marketing/Emails/Configuration.php index 957fd6af0..6913fe42a 100644 --- a/codegen/Marketing/Emails/Configuration.php +++ b/codegen/Marketing/Emails/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/Emails/HeaderSelector.php b/codegen/Marketing/Emails/HeaderSelector.php index a4941006d..d915533f4 100644 --- a/codegen/Marketing/Emails/HeaderSelector.php +++ b/codegen/Marketing/Emails/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/Emails/Model/AbTestCreateRequestVNext.php b/codegen/Marketing/Emails/Model/AbTestCreateRequestVNext.php index 2985008b2..91909ffa7 100644 --- a/codegen/Marketing/Emails/Model/AbTestCreateRequestVNext.php +++ b/codegen/Marketing/Emails/Model/AbTestCreateRequestVNext.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('variation_name', $data ?? [], null); $this->setIfExists('content_id', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/AggregateEmailStatistics.php b/codegen/Marketing/Emails/Model/AggregateEmailStatistics.php index 9c0841663..890e99a03 100644 --- a/codegen/Marketing/Emails/Model/AggregateEmailStatistics.php +++ b/codegen/Marketing/Emails/Model/AggregateEmailStatistics.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 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('emails', $data ?? [], null); $this->setIfExists('campaign_aggregations', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/CollectionResponseWithTotalEmailStatisticIntervalNoPaging.php b/codegen/Marketing/Emails/Model/CollectionResponseWithTotalEmailStatisticIntervalNoPaging.php index 18fe8ada6..9be4e919e 100644 --- a/codegen/Marketing/Emails/Model/CollectionResponseWithTotalEmailStatisticIntervalNoPaging.php +++ b/codegen/Marketing/Emails/Model/CollectionResponseWithTotalEmailStatisticIntervalNoPaging.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('total', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/CollectionResponseWithTotalPublicEmailForwardPaging.php b/codegen/Marketing/Emails/Model/CollectionResponseWithTotalPublicEmailForwardPaging.php index 45b2e7e6e..ddd3deee9 100644 --- a/codegen/Marketing/Emails/Model/CollectionResponseWithTotalPublicEmailForwardPaging.php +++ b/codegen/Marketing/Emails/Model/CollectionResponseWithTotalPublicEmailForwardPaging.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 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('total', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/CollectionResponseWithTotalVersionPublicEmail.php b/codegen/Marketing/Emails/Model/CollectionResponseWithTotalVersionPublicEmail.php index 9b4c9e70c..d0a880c37 100644 --- a/codegen/Marketing/Emails/Model/CollectionResponseWithTotalVersionPublicEmail.php +++ b/codegen/Marketing/Emails/Model/CollectionResponseWithTotalVersionPublicEmail.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 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('total', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/ContentCloneRequestVNext.php b/codegen/Marketing/Emails/Model/ContentCloneRequestVNext.php index 3980c09d0..e50c253cf 100644 --- a/codegen/Marketing/Emails/Model/ContentCloneRequestVNext.php +++ b/codegen/Marketing/Emails/Model/ContentCloneRequestVNext.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('clone_name', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/EmailCreateRequest.php b/codegen/Marketing/Emails/Model/EmailCreateRequest.php index 4e6af9e23..ee0c1e356 100644 --- a/codegen/Marketing/Emails/Model/EmailCreateRequest.php +++ b/codegen/Marketing/Emails/Model/EmailCreateRequest.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 */ /** @@ -2159,10 +2159,10 @@ public function getSubcategoryAllowableValues() /** * 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('feedback_survey_id', $data ?? [], null); $this->setIfExists('rss_data', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/EmailStatisticInterval.php b/codegen/Marketing/Emails/Model/EmailStatisticInterval.php index 8d2323fdc..0673132bf 100644 --- a/codegen/Marketing/Emails/Model/EmailStatisticInterval.php +++ b/codegen/Marketing/Emails/Model/EmailStatisticInterval.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('interval', $data ?? [], null); $this->setIfExists('aggregations', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/EmailStatisticsData.php b/codegen/Marketing/Emails/Model/EmailStatisticsData.php index 9aed01c16..8e0762c9b 100644 --- a/codegen/Marketing/Emails/Model/EmailStatisticsData.php +++ b/codegen/Marketing/Emails/Model/EmailStatisticsData.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 */ /** @@ -257,10 +257,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('device_breakdown', $data ?? [], null); $this->setIfExists('qualifier_stats', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/EmailUpdateRequest.php b/codegen/Marketing/Emails/Model/EmailUpdateRequest.php index 22078a199..66f30de0b 100644 --- a/codegen/Marketing/Emails/Model/EmailUpdateRequest.php +++ b/codegen/Marketing/Emails/Model/EmailUpdateRequest.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 */ /** @@ -2153,10 +2153,10 @@ public function getSubcategoryAllowableValues() /** * 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('rss_data', $data ?? [], null); $this->setIfExists('subject', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/Error.php b/codegen/Marketing/Emails/Model/Error.php index a3f8ebe48..a90e2e6d3 100644 --- a/codegen/Marketing/Emails/Model/Error.php +++ b/codegen/Marketing/Emails/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/Emails/Model/ErrorDetail.php b/codegen/Marketing/Emails/Model/ErrorDetail.php index f74372909..8f8cc70d7 100644 --- a/codegen/Marketing/Emails/Model/ErrorDetail.php +++ b/codegen/Marketing/Emails/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/Emails/Model/ForwardPaging.php b/codegen/Marketing/Emails/Model/ForwardPaging.php index 356f53eb4..e638d2555 100644 --- a/codegen/Marketing/Emails/Model/ForwardPaging.php +++ b/codegen/Marketing/Emails/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/Emails/Model/Interval.php b/codegen/Marketing/Emails/Model/Interval.php index db3f7de49..e33de10e6 100644 --- a/codegen/Marketing/Emails/Model/Interval.php +++ b/codegen/Marketing/Emails/Model/Interval.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('start', $data ?? [], null); $this->setIfExists('end', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/ModelInterface.php b/codegen/Marketing/Emails/Model/ModelInterface.php index b360cad34..3d1161994 100644 --- a/codegen/Marketing/Emails/Model/ModelInterface.php +++ b/codegen/Marketing/Emails/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/Emails/Model/NextPage.php b/codegen/Marketing/Emails/Model/NextPage.php index e33a81439..ac110097e 100644 --- a/codegen/Marketing/Emails/Model/NextPage.php +++ b/codegen/Marketing/Emails/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 */ /** @@ -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('link', $data ?? [], null); $this->setIfExists('after', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/Paging.php b/codegen/Marketing/Emails/Model/Paging.php index d082af488..9fe9bc2cd 100644 --- a/codegen/Marketing/Emails/Model/Paging.php +++ b/codegen/Marketing/Emails/Model/Paging.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('next', $data ?? [], null); $this->setIfExists('prev', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/PreviousPage.php b/codegen/Marketing/Emails/Model/PreviousPage.php index 367dcd946..b54603068 100644 --- a/codegen/Marketing/Emails/Model/PreviousPage.php +++ b/codegen/Marketing/Emails/Model/PreviousPage.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('before', $data ?? [], null); $this->setIfExists('link', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/PublicButtonStyleSettings.php b/codegen/Marketing/Emails/Model/PublicButtonStyleSettings.php index 39955fd7e..56378e027 100644 --- a/codegen/Marketing/Emails/Model/PublicButtonStyleSettings.php +++ b/codegen/Marketing/Emails/Model/PublicButtonStyleSettings.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 */ /** @@ -251,10 +251,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('background_color', $data ?? [], null); $this->setIfExists('font_style', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/PublicDividerStyleSettings.php b/codegen/Marketing/Emails/Model/PublicDividerStyleSettings.php index 2707683c4..9614e5fa0 100644 --- a/codegen/Marketing/Emails/Model/PublicDividerStyleSettings.php +++ b/codegen/Marketing/Emails/Model/PublicDividerStyleSettings.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 */ /** @@ -251,10 +251,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('color', $data ?? [], null); $this->setIfExists('line_type', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/PublicEmail.php b/codegen/Marketing/Emails/Model/PublicEmail.php index 49737686f..e886dea4f 100644 --- a/codegen/Marketing/Emails/Model/PublicEmail.php +++ b/codegen/Marketing/Emails/Model/PublicEmail.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 */ /** @@ -2177,10 +2177,10 @@ public function getStateAllowableValues() /** * 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('feedback_survey_id', $data ?? [], null); $this->setIfExists('subject', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/PublicEmailContent.php b/codegen/Marketing/Emails/Model/PublicEmailContent.php index c7208dac1..2eb08f1eb 100644 --- a/codegen/Marketing/Emails/Model/PublicEmailContent.php +++ b/codegen/Marketing/Emails/Model/PublicEmailContent.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 */ /** @@ -282,10 +282,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('smart_fields', $data ?? [], null); $this->setIfExists('theme_settings_values', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/PublicEmailFromDetails.php b/codegen/Marketing/Emails/Model/PublicEmailFromDetails.php index 5305fd44b..c2e15c21c 100644 --- a/codegen/Marketing/Emails/Model/PublicEmailFromDetails.php +++ b/codegen/Marketing/Emails/Model/PublicEmailFromDetails.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 getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('custom_reply_to', $data ?? [], null); $this->setIfExists('from_name', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/PublicEmailRecipients.php b/codegen/Marketing/Emails/Model/PublicEmailRecipients.php index d2bddbacf..c442e10f0 100644 --- a/codegen/Marketing/Emails/Model/PublicEmailRecipients.php +++ b/codegen/Marketing/Emails/Model/PublicEmailRecipients.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('include', $data ?? [], null); $this->setIfExists('exclude', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/PublicEmailStyleSettings.php b/codegen/Marketing/Emails/Model/PublicEmailStyleSettings.php index 2e22f82eb..efaeac755 100644 --- a/codegen/Marketing/Emails/Model/PublicEmailStyleSettings.php +++ b/codegen/Marketing/Emails/Model/PublicEmailStyleSettings.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 */ /** @@ -413,10 +413,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('email_body_padding', $data ?? [], null); $this->setIfExists('color_picker_favorite5', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/PublicEmailSubscriptionDetails.php b/codegen/Marketing/Emails/Model/PublicEmailSubscriptionDetails.php index 7197aaa95..7f68bc65f 100644 --- a/codegen/Marketing/Emails/Model/PublicEmailSubscriptionDetails.php +++ b/codegen/Marketing/Emails/Model/PublicEmailSubscriptionDetails.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 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('office_location_id', $data ?? [], null); $this->setIfExists('preferences_group_id', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/PublicEmailTestingDetails.php b/codegen/Marketing/Emails/Model/PublicEmailTestingDetails.php index 09c7c2a22..b64b1c2c2 100644 --- a/codegen/Marketing/Emails/Model/PublicEmailTestingDetails.php +++ b/codegen/Marketing/Emails/Model/PublicEmailTestingDetails.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 */ /** @@ -374,10 +374,10 @@ public function getAbSuccessMetricAllowableValues() /** * 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('ab_sampling_default', $data ?? [], null); $this->setIfExists('ab_sample_size_default', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/PublicEmailToDetails.php b/codegen/Marketing/Emails/Model/PublicEmailToDetails.php index 4f3a227c9..85e2c8270 100644 --- a/codegen/Marketing/Emails/Model/PublicEmailToDetails.php +++ b/codegen/Marketing/Emails/Model/PublicEmailToDetails.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 */ /** @@ -264,10 +264,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('contact_ils_lists', $data ?? [], null); $this->setIfExists('limit_send_frequency', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/PublicFontStyle.php b/codegen/Marketing/Emails/Model/PublicFontStyle.php index ebb600a0c..1903d9d2d 100644 --- a/codegen/Marketing/Emails/Model/PublicFontStyle.php +++ b/codegen/Marketing/Emails/Model/PublicFontStyle.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('size', $data ?? [], null); $this->setIfExists('color', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/PublicRssEmailDetails.php b/codegen/Marketing/Emails/Model/PublicRssEmailDetails.php index 48bd59d9f..012769d37 100644 --- a/codegen/Marketing/Emails/Model/PublicRssEmailDetails.php +++ b/codegen/Marketing/Emails/Model/PublicRssEmailDetails.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 */ /** @@ -288,10 +288,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('blog_image_max_width', $data ?? [], null); $this->setIfExists('blog_email_type', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/PublicWebversionDetails.php b/codegen/Marketing/Emails/Model/PublicWebversionDetails.php index 062188774..d05ff8677 100644 --- a/codegen/Marketing/Emails/Model/PublicWebversionDetails.php +++ b/codegen/Marketing/Emails/Model/PublicWebversionDetails.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 */ /** @@ -293,10 +293,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('domain', $data ?? [], null); $this->setIfExists('redirect_to_page_id', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/VersionPublicEmail.php b/codegen/Marketing/Emails/Model/VersionPublicEmail.php index 4887d06bb..d1b033f9c 100644 --- a/codegen/Marketing/Emails/Model/VersionPublicEmail.php +++ b/codegen/Marketing/Emails/Model/VersionPublicEmail.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 */ /** @@ -258,10 +258,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('user', $data ?? [], null); diff --git a/codegen/Marketing/Emails/Model/VersionUser.php b/codegen/Marketing/Emails/Model/VersionUser.php index f9efe1899..7203f26a9 100644 --- a/codegen/Marketing/Emails/Model/VersionUser.php +++ b/codegen/Marketing/Emails/Model/VersionUser.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 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('full_name', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); diff --git a/codegen/Marketing/Emails/ObjectSerializer.php b/codegen/Marketing/Emails/ObjectSerializer.php index 0618fe5d1..bf662f282 100644 --- a/codegen/Marketing/Emails/ObjectSerializer.php +++ b/codegen/Marketing/Emails/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) : ''; } } From 8db483f762ac1337027a00d3a8c08122f0dab3a7 Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Tue, 8 Apr 2025 17:23:08 +0300 Subject: [PATCH 2/2] Bump version to 12.1.0 --- CHANGELOG.md | 14 ++++++++++++-- composer.json | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d34429f0f..7c92d3860 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/HubSpot/hubspot-api-php/compare/12.0.0...HEAD) +## [Unreleased](https://github.com/HubSpot/hubspot-api-php/compare/12.1.0...HEAD) + +## [12.1.0](https://github.com/HubSpot/hubspot-api-php/releases/tag/12.1.0) - 2024-04-08 + +## Updated + +- Added `crm()->commerce()->invoices()` api client. +- Added `crm()->exports()` api client. +- Added `crm()->objects()->dealSplits()` api client. +- Added `marketing()->emails()` api client. ## [12.0.0](https://github.com/HubSpot/hubspot-api-php/releases/tag/12.0.0) - 2024-10-28 @@ -846,7 +855,7 @@ ListAssociationsApi 25. getSubscriptions => getAll (webhooks()->subscriptionsApi()) 26. updateSubscription => update (webhooks()->subscriptionsApi()) -[Unreleased]: https://github.com/HubSpot/hubspot-api-php/compare/12.0.0...HEAD +[Unreleased]: https://github.com/HubSpot/hubspot-api-php/compare/12.1.0...HEAD [1.0.0-beta]: https://github.com/HubSpot/hubspot-api-php/releases/tag/v1.0.0-beta [1.1.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/1.1.0 [1.2.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/1.2.0 @@ -904,3 +913,4 @@ ListAssociationsApi [11.2.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/11.2.0 [11.3.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/11.3.0 [12.0.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/12.0.0 +[12.1.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/12.1.0 diff --git a/composer.json b/composer.json index 7e83bce1a..b1b520633 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "hubspot/api-client", - "version": "12.0.0", + "version": "12.1.0", "description": "Hubspot API client", "keywords": [ "hubspot",