From 46afa6314e633b5194b77b9697b7d043b0bbec8c Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Fri, 11 Apr 2025 09:08:20 +0300 Subject: [PATCH] Codegen: CMS Blogs clients --- .../Cms/Blogs/Authors/Api/BlogAuthorsApi.php | 454 +++++++-------- codegen/Cms/Blogs/Authors/ApiException.php | 8 +- codegen/Cms/Blogs/Authors/Configuration.php | 4 +- codegen/Cms/Blogs/Authors/HeaderSelector.php | 32 +- .../Model/AttachToLangPrimaryRequestVNext.php | 6 +- .../Authors/Model/BatchInputBlogAuthor.php | 6 +- .../Authors/Model/BatchInputJsonNode.php | 6 +- .../Blogs/Authors/Model/BatchInputString.php | 6 +- .../Authors/Model/BatchResponseBlogAuthor.php | 6 +- .../BatchResponseBlogAuthorWithErrors.php | 6 +- .../Cms/Blogs/Authors/Model/BlogAuthor.php | 6 +- .../Model/BlogAuthorCloneRequestVNext.php | 6 +- ...sponseWithTotalBlogAuthorForwardPaging.php | 6 +- .../Model/DetachFromLangGroupRequestVNext.php | 6 +- codegen/Cms/Blogs/Authors/Model/Error.php | 6 +- .../Cms/Blogs/Authors/Model/ErrorDetail.php | 6 +- .../Cms/Blogs/Authors/Model/ForwardPaging.php | 6 +- .../Blogs/Authors/Model/ModelInterface.php | 2 +- codegen/Cms/Blogs/Authors/Model/NextPage.php | 6 +- .../SetNewLanguagePrimaryRequestVNext.php | 6 +- .../Cms/Blogs/Authors/Model/StandardError.php | 6 +- .../Model/UpdateLanguagesRequestVNext.php | 6 +- .../Cms/Blogs/Authors/ObjectSerializer.php | 98 +++- codegen/Cms/Blogs/BlogPosts/Api/BasicApi.php | 515 ++++++++---------- codegen/Cms/Blogs/BlogPosts/Api/BatchApi.php | 119 ++-- .../Blogs/BlogPosts/Api/MultiLanguageApi.php | 85 +-- codegen/Cms/Blogs/BlogPosts/ApiException.php | 8 +- codegen/Cms/Blogs/BlogPosts/Configuration.php | 4 +- .../Cms/Blogs/BlogPosts/HeaderSelector.php | 32 +- codegen/Cms/Blogs/BlogPosts/Model/Angle.php | 6 +- .../Model/AttachToLangPrimaryRequestVNext.php | 6 +- .../Blogs/BlogPosts/Model/BackgroundImage.php | 6 +- .../BlogPosts/Model/BatchInputBlogPost.php | 6 +- .../BlogPosts/Model/BatchInputJsonNode.php | 6 +- .../BlogPosts/Model/BatchInputString.php | 6 +- .../BlogPosts/Model/BatchResponseBlogPost.php | 6 +- .../Model/BatchResponseBlogPostWithErrors.php | 6 +- .../Cms/Blogs/BlogPosts/Model/BlogPost.php | 6 +- .../BlogPostLanguageCloneRequestVNext.php | 6 +- .../BlogPosts/Model/BreakpointStyles.php | 6 +- ...ResponseWithTotalBlogPostForwardPaging.php | 6 +- ...ectionResponseWithTotalVersionBlogPost.php | 6 +- .../Cms/Blogs/BlogPosts/Model/ColorStop.php | 6 +- .../Model/ContentCloneRequestVNext.php | 6 +- .../Model/ContentLanguageVariation.php | 6 +- .../Model/ContentScheduleRequestVNext.php | 6 +- .../Model/DetachFromLangGroupRequestVNext.php | 6 +- codegen/Cms/Blogs/BlogPosts/Model/Error.php | 6 +- .../Cms/Blogs/BlogPosts/Model/ErrorDetail.php | 6 +- .../Blogs/BlogPosts/Model/ForwardPaging.php | 6 +- .../Cms/Blogs/BlogPosts/Model/Gradient.php | 6 +- .../Blogs/BlogPosts/Model/LayoutSection.php | 6 +- .../Blogs/BlogPosts/Model/ModelInterface.php | 2 +- .../Cms/Blogs/BlogPosts/Model/NextPage.php | 6 +- codegen/Cms/Blogs/BlogPosts/Model/Paging.php | 6 +- .../Blogs/BlogPosts/Model/PreviousPage.php | 6 +- .../Cms/Blogs/BlogPosts/Model/RGBAColor.php | 6 +- .../Cms/Blogs/BlogPosts/Model/RowMetaData.php | 6 +- .../SetNewLanguagePrimaryRequestVNext.php | 6 +- .../Blogs/BlogPosts/Model/SideOrCorner.php | 6 +- .../Blogs/BlogPosts/Model/StandardError.php | 6 +- codegen/Cms/Blogs/BlogPosts/Model/Styles.php | 6 +- .../Model/UpdateLanguagesRequestVNext.php | 6 +- .../Blogs/BlogPosts/Model/VersionBlogPost.php | 6 +- .../Cms/Blogs/BlogPosts/Model/VersionUser.php | 6 +- .../Cms/Blogs/BlogPosts/ObjectSerializer.php | 98 +++- codegen/Cms/Blogs/Tags/Api/BlogTagsApi.php | 454 +++++++-------- codegen/Cms/Blogs/Tags/ApiException.php | 8 +- codegen/Cms/Blogs/Tags/Configuration.php | 4 +- codegen/Cms/Blogs/Tags/HeaderSelector.php | 32 +- .../Model/AttachToLangPrimaryRequestVNext.php | 6 +- .../Blogs/Tags/Model/BatchInputJsonNode.php | 6 +- .../Cms/Blogs/Tags/Model/BatchInputString.php | 6 +- .../Cms/Blogs/Tags/Model/BatchInputTag.php | 6 +- .../Cms/Blogs/Tags/Model/BatchResponseTag.php | 6 +- .../Tags/Model/BatchResponseTagWithErrors.php | 6 +- ...ctionResponseWithTotalTagForwardPaging.php | 6 +- .../Model/DetachFromLangGroupRequestVNext.php | 6 +- codegen/Cms/Blogs/Tags/Model/Error.php | 6 +- codegen/Cms/Blogs/Tags/Model/ErrorDetail.php | 6 +- .../Cms/Blogs/Tags/Model/ForwardPaging.php | 6 +- .../Cms/Blogs/Tags/Model/ModelInterface.php | 2 +- codegen/Cms/Blogs/Tags/Model/NextPage.php | 6 +- .../SetNewLanguagePrimaryRequestVNext.php | 6 +- .../Cms/Blogs/Tags/Model/StandardError.php | 6 +- codegen/Cms/Blogs/Tags/Model/Tag.php | 6 +- .../Blogs/Tags/Model/TagCloneRequestVNext.php | 6 +- .../Model/UpdateLanguagesRequestVNext.php | 6 +- codegen/Cms/Blogs/Tags/ObjectSerializer.php | 98 +++- 89 files changed, 1243 insertions(+), 1230 deletions(-) diff --git a/codegen/Cms/Blogs/Authors/Api/BlogAuthorsApi.php b/codegen/Cms/Blogs/Authors/Api/BlogAuthorsApi.php index 16c468ea3..bf954514b 100644 --- a/codegen/Cms/Blogs/Authors/Api/BlogAuthorsApi.php +++ b/codegen/Cms/Blogs/Authors/Api/BlogAuthorsApi.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 */ /** @@ -122,13 +122,13 @@ class BlogAuthorsApi * @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; } @@ -167,7 +167,7 @@ public function getConfig() * Delete a Blog Author * * @param string $object_id The Blog Author id. (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\Cms\Blogs\Authors\ApiException on non-2xx response or if the response body is not in the expected format @@ -185,7 +185,7 @@ public function archive($object_id, $archived = null, string $contentType = self * Delete a Blog Author * * @param string $object_id The Blog Author id. (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\Cms\Blogs\Authors\ApiException on non-2xx response or if the response body is not in the expected format @@ -218,18 +218,6 @@ public function archiveWithHttpInfo($object_id, $archived = null, string $conten $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } return [null, $statusCode, $response->getHeaders()]; @@ -254,7 +242,7 @@ public function archiveWithHttpInfo($object_id, $archived = null, string $conten * Delete a Blog Author * * @param string $object_id The Blog Author id. (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 @@ -276,7 +264,7 @@ function ($response) { * Delete a Blog Author * * @param string $object_id The Blog Author id. (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 @@ -314,7 +302,7 @@ function ($exception) { * Create request for operation 'archive' * * @param string $object_id The Blog Author id. (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 @@ -472,18 +460,6 @@ public function archiveBatchWithHttpInfo($batch_input_string, string $contentTyp $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()]; @@ -712,18 +688,6 @@ public function attachToLangGroupWithHttpInfo($attach_to_lang_primary_request_v_ $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()]; @@ -953,18 +917,6 @@ public function createWithHttpInfo($blog_author, 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() - ); - } switch($statusCode) { case 201: @@ -1023,6 +975,19 @@ public function createWithHttpInfo($blog_author, string $contentType = self::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\Cms\Blogs\Authors\Model\BlogAuthor'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1298,18 +1263,6 @@ public function createBatchWithHttpInfo($batch_input_blog_author, string $conten $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 201: @@ -1395,6 +1348,19 @@ public function createBatchWithHttpInfo($batch_input_blog_author, string $conten ]; } + 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\Cms\Blogs\Authors\Model\BatchResponseBlogAuthor'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1678,18 +1644,6 @@ public function createLangVariationWithHttpInfo($blog_author_clone_request_v_nex $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: @@ -1748,6 +1702,19 @@ public function createLangVariationWithHttpInfo($blog_author_clone_request_v_nex ]; } + 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\Cms\Blogs\Authors\Model\BlogAuthor'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2022,18 +1989,6 @@ public function detachFromLangGroupWithHttpInfo($detach_from_lang_group_request_ $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()]; @@ -2213,8 +2168,8 @@ public function detachFromLangGroupRequest($detach_from_lang_group_request_v_nex * Retrieve a Blog Author * * @param string $object_id The Blog Author id. (required) - * @param bool $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) - * @param string $property property (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) + * @param string|null $property property (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\Cms\Blogs\Authors\ApiException on non-2xx response or if the response body is not in the expected format @@ -2233,8 +2188,8 @@ public function getById($object_id, $archived = null, $property = null, string $ * Retrieve a Blog Author * * @param string $object_id The Blog Author id. (required) - * @param bool $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) + * @param string|null $property (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\Cms\Blogs\Authors\ApiException on non-2xx response or if the response body is not in the expected format @@ -2267,18 +2222,6 @@ public function getByIdWithHttpInfo($object_id, $archived = null, $property = 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: @@ -2337,6 +2280,19 @@ public function getByIdWithHttpInfo($object_id, $archived = null, $property = 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\Cms\Blogs\Authors\Model\BlogAuthor'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2394,8 +2350,8 @@ public function getByIdWithHttpInfo($object_id, $archived = null, $property = nu * Retrieve a Blog Author * * @param string $object_id The Blog Author id. (required) - * @param bool $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) + * @param string|null $property (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 @@ -2417,8 +2373,8 @@ function ($response) { * Retrieve a Blog Author * * @param string $object_id The Blog Author id. (required) - * @param bool $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) + * @param string|null $property (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 @@ -2469,8 +2425,8 @@ function ($exception) { * Create request for operation 'getById' * * @param string $object_id The Blog Author id. (required) - * @param bool $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) + * @param string|null $property (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 @@ -2588,17 +2544,17 @@ public function getByIdRequest($object_id, $archived = null, $property = null, s * * Get all Blog Authors * - * @param \DateTime $created_at Only return Blog Authors created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Blog Authors created after the specified time. (optional) - * @param \DateTime $created_before Only return Blog Authors created before the specified time. (optional) - * @param \DateTime $updated_at Only return Blog Authors last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Blog Authors last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Blog Authors 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 $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) - * @param string $property property (optional) + * @param \DateTime|null $created_at Only return Blog Authors created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Blog Authors created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Blog Authors created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Blog Authors last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Blog Authors last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Blog Authors 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 $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) + * @param string|null $property property (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\Cms\Blogs\Authors\ApiException on non-2xx response or if the response body is not in the expected format @@ -2616,17 +2572,17 @@ public function getPage($created_at = null, $created_after = null, $created_befo * * Get all Blog Authors * - * @param \DateTime $created_at Only return Blog Authors created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Blog Authors created after the specified time. (optional) - * @param \DateTime $created_before Only return Blog Authors created before the specified time. (optional) - * @param \DateTime $updated_at Only return Blog Authors last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Blog Authors last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Blog Authors 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 $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Blog Authors created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Blog Authors created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Blog Authors created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Blog Authors last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Blog Authors last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Blog Authors 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 $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) + * @param string|null $property (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\Cms\Blogs\Authors\ApiException on non-2xx response or if the response body is not in the expected format @@ -2659,18 +2615,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: @@ -2729,6 +2673,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\Cms\Blogs\Authors\Model\CollectionResponseWithTotalBlogAuthorForwardPaging'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2785,17 +2742,17 @@ public function getPageWithHttpInfo($created_at = null, $created_after = null, $ * * Get all Blog Authors * - * @param \DateTime $created_at Only return Blog Authors created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Blog Authors created after the specified time. (optional) - * @param \DateTime $created_before Only return Blog Authors created before the specified time. (optional) - * @param \DateTime $updated_at Only return Blog Authors last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Blog Authors last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Blog Authors 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 $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Blog Authors created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Blog Authors created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Blog Authors created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Blog Authors last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Blog Authors last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Blog Authors 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 $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) + * @param string|null $property (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 @@ -2816,17 +2773,17 @@ function ($response) { * * Get all Blog Authors * - * @param \DateTime $created_at Only return Blog Authors created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Blog Authors created after the specified time. (optional) - * @param \DateTime $created_before Only return Blog Authors created before the specified time. (optional) - * @param \DateTime $updated_at Only return Blog Authors last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Blog Authors last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Blog Authors 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 $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Blog Authors created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Blog Authors created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Blog Authors created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Blog Authors last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Blog Authors last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Blog Authors 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 $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) + * @param string|null $property (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 @@ -2876,17 +2833,17 @@ function ($exception) { /** * Create request for operation 'getPage' * - * @param \DateTime $created_at Only return Blog Authors created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Blog Authors created after the specified time. (optional) - * @param \DateTime $created_before Only return Blog Authors created before the specified time. (optional) - * @param \DateTime $updated_at Only return Blog Authors last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Blog Authors last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Blog Authors 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 $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Blog Authors created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Blog Authors created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Blog Authors created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Blog Authors last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Blog Authors last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Blog Authors 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 $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) + * @param string|null $property (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 @@ -3080,7 +3037,7 @@ public function getPageRequest($created_at = null, $created_after = null, $creat * Retrieve a batch of Blog Authors * * @param \HubSpot\Client\Cms\Blogs\Authors\Model\BatchInputString $batch_input_string The JSON array of Blog Author ids. (required) - * @param bool $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readBatch'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Blogs\Authors\ApiException on non-2xx response or if the response body is not in the expected format @@ -3099,7 +3056,7 @@ public function readBatch($batch_input_string, $archived = null, string $content * Retrieve a batch of Blog Authors * * @param \HubSpot\Client\Cms\Blogs\Authors\Model\BatchInputString $batch_input_string The JSON array of Blog Author ids. (required) - * @param bool $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readBatch'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Blogs\Authors\ApiException on non-2xx response or if the response body is not in the expected format @@ -3132,18 +3089,6 @@ public function readBatchWithHttpInfo($batch_input_string, $archived = null, 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: @@ -3229,6 +3174,19 @@ public function readBatchWithHttpInfo($batch_input_string, $archived = null, 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\Cms\Blogs\Authors\Model\BatchResponseBlogAuthor'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -3294,7 +3252,7 @@ public function readBatchWithHttpInfo($batch_input_string, $archived = null, str * Retrieve a batch of Blog Authors * * @param \HubSpot\Client\Cms\Blogs\Authors\Model\BatchInputString $batch_input_string The JSON array of Blog Author ids. (required) - * @param bool $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readBatch'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -3316,7 +3274,7 @@ function ($response) { * Retrieve a batch of Blog Authors * * @param \HubSpot\Client\Cms\Blogs\Authors\Model\BatchInputString $batch_input_string The JSON array of Blog Author ids. (required) - * @param bool $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readBatch'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -3367,7 +3325,7 @@ function ($exception) { * Create request for operation 'readBatch' * * @param \HubSpot\Client\Cms\Blogs\Authors\Model\BatchInputString $batch_input_string The JSON array of Blog Author ids. (required) - * @param bool $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Authors. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readBatch'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -3524,18 +3482,6 @@ public function setLangPrimaryWithHttpInfo($set_new_language_primary_request_v_n $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()]; @@ -3716,7 +3662,7 @@ public function setLangPrimaryRequest($set_new_language_primary_request_v_next, * * @param string $object_id The Blog Author id. (required) * @param \HubSpot\Client\Cms\Blogs\Authors\Model\BlogAuthor $blog_author The JSON representation of the updated Blog Author. (required) - * @param bool $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (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\Cms\Blogs\Authors\ApiException on non-2xx response or if the response body is not in the expected format @@ -3736,7 +3682,7 @@ public function update($object_id, $blog_author, $archived = null, string $conte * * @param string $object_id The Blog Author id. (required) * @param \HubSpot\Client\Cms\Blogs\Authors\Model\BlogAuthor $blog_author The JSON representation of the updated Blog Author. (required) - * @param bool $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (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\Cms\Blogs\Authors\ApiException on non-2xx response or if the response body is not in the expected format @@ -3769,18 +3715,6 @@ public function updateWithHttpInfo($object_id, $blog_author, $archived = null, 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() - ); - } switch($statusCode) { case 200: @@ -3839,6 +3773,19 @@ public function updateWithHttpInfo($object_id, $blog_author, $archived = null, s ]; } + 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\Cms\Blogs\Authors\Model\BlogAuthor'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -3897,7 +3844,7 @@ public function updateWithHttpInfo($object_id, $blog_author, $archived = null, s * * @param string $object_id The Blog Author id. (required) * @param \HubSpot\Client\Cms\Blogs\Authors\Model\BlogAuthor $blog_author The JSON representation of the updated Blog Author. (required) - * @param bool $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (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 @@ -3920,7 +3867,7 @@ function ($response) { * * @param string $object_id The Blog Author id. (required) * @param \HubSpot\Client\Cms\Blogs\Authors\Model\BlogAuthor $blog_author The JSON representation of the updated Blog Author. (required) - * @param bool $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (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 @@ -3972,7 +3919,7 @@ function ($exception) { * * @param string $object_id The Blog Author id. (required) * @param \HubSpot\Client\Cms\Blogs\Authors\Model\BlogAuthor $blog_author The JSON representation of the updated Blog Author. (required) - * @param bool $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (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 @@ -4095,7 +4042,7 @@ public function updateRequest($object_id, $blog_author, $archived = null, string * Update a batch of Blog Authors * * @param \HubSpot\Client\Cms\Blogs\Authors\Model\BatchInputJsonNode $batch_input_json_node A JSON array of the JSON representations of the updated Blog Authors. (required) - * @param bool $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBatch'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Blogs\Authors\ApiException on non-2xx response or if the response body is not in the expected format @@ -4114,7 +4061,7 @@ public function updateBatch($batch_input_json_node, $archived = null, string $co * Update a batch of Blog Authors * * @param \HubSpot\Client\Cms\Blogs\Authors\Model\BatchInputJsonNode $batch_input_json_node A JSON array of the JSON representations of the updated Blog Authors. (required) - * @param bool $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBatch'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Blogs\Authors\ApiException on non-2xx response or if the response body is not in the expected format @@ -4147,18 +4094,6 @@ public function updateBatchWithHttpInfo($batch_input_json_node, $archived = 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: @@ -4244,6 +4179,19 @@ public function updateBatchWithHttpInfo($batch_input_json_node, $archived = 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\Cms\Blogs\Authors\Model\BatchResponseBlogAuthor'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -4309,7 +4257,7 @@ public function updateBatchWithHttpInfo($batch_input_json_node, $archived = null * Update a batch of Blog Authors * * @param \HubSpot\Client\Cms\Blogs\Authors\Model\BatchInputJsonNode $batch_input_json_node A JSON array of the JSON representations of the updated Blog Authors. (required) - * @param bool $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBatch'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -4331,7 +4279,7 @@ function ($response) { * Update a batch of Blog Authors * * @param \HubSpot\Client\Cms\Blogs\Authors\Model\BatchInputJsonNode $batch_input_json_node A JSON array of the JSON representations of the updated Blog Authors. (required) - * @param bool $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBatch'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -4382,7 +4330,7 @@ function ($exception) { * Create request for operation 'updateBatch' * * @param \HubSpot\Client\Cms\Blogs\Authors\Model\BatchInputJsonNode $batch_input_json_node A JSON array of the JSON representations of the updated Blog Authors. (required) - * @param bool $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Authors. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBatch'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -4539,18 +4487,6 @@ public function updateLangsWithHttpInfo($update_languages_request_v_next, 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()]; diff --git a/codegen/Cms/Blogs/Authors/ApiException.php b/codegen/Cms/Blogs/Authors/ApiException.php index 9511f62f3..66afcea3d 100644 --- a/codegen/Cms/Blogs/Authors/ApiException.php +++ b/codegen/Cms/Blogs/Authors/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/Cms/Blogs/Authors/Configuration.php b/codegen/Cms/Blogs/Authors/Configuration.php index 4eb941358..68e8ace76 100644 --- a/codegen/Cms/Blogs/Authors/Configuration.php +++ b/codegen/Cms/Blogs/Authors/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/Cms/Blogs/Authors/HeaderSelector.php b/codegen/Cms/Blogs/Authors/HeaderSelector.php index c93c6e08c..2497f4777 100644 --- a/codegen/Cms/Blogs/Authors/HeaderSelector.php +++ b/codegen/Cms/Blogs/Authors/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/Cms/Blogs/Authors/Model/AttachToLangPrimaryRequestVNext.php b/codegen/Cms/Blogs/Authors/Model/AttachToLangPrimaryRequestVNext.php index 7501dbc99..cb82f8a88 100644 --- a/codegen/Cms/Blogs/Authors/Model/AttachToLangPrimaryRequestVNext.php +++ b/codegen/Cms/Blogs/Authors/Model/AttachToLangPrimaryRequestVNext.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('language', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); diff --git a/codegen/Cms/Blogs/Authors/Model/BatchInputBlogAuthor.php b/codegen/Cms/Blogs/Authors/Model/BatchInputBlogAuthor.php index f445353a9..f54f3c136 100644 --- a/codegen/Cms/Blogs/Authors/Model/BatchInputBlogAuthor.php +++ b/codegen/Cms/Blogs/Authors/Model/BatchInputBlogAuthor.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 */ /** @@ -240,10 +240,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/Cms/Blogs/Authors/Model/BatchInputJsonNode.php b/codegen/Cms/Blogs/Authors/Model/BatchInputJsonNode.php index cf6ece492..5f7db7c9e 100644 --- a/codegen/Cms/Blogs/Authors/Model/BatchInputJsonNode.php +++ b/codegen/Cms/Blogs/Authors/Model/BatchInputJsonNode.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 */ /** @@ -240,10 +240,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/Cms/Blogs/Authors/Model/BatchInputString.php b/codegen/Cms/Blogs/Authors/Model/BatchInputString.php index b90248d17..1004e6b5e 100644 --- a/codegen/Cms/Blogs/Authors/Model/BatchInputString.php +++ b/codegen/Cms/Blogs/Authors/Model/BatchInputString.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 */ /** @@ -240,10 +240,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/Cms/Blogs/Authors/Model/BatchResponseBlogAuthor.php b/codegen/Cms/Blogs/Authors/Model/BatchResponseBlogAuthor.php index d5e6df6ca..52306fc18 100644 --- a/codegen/Cms/Blogs/Authors/Model/BatchResponseBlogAuthor.php +++ b/codegen/Cms/Blogs/Authors/Model/BatchResponseBlogAuthor.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 */ /** @@ -289,10 +289,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/Cms/Blogs/Authors/Model/BatchResponseBlogAuthorWithErrors.php b/codegen/Cms/Blogs/Authors/Model/BatchResponseBlogAuthorWithErrors.php index 28937dae7..14efe46ae 100644 --- a/codegen/Cms/Blogs/Authors/Model/BatchResponseBlogAuthorWithErrors.php +++ b/codegen/Cms/Blogs/Authors/Model/BatchResponseBlogAuthorWithErrors.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 */ /** @@ -301,10 +301,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/Cms/Blogs/Authors/Model/BlogAuthor.php b/codegen/Cms/Blogs/Authors/Model/BlogAuthor.php index ad6e9ffb1..1d44f03c6 100644 --- a/codegen/Cms/Blogs/Authors/Model/BlogAuthor.php +++ b/codegen/Cms/Blogs/Authors/Model/BlogAuthor.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 */ /** @@ -1855,10 +1855,10 @@ public function getLanguageAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('website', $data ?? [], null); $this->setIfExists('display_name', $data ?? [], null); diff --git a/codegen/Cms/Blogs/Authors/Model/BlogAuthorCloneRequestVNext.php b/codegen/Cms/Blogs/Authors/Model/BlogAuthorCloneRequestVNext.php index fa1aa9a7b..a3cb73aa2 100644 --- a/codegen/Cms/Blogs/Authors/Model/BlogAuthorCloneRequestVNext.php +++ b/codegen/Cms/Blogs/Authors/Model/BlogAuthorCloneRequestVNext.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('language', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); diff --git a/codegen/Cms/Blogs/Authors/Model/CollectionResponseWithTotalBlogAuthorForwardPaging.php b/codegen/Cms/Blogs/Authors/Model/CollectionResponseWithTotalBlogAuthorForwardPaging.php index e00520907..55414c594 100644 --- a/codegen/Cms/Blogs/Authors/Model/CollectionResponseWithTotalBlogAuthorForwardPaging.php +++ b/codegen/Cms/Blogs/Authors/Model/CollectionResponseWithTotalBlogAuthorForwardPaging.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/Cms/Blogs/Authors/Model/DetachFromLangGroupRequestVNext.php b/codegen/Cms/Blogs/Authors/Model/DetachFromLangGroupRequestVNext.php index 84ddf8260..5df181a26 100644 --- a/codegen/Cms/Blogs/Authors/Model/DetachFromLangGroupRequestVNext.php +++ b/codegen/Cms/Blogs/Authors/Model/DetachFromLangGroupRequestVNext.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 */ /** @@ -240,10 +240,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/Cms/Blogs/Authors/Model/Error.php b/codegen/Cms/Blogs/Authors/Model/Error.php index c560b1fce..14b6d35ed 100644 --- a/codegen/Cms/Blogs/Authors/Model/Error.php +++ b/codegen/Cms/Blogs/Authors/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/Cms/Blogs/Authors/Model/ErrorDetail.php b/codegen/Cms/Blogs/Authors/Model/ErrorDetail.php index 7c11c5d70..0c4e70923 100644 --- a/codegen/Cms/Blogs/Authors/Model/ErrorDetail.php +++ b/codegen/Cms/Blogs/Authors/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/Cms/Blogs/Authors/Model/ForwardPaging.php b/codegen/Cms/Blogs/Authors/Model/ForwardPaging.php index 5adb93e1a..4e8d2fa03 100644 --- a/codegen/Cms/Blogs/Authors/Model/ForwardPaging.php +++ b/codegen/Cms/Blogs/Authors/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 */ /** @@ -240,10 +240,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/Cms/Blogs/Authors/Model/ModelInterface.php b/codegen/Cms/Blogs/Authors/Model/ModelInterface.php index 0042e0fdb..036003058 100644 --- a/codegen/Cms/Blogs/Authors/Model/ModelInterface.php +++ b/codegen/Cms/Blogs/Authors/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/Cms/Blogs/Authors/Model/NextPage.php b/codegen/Cms/Blogs/Authors/Model/NextPage.php index e2f81025d..212121b87 100644 --- a/codegen/Cms/Blogs/Authors/Model/NextPage.php +++ b/codegen/Cms/Blogs/Authors/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/Cms/Blogs/Authors/Model/SetNewLanguagePrimaryRequestVNext.php b/codegen/Cms/Blogs/Authors/Model/SetNewLanguagePrimaryRequestVNext.php index 84e2c0fe2..0323e005f 100644 --- a/codegen/Cms/Blogs/Authors/Model/SetNewLanguagePrimaryRequestVNext.php +++ b/codegen/Cms/Blogs/Authors/Model/SetNewLanguagePrimaryRequestVNext.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 */ /** @@ -240,10 +240,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/Cms/Blogs/Authors/Model/StandardError.php b/codegen/Cms/Blogs/Authors/Model/StandardError.php index a130e38eb..0aa354f4c 100644 --- a/codegen/Cms/Blogs/Authors/Model/StandardError.php +++ b/codegen/Cms/Blogs/Authors/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 */ /** @@ -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('sub_category', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); diff --git a/codegen/Cms/Blogs/Authors/Model/UpdateLanguagesRequestVNext.php b/codegen/Cms/Blogs/Authors/Model/UpdateLanguagesRequestVNext.php index 4a3facc66..0b9d1311d 100644 --- a/codegen/Cms/Blogs/Authors/Model/UpdateLanguagesRequestVNext.php +++ b/codegen/Cms/Blogs/Authors/Model/UpdateLanguagesRequestVNext.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('languages', $data ?? [], null); $this->setIfExists('primary_id', $data ?? [], null); diff --git a/codegen/Cms/Blogs/Authors/ObjectSerializer.php b/codegen/Cms/Blogs/Authors/ObjectSerializer.php index 8d16e5011..fe3700083 100644 --- a/codegen/Cms/Blogs/Authors/ObjectSerializer.php +++ b/codegen/Cms/Blogs/Authors/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/Cms/Blogs/BlogPosts/Api/BasicApi.php b/codegen/Cms/Blogs/BlogPosts/Api/BasicApi.php index 09f365fa2..928927e19 100644 --- a/codegen/Cms/Blogs/BlogPosts/Api/BasicApi.php +++ b/codegen/Cms/Blogs/BlogPosts/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 */ /** @@ -125,13 +125,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; } @@ -170,7 +170,7 @@ public function getConfig() * Delete a blog post * * @param string $object_id The ID of the blog post to delete. (required) - * @param bool $archived Whether to return only results that have been deleted. (optional) + * @param bool|null $archived Whether to return only results that have been deleted. (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\Cms\Blogs\BlogPosts\ApiException on non-2xx response or if the response body is not in the expected format @@ -188,7 +188,7 @@ public function archive($object_id, $archived = null, string $contentType = self * Delete a blog post * * @param string $object_id The ID of the blog post to delete. (required) - * @param bool $archived Whether to return only results that have been deleted. (optional) + * @param bool|null $archived Whether to return only results that have been deleted. (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\Cms\Blogs\BlogPosts\ApiException on non-2xx response or if the response body is not in the expected format @@ -221,18 +221,6 @@ public function archiveWithHttpInfo($object_id, $archived = null, string $conten $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } return [null, $statusCode, $response->getHeaders()]; @@ -257,7 +245,7 @@ public function archiveWithHttpInfo($object_id, $archived = null, string $conten * Delete a blog post * * @param string $object_id The ID of the blog post to delete. (required) - * @param bool $archived Whether to return only results that have been deleted. (optional) + * @param bool|null $archived Whether to return only results that have been deleted. (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 @@ -279,7 +267,7 @@ function ($response) { * Delete a blog post * * @param string $object_id The ID of the blog post to delete. (required) - * @param bool $archived Whether to return only results that have been deleted. (optional) + * @param bool|null $archived Whether to return only results that have been deleted. (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 @@ -317,7 +305,7 @@ function ($exception) { * Create request for operation 'archive' * * @param string $object_id The ID of the blog post to delete. (required) - * @param bool $archived Whether to return only results that have been deleted. (optional) + * @param bool|null $archived Whether to return only results that have been deleted. (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 @@ -476,18 +464,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: @@ -546,6 +522,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\Cms\Blogs\BlogPosts\Model\BlogPost'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -821,18 +810,6 @@ public function createWithHttpInfo($blog_post, string $contentType = self::conte $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: @@ -891,6 +868,19 @@ public function createWithHttpInfo($blog_post, string $contentType = self::conte ]; } + 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\Cms\Blogs\BlogPosts\Model\BlogPost'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1116,8 +1106,8 @@ public function createRequest($blog_post, string $contentType = self::contentTyp * Retrieve a blog post * * @param string $object_id The ID of the blog post to retrieve. (required) - * @param bool $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) - * @param string $property Specific properties to return. (optional) + * @param bool|null $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) + * @param string|null $property Specific properties to return. (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\Cms\Blogs\BlogPosts\ApiException on non-2xx response or if the response body is not in the expected format @@ -1136,8 +1126,8 @@ public function getById($object_id, $archived = null, $property = null, string $ * Retrieve a blog post * * @param string $object_id The ID of the blog post to retrieve. (required) - * @param bool $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) - * @param string $property Specific properties to return. (optional) + * @param bool|null $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) + * @param string|null $property Specific properties to return. (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\Cms\Blogs\BlogPosts\ApiException on non-2xx response or if the response body is not in the expected format @@ -1170,18 +1160,6 @@ public function getByIdWithHttpInfo($object_id, $archived = null, $property = 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: @@ -1240,6 +1218,19 @@ public function getByIdWithHttpInfo($object_id, $archived = null, $property = 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\Cms\Blogs\BlogPosts\Model\BlogPost'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1297,8 +1288,8 @@ public function getByIdWithHttpInfo($object_id, $archived = null, $property = nu * Retrieve a blog post * * @param string $object_id The ID of the blog post to retrieve. (required) - * @param bool $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) - * @param string $property Specific properties to return. (optional) + * @param bool|null $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) + * @param string|null $property Specific properties to return. (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 @@ -1320,8 +1311,8 @@ function ($response) { * Retrieve a blog post * * @param string $object_id The ID of the blog post to retrieve. (required) - * @param bool $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) - * @param string $property Specific properties to return. (optional) + * @param bool|null $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) + * @param string|null $property Specific properties to return. (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 @@ -1372,8 +1363,8 @@ function ($exception) { * Create request for operation 'getById' * * @param string $object_id The ID of the blog post to retrieve. (required) - * @param bool $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) - * @param string $property Specific properties to return. (optional) + * @param bool|null $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) + * @param string|null $property Specific properties to return. (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 @@ -1542,18 +1533,6 @@ public function getDraftByIdWithHttpInfo($object_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() - ); - } switch($statusCode) { case 200: @@ -1612,6 +1591,19 @@ public function getDraftByIdWithHttpInfo($object_id, string $contentType = self: ]; } + 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\Cms\Blogs\BlogPosts\Model\BlogPost'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1837,17 +1829,17 @@ public function getDraftByIdRequest($object_id, string $contentType = self::cont * * Get all posts * - * @param \DateTime $created_at Only return blog posts created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return blog posts created after the specified time. (optional) - * @param \DateTime $created_before Only return blog posts created before the specified time. (optional) - * @param \DateTime $updated_at Only return blog posts last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return blog posts last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return blog posts last updated before the specified time. (optional) - * @param string[] $sort Specifies which fields to use for sorting results. Valid fields are `createdAt` (default), `name`, `updatedAt`, `createdBy`, `updatedBy`. (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 20. (optional) - * @param bool $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) - * @param string $property property (optional) + * @param \DateTime|null $created_at Only return blog posts created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return blog posts created after the specified time. (optional) + * @param \DateTime|null $created_before Only return blog posts created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return blog posts last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return blog posts last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return blog posts last updated before the specified time. (optional) + * @param string[]|null $sort Specifies which fields to use for sorting results. Valid fields are `createdAt` (default), `name`, `updatedAt`, `createdBy`, `updatedBy`. (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 20. (optional) + * @param bool|null $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) + * @param string|null $property property (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\Cms\Blogs\BlogPosts\ApiException on non-2xx response or if the response body is not in the expected format @@ -1865,17 +1857,17 @@ public function getPage($created_at = null, $created_after = null, $created_befo * * Get all posts * - * @param \DateTime $created_at Only return blog posts created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return blog posts created after the specified time. (optional) - * @param \DateTime $created_before Only return blog posts created before the specified time. (optional) - * @param \DateTime $updated_at Only return blog posts last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return blog posts last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return blog posts last updated before the specified time. (optional) - * @param string[] $sort Specifies which fields to use for sorting results. Valid fields are `createdAt` (default), `name`, `updatedAt`, `createdBy`, `updatedBy`. (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 20. (optional) - * @param bool $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return blog posts created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return blog posts created after the specified time. (optional) + * @param \DateTime|null $created_before Only return blog posts created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return blog posts last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return blog posts last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return blog posts last updated before the specified time. (optional) + * @param string[]|null $sort Specifies which fields to use for sorting results. Valid fields are `createdAt` (default), `name`, `updatedAt`, `createdBy`, `updatedBy`. (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 20. (optional) + * @param bool|null $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) + * @param string|null $property (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\Cms\Blogs\BlogPosts\ApiException on non-2xx response or if the response body is not in the expected format @@ -1908,18 +1900,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: @@ -1978,6 +1958,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\Cms\Blogs\BlogPosts\Model\CollectionResponseWithTotalBlogPostForwardPaging'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2034,17 +2027,17 @@ public function getPageWithHttpInfo($created_at = null, $created_after = null, $ * * Get all posts * - * @param \DateTime $created_at Only return blog posts created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return blog posts created after the specified time. (optional) - * @param \DateTime $created_before Only return blog posts created before the specified time. (optional) - * @param \DateTime $updated_at Only return blog posts last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return blog posts last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return blog posts last updated before the specified time. (optional) - * @param string[] $sort Specifies which fields to use for sorting results. Valid fields are `createdAt` (default), `name`, `updatedAt`, `createdBy`, `updatedBy`. (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 20. (optional) - * @param bool $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return blog posts created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return blog posts created after the specified time. (optional) + * @param \DateTime|null $created_before Only return blog posts created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return blog posts last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return blog posts last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return blog posts last updated before the specified time. (optional) + * @param string[]|null $sort Specifies which fields to use for sorting results. Valid fields are `createdAt` (default), `name`, `updatedAt`, `createdBy`, `updatedBy`. (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 20. (optional) + * @param bool|null $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) + * @param string|null $property (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 @@ -2065,17 +2058,17 @@ function ($response) { * * Get all posts * - * @param \DateTime $created_at Only return blog posts created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return blog posts created after the specified time. (optional) - * @param \DateTime $created_before Only return blog posts created before the specified time. (optional) - * @param \DateTime $updated_at Only return blog posts last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return blog posts last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return blog posts last updated before the specified time. (optional) - * @param string[] $sort Specifies which fields to use for sorting results. Valid fields are `createdAt` (default), `name`, `updatedAt`, `createdBy`, `updatedBy`. (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 20. (optional) - * @param bool $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return blog posts created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return blog posts created after the specified time. (optional) + * @param \DateTime|null $created_before Only return blog posts created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return blog posts last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return blog posts last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return blog posts last updated before the specified time. (optional) + * @param string[]|null $sort Specifies which fields to use for sorting results. Valid fields are `createdAt` (default), `name`, `updatedAt`, `createdBy`, `updatedBy`. (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 20. (optional) + * @param bool|null $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) + * @param string|null $property (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 @@ -2125,17 +2118,17 @@ function ($exception) { /** * Create request for operation 'getPage' * - * @param \DateTime $created_at Only return blog posts created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return blog posts created after the specified time. (optional) - * @param \DateTime $created_before Only return blog posts created before the specified time. (optional) - * @param \DateTime $updated_at Only return blog posts last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return blog posts last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return blog posts last updated before the specified time. (optional) - * @param string[] $sort Specifies which fields to use for sorting results. Valid fields are `createdAt` (default), `name`, `updatedAt`, `createdBy`, `updatedBy`. (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 20. (optional) - * @param bool $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return blog posts created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return blog posts created after the specified time. (optional) + * @param \DateTime|null $created_before Only return blog posts created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return blog posts last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return blog posts last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return blog posts last updated before the specified time. (optional) + * @param string[]|null $sort Specifies which fields to use for sorting results. Valid fields are `createdAt` (default), `name`, `updatedAt`, `createdBy`, `updatedBy`. (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 20. (optional) + * @param bool|null $archived Specifies whether to return deleted blog posts. Defaults to `false`. (optional) + * @param string|null $property (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 @@ -2381,18 +2374,6 @@ public function getPreviousVersionWithHttpInfo($object_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: @@ -2451,6 +2432,19 @@ public function getPreviousVersionWithHttpInfo($object_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\Cms\Blogs\BlogPosts\Model\VersionBlogPost'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2695,9 +2689,9 @@ public function getPreviousVersionRequest($object_id, $revision_id, string $cont * Retrieves all previous versions of a post * * @param string $object_id The ID of the blog post to retrieve previous versions of. (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 before (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 before (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['getPreviousVersions'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Blogs\BlogPosts\ApiException on non-2xx response or if the response body is not in the expected format @@ -2716,9 +2710,9 @@ public function getPreviousVersions($object_id, $after = null, $before = null, $ * Retrieves all previous versions of a post * * @param string $object_id The ID of the blog post to retrieve previous versions of. (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 (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 (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['getPreviousVersions'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Blogs\BlogPosts\ApiException on non-2xx response or if the response body is not in the expected format @@ -2751,18 +2745,6 @@ public function getPreviousVersionsWithHttpInfo($object_id, $after = null, $befo $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: @@ -2821,6 +2803,19 @@ public function getPreviousVersionsWithHttpInfo($object_id, $after = null, $befo ]; } + 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\Cms\Blogs\BlogPosts\Model\CollectionResponseWithTotalVersionBlogPost'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2878,9 +2873,9 @@ public function getPreviousVersionsWithHttpInfo($object_id, $after = null, $befo * Retrieves all previous versions of a post * * @param string $object_id The ID of the blog post to retrieve previous versions of. (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 (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 (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['getPreviousVersions'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2902,9 +2897,9 @@ function ($response) { * Retrieves all previous versions of a post * * @param string $object_id The ID of the blog post to retrieve previous versions of. (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 (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 (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['getPreviousVersions'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2955,9 +2950,9 @@ function ($exception) { * Create request for operation 'getPreviousVersions' * * @param string $object_id The ID of the blog post to retrieve previous versions of. (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 (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 (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['getPreviousVersions'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -3135,18 +3130,6 @@ public function pushLiveWithHttpInfo($object_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()]; @@ -3376,18 +3359,6 @@ public function resetDraftWithHttpInfo($object_id, string $contentType = self::c $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } return [null, $statusCode, $response->getHeaders()]; @@ -3620,18 +3591,6 @@ public function restorePreviousVersionWithHttpInfo($object_id, $revision_id, 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: @@ -3690,6 +3649,19 @@ public function restorePreviousVersionWithHttpInfo($object_id, $revision_id, 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\Cms\Blogs\BlogPosts\Model\BlogPost'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -3986,18 +3958,6 @@ public function restorePreviousVersionToDraftWithHttpInfo($object_id, $revision_ $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: @@ -4056,6 +4016,19 @@ public function restorePreviousVersionToDraftWithHttpInfo($object_id, $revision_ ]; } + 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\Cms\Blogs\BlogPosts\Model\BlogPost'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -4349,18 +4322,6 @@ public function scheduleWithHttpInfo($content_schedule_request_v_next, string $c $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } return [null, $statusCode, $response->getHeaders()]; @@ -4541,7 +4502,7 @@ public function scheduleRequest($content_schedule_request_v_next, string $conten * * @param string $object_id The ID of the blog post to update. (required) * @param \HubSpot\Client\Cms\Blogs\BlogPosts\Model\BlogPost $blog_post The JSON representation of the updated Blog Post. (required) - * @param bool $archived Specifies whether to update deleted blog posts. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted blog posts. Defaults to `false`. (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\Cms\Blogs\BlogPosts\ApiException on non-2xx response or if the response body is not in the expected format @@ -4561,7 +4522,7 @@ public function update($object_id, $blog_post, $archived = null, string $content * * @param string $object_id The ID of the blog post to update. (required) * @param \HubSpot\Client\Cms\Blogs\BlogPosts\Model\BlogPost $blog_post The JSON representation of the updated Blog Post. (required) - * @param bool $archived Specifies whether to update deleted blog posts. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted blog posts. Defaults to `false`. (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\Cms\Blogs\BlogPosts\ApiException on non-2xx response or if the response body is not in the expected format @@ -4594,18 +4555,6 @@ public function updateWithHttpInfo($object_id, $blog_post, $archived = null, 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: @@ -4664,6 +4613,19 @@ public function updateWithHttpInfo($object_id, $blog_post, $archived = null, 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\Cms\Blogs\BlogPosts\Model\BlogPost'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -4722,7 +4684,7 @@ public function updateWithHttpInfo($object_id, $blog_post, $archived = null, str * * @param string $object_id The ID of the blog post to update. (required) * @param \HubSpot\Client\Cms\Blogs\BlogPosts\Model\BlogPost $blog_post The JSON representation of the updated Blog Post. (required) - * @param bool $archived Specifies whether to update deleted blog posts. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted blog posts. Defaults to `false`. (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 @@ -4745,7 +4707,7 @@ function ($response) { * * @param string $object_id The ID of the blog post to update. (required) * @param \HubSpot\Client\Cms\Blogs\BlogPosts\Model\BlogPost $blog_post The JSON representation of the updated Blog Post. (required) - * @param bool $archived Specifies whether to update deleted blog posts. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted blog posts. Defaults to `false`. (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 @@ -4797,7 +4759,7 @@ function ($exception) { * * @param string $object_id The ID of the blog post to update. (required) * @param \HubSpot\Client\Cms\Blogs\BlogPosts\Model\BlogPost $blog_post The JSON representation of the updated Blog Post. (required) - * @param bool $archived Specifies whether to update deleted blog posts. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted blog posts. Defaults to `false`. (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 @@ -4972,18 +4934,6 @@ public function updateDraftWithHttpInfo($object_id, $blog_post, 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: @@ -5042,6 +4992,19 @@ public function updateDraftWithHttpInfo($object_id, $blog_post, 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\Cms\Blogs\BlogPosts\Model\BlogPost'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer diff --git a/codegen/Cms/Blogs/BlogPosts/Api/BatchApi.php b/codegen/Cms/Blogs/BlogPosts/Api/BatchApi.php index 9b0ed1421..051d305ce 100644 --- a/codegen/Cms/Blogs/BlogPosts/Api/BatchApi.php +++ b/codegen/Cms/Blogs/BlogPosts/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 */ /** @@ -92,13 +92,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; } @@ -186,18 +186,6 @@ public function archiveWithHttpInfo($batch_input_string, 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()]; @@ -427,18 +415,6 @@ public function createWithHttpInfo($batch_input_blog_post, 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: @@ -524,6 +500,19 @@ public function createWithHttpInfo($batch_input_blog_post, 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\Cms\Blogs\BlogPosts\Model\BatchResponseBlogPost'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -757,7 +746,7 @@ public function createRequest($batch_input_blog_post, string $contentType = self * Retrieve a batch of Blog Posts * * @param \HubSpot\Client\Cms\Blogs\BlogPosts\Model\BatchInputString $batch_input_string The JSON array of Blog Post ids. (required) - * @param bool $archived Specifies whether to return deleted blog posts Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted blog posts Defaults to `false`. (optional) * @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\Cms\Blogs\BlogPosts\ApiException on non-2xx response or if the response body is not in the expected format @@ -776,7 +765,7 @@ public function read($batch_input_string, $archived = null, string $contentType * Retrieve a batch of Blog Posts * * @param \HubSpot\Client\Cms\Blogs\BlogPosts\Model\BatchInputString $batch_input_string The JSON array of Blog Post ids. (required) - * @param bool $archived Specifies whether to return deleted blog posts Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted blog posts Defaults to `false`. (optional) * @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\Cms\Blogs\BlogPosts\ApiException on non-2xx response or if the response body is not in the expected format @@ -809,18 +798,6 @@ public function readWithHttpInfo($batch_input_string, $archived = null, 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: @@ -906,6 +883,19 @@ public function readWithHttpInfo($batch_input_string, $archived = null, 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\Cms\Blogs\BlogPosts\Model\BatchResponseBlogPost'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -971,7 +961,7 @@ public function readWithHttpInfo($batch_input_string, $archived = null, string $ * Retrieve a batch of Blog Posts * * @param \HubSpot\Client\Cms\Blogs\BlogPosts\Model\BatchInputString $batch_input_string The JSON array of Blog Post ids. (required) - * @param bool $archived Specifies whether to return deleted blog posts Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted blog posts Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -993,7 +983,7 @@ function ($response) { * Retrieve a batch of Blog Posts * * @param \HubSpot\Client\Cms\Blogs\BlogPosts\Model\BatchInputString $batch_input_string The JSON array of Blog Post ids. (required) - * @param bool $archived Specifies whether to return deleted blog posts Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted blog posts Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1044,7 +1034,7 @@ function ($exception) { * Create request for operation 'read' * * @param \HubSpot\Client\Cms\Blogs\BlogPosts\Model\BatchInputString $batch_input_string The JSON array of Blog Post ids. (required) - * @param bool $archived Specifies whether to return deleted blog posts Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted blog posts Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1152,7 +1142,7 @@ public function readRequest($batch_input_string, $archived = null, string $conte * Update a batch of Blog Posts * * @param \HubSpot\Client\Cms\Blogs\BlogPosts\Model\BatchInputJsonNode $batch_input_json_node A JSON array of the JSON representations of the updated Blog Posts. (required) - * @param bool $archived Specifies whether to update deleted Blog Posts. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Posts. Defaults to `false`. (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\Cms\Blogs\BlogPosts\ApiException on non-2xx response or if the response body is not in the expected format @@ -1171,7 +1161,7 @@ public function update($batch_input_json_node, $archived = null, string $content * Update a batch of Blog Posts * * @param \HubSpot\Client\Cms\Blogs\BlogPosts\Model\BatchInputJsonNode $batch_input_json_node A JSON array of the JSON representations of the updated Blog Posts. (required) - * @param bool $archived Specifies whether to update deleted Blog Posts. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Posts. Defaults to `false`. (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\Cms\Blogs\BlogPosts\ApiException on non-2xx response or if the response body is not in the expected format @@ -1204,18 +1194,6 @@ public function updateWithHttpInfo($batch_input_json_node, $archived = null, 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: @@ -1301,6 +1279,19 @@ public function updateWithHttpInfo($batch_input_json_node, $archived = null, 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\Cms\Blogs\BlogPosts\Model\BatchResponseBlogPost'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1366,7 +1357,7 @@ public function updateWithHttpInfo($batch_input_json_node, $archived = null, str * Update a batch of Blog Posts * * @param \HubSpot\Client\Cms\Blogs\BlogPosts\Model\BatchInputJsonNode $batch_input_json_node A JSON array of the JSON representations of the updated Blog Posts. (required) - * @param bool $archived Specifies whether to update deleted Blog Posts. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Posts. Defaults to `false`. (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 @@ -1388,7 +1379,7 @@ function ($response) { * Update a batch of Blog Posts * * @param \HubSpot\Client\Cms\Blogs\BlogPosts\Model\BatchInputJsonNode $batch_input_json_node A JSON array of the JSON representations of the updated Blog Posts. (required) - * @param bool $archived Specifies whether to update deleted Blog Posts. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Posts. Defaults to `false`. (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 @@ -1439,7 +1430,7 @@ function ($exception) { * Create request for operation 'update' * * @param \HubSpot\Client\Cms\Blogs\BlogPosts\Model\BatchInputJsonNode $batch_input_json_node A JSON array of the JSON representations of the updated Blog Posts. (required) - * @param bool $archived Specifies whether to update deleted Blog Posts. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Posts. Defaults to `false`. (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/Cms/Blogs/BlogPosts/Api/MultiLanguageApi.php b/codegen/Cms/Blogs/BlogPosts/Api/MultiLanguageApi.php index 2029311dc..e30809c3f 100644 --- a/codegen/Cms/Blogs/BlogPosts/Api/MultiLanguageApi.php +++ b/codegen/Cms/Blogs/BlogPosts/Api/MultiLanguageApi.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 MultiLanguageApi * @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 attachToLangGroupWithHttpInfo($attach_to_lang_primary_request_v_ $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 createLangVariationWithHttpInfo($blog_post_language_clone_reques $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -500,6 +476,19 @@ public function createLangVariationWithHttpInfo($blog_post_language_clone_reques ]; } + 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\Cms\Blogs\BlogPosts\Model\BlogPost'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -774,18 +763,6 @@ public function detachFromLangGroupWithHttpInfo($detach_from_lang_group_request_ $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()]; @@ -1014,18 +991,6 @@ public function setLangPrimaryWithHttpInfo($set_new_language_primary_request_v_n $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()]; @@ -1254,18 +1219,6 @@ public function updateLangsWithHttpInfo($update_languages_request_v_next, 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()]; diff --git a/codegen/Cms/Blogs/BlogPosts/ApiException.php b/codegen/Cms/Blogs/BlogPosts/ApiException.php index f245ce356..542f1be00 100644 --- a/codegen/Cms/Blogs/BlogPosts/ApiException.php +++ b/codegen/Cms/Blogs/BlogPosts/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/Cms/Blogs/BlogPosts/Configuration.php b/codegen/Cms/Blogs/BlogPosts/Configuration.php index 5921a00c2..8b5db0d0a 100644 --- a/codegen/Cms/Blogs/BlogPosts/Configuration.php +++ b/codegen/Cms/Blogs/BlogPosts/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/Cms/Blogs/BlogPosts/HeaderSelector.php b/codegen/Cms/Blogs/BlogPosts/HeaderSelector.php index f615a4f2f..396474858 100644 --- a/codegen/Cms/Blogs/BlogPosts/HeaderSelector.php +++ b/codegen/Cms/Blogs/BlogPosts/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/Cms/Blogs/BlogPosts/Model/Angle.php b/codegen/Cms/Blogs/BlogPosts/Model/Angle.php index cf7b8670c..242cb7215 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/Angle.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/Angle.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('units', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); diff --git a/codegen/Cms/Blogs/BlogPosts/Model/AttachToLangPrimaryRequestVNext.php b/codegen/Cms/Blogs/BlogPosts/Model/AttachToLangPrimaryRequestVNext.php index 202e3fda2..e9abfa701 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/AttachToLangPrimaryRequestVNext.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/AttachToLangPrimaryRequestVNext.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 */ /** @@ -1781,10 +1781,10 @@ public function getLanguageAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('language', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); diff --git a/codegen/Cms/Blogs/BlogPosts/Model/BackgroundImage.php b/codegen/Cms/Blogs/BlogPosts/Model/BackgroundImage.php index f596f9978..9db2c0e9b 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/BackgroundImage.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/BackgroundImage.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('image_url', $data ?? [], null); $this->setIfExists('background_size', $data ?? [], null); diff --git a/codegen/Cms/Blogs/BlogPosts/Model/BatchInputBlogPost.php b/codegen/Cms/Blogs/BlogPosts/Model/BatchInputBlogPost.php index 2799eb2eb..edf095eed 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/BatchInputBlogPost.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/BatchInputBlogPost.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 */ /** @@ -240,10 +240,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/Cms/Blogs/BlogPosts/Model/BatchInputJsonNode.php b/codegen/Cms/Blogs/BlogPosts/Model/BatchInputJsonNode.php index 5150d3e28..dd90ef651 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/BatchInputJsonNode.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/BatchInputJsonNode.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 */ /** @@ -240,10 +240,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/Cms/Blogs/BlogPosts/Model/BatchInputString.php b/codegen/Cms/Blogs/BlogPosts/Model/BatchInputString.php index bbefe0225..dad13a8a9 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/BatchInputString.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/BatchInputString.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 */ /** @@ -240,10 +240,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/Cms/Blogs/BlogPosts/Model/BatchResponseBlogPost.php b/codegen/Cms/Blogs/BlogPosts/Model/BatchResponseBlogPost.php index a25b97442..e1ce1289f 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/BatchResponseBlogPost.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/BatchResponseBlogPost.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 */ /** @@ -289,10 +289,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/Cms/Blogs/BlogPosts/Model/BatchResponseBlogPostWithErrors.php b/codegen/Cms/Blogs/BlogPosts/Model/BatchResponseBlogPostWithErrors.php index 13a2e1d3f..61a416705 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/BatchResponseBlogPostWithErrors.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/BatchResponseBlogPostWithErrors.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 */ /** @@ -301,10 +301,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/Cms/Blogs/BlogPosts/Model/BlogPost.php b/codegen/Cms/Blogs/BlogPosts/Model/BlogPost.php index caddc1464..5990985f9 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/BlogPost.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/BlogPost.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 */ /** @@ -2266,10 +2266,10 @@ public function getCurrentStateAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('publish_date', $data ?? [], null); $this->setIfExists('language', $data ?? [], null); diff --git a/codegen/Cms/Blogs/BlogPosts/Model/BlogPostLanguageCloneRequestVNext.php b/codegen/Cms/Blogs/BlogPosts/Model/BlogPostLanguageCloneRequestVNext.php index d06ced919..ebd154227 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/BlogPostLanguageCloneRequestVNext.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/BlogPostLanguageCloneRequestVNext.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('language', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); diff --git a/codegen/Cms/Blogs/BlogPosts/Model/BreakpointStyles.php b/codegen/Cms/Blogs/BlogPosts/Model/BreakpointStyles.php index 3612a3e0f..61342fea2 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/BreakpointStyles.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/BreakpointStyles.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('padding', $data ?? [], null); $this->setIfExists('margin', $data ?? [], null); diff --git a/codegen/Cms/Blogs/BlogPosts/Model/CollectionResponseWithTotalBlogPostForwardPaging.php b/codegen/Cms/Blogs/BlogPosts/Model/CollectionResponseWithTotalBlogPostForwardPaging.php index 25ef37930..023c82c7d 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/CollectionResponseWithTotalBlogPostForwardPaging.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/CollectionResponseWithTotalBlogPostForwardPaging.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/Cms/Blogs/BlogPosts/Model/CollectionResponseWithTotalVersionBlogPost.php b/codegen/Cms/Blogs/BlogPosts/Model/CollectionResponseWithTotalVersionBlogPost.php index febcee5bb..20cb69a49 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/CollectionResponseWithTotalVersionBlogPost.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/CollectionResponseWithTotalVersionBlogPost.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/Cms/Blogs/BlogPosts/Model/ColorStop.php b/codegen/Cms/Blogs/BlogPosts/Model/ColorStop.php index 59b77fd39..ace9583c6 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/ColorStop.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/ColorStop.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('color', $data ?? [], null); } diff --git a/codegen/Cms/Blogs/BlogPosts/Model/ContentCloneRequestVNext.php b/codegen/Cms/Blogs/BlogPosts/Model/ContentCloneRequestVNext.php index 058862d10..e3a2428b0 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/ContentCloneRequestVNext.php +++ b/codegen/Cms/Blogs/BlogPosts/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/Cms/Blogs/BlogPosts/Model/ContentLanguageVariation.php b/codegen/Cms/Blogs/BlogPosts/Model/ContentLanguageVariation.php index c23935c8f..92c8d1ac2 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/ContentLanguageVariation.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/ContentLanguageVariation.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -323,10 +323,10 @@ public function 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('archived_in_dashboard', $data ?? [], null); $this->setIfExists('created', $data ?? [], null); diff --git a/codegen/Cms/Blogs/BlogPosts/Model/ContentScheduleRequestVNext.php b/codegen/Cms/Blogs/BlogPosts/Model/ContentScheduleRequestVNext.php index 163f1344d..ebfcfe6f7 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/ContentScheduleRequestVNext.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/ContentScheduleRequestVNext.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('publish_date', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); diff --git a/codegen/Cms/Blogs/BlogPosts/Model/DetachFromLangGroupRequestVNext.php b/codegen/Cms/Blogs/BlogPosts/Model/DetachFromLangGroupRequestVNext.php index 7f04b03e2..2c9d3c9a7 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/DetachFromLangGroupRequestVNext.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/DetachFromLangGroupRequestVNext.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 */ /** @@ -240,10 +240,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/Cms/Blogs/BlogPosts/Model/Error.php b/codegen/Cms/Blogs/BlogPosts/Model/Error.php index 2e97ef82c..f085753ee 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/Error.php +++ b/codegen/Cms/Blogs/BlogPosts/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/Cms/Blogs/BlogPosts/Model/ErrorDetail.php b/codegen/Cms/Blogs/BlogPosts/Model/ErrorDetail.php index 1f5118fa4..20640f4e0 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/ErrorDetail.php +++ b/codegen/Cms/Blogs/BlogPosts/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/Cms/Blogs/BlogPosts/Model/ForwardPaging.php b/codegen/Cms/Blogs/BlogPosts/Model/ForwardPaging.php index 95350cc57..0ca2d6808 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/ForwardPaging.php +++ b/codegen/Cms/Blogs/BlogPosts/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 */ /** @@ -240,10 +240,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/Cms/Blogs/BlogPosts/Model/Gradient.php b/codegen/Cms/Blogs/BlogPosts/Model/Gradient.php index 48cb6aaad..4b99d9423 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/Gradient.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/Gradient.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('angle', $data ?? [], null); $this->setIfExists('side_or_corner', $data ?? [], null); diff --git a/codegen/Cms/Blogs/BlogPosts/Model/LayoutSection.php b/codegen/Cms/Blogs/BlogPosts/Model/LayoutSection.php index 309727a88..61464f9c9 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/LayoutSection.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/LayoutSection.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 */ /** @@ -311,10 +311,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('css_style', $data ?? [], null); $this->setIfExists('label', $data ?? [], null); diff --git a/codegen/Cms/Blogs/BlogPosts/Model/ModelInterface.php b/codegen/Cms/Blogs/BlogPosts/Model/ModelInterface.php index 76755fe14..80f8951e3 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/ModelInterface.php +++ b/codegen/Cms/Blogs/BlogPosts/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/Cms/Blogs/BlogPosts/Model/NextPage.php b/codegen/Cms/Blogs/BlogPosts/Model/NextPage.php index d28692ee0..7017223f5 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/NextPage.php +++ b/codegen/Cms/Blogs/BlogPosts/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/Cms/Blogs/BlogPosts/Model/Paging.php b/codegen/Cms/Blogs/BlogPosts/Model/Paging.php index c08b62038..5064409d5 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/Paging.php +++ b/codegen/Cms/Blogs/BlogPosts/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/Cms/Blogs/BlogPosts/Model/PreviousPage.php b/codegen/Cms/Blogs/BlogPosts/Model/PreviousPage.php index 5bb4e82ba..5f200fde4 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/PreviousPage.php +++ b/codegen/Cms/Blogs/BlogPosts/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/Cms/Blogs/BlogPosts/Model/RGBAColor.php b/codegen/Cms/Blogs/BlogPosts/Model/RGBAColor.php index a62c873f0..d62fc7577 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/RGBAColor.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/RGBAColor.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('a', $data ?? [], null); $this->setIfExists('r', $data ?? [], null); diff --git a/codegen/Cms/Blogs/BlogPosts/Model/RowMetaData.php b/codegen/Cms/Blogs/BlogPosts/Model/RowMetaData.php index 0f1d883c0..bd04700d8 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/RowMetaData.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/RowMetaData.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('css_class', $data ?? [], null); $this->setIfExists('styles', $data ?? [], null); diff --git a/codegen/Cms/Blogs/BlogPosts/Model/SetNewLanguagePrimaryRequestVNext.php b/codegen/Cms/Blogs/BlogPosts/Model/SetNewLanguagePrimaryRequestVNext.php index eca67a79c..2eda417db 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/SetNewLanguagePrimaryRequestVNext.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/SetNewLanguagePrimaryRequestVNext.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 */ /** @@ -240,10 +240,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/Cms/Blogs/BlogPosts/Model/SideOrCorner.php b/codegen/Cms/Blogs/BlogPosts/Model/SideOrCorner.php index 34e0ad45d..ffdc25f2c 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/SideOrCorner.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/SideOrCorner.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('horizontal_side', $data ?? [], null); $this->setIfExists('vertical_side', $data ?? [], null); diff --git a/codegen/Cms/Blogs/BlogPosts/Model/StandardError.php b/codegen/Cms/Blogs/BlogPosts/Model/StandardError.php index a53206ffd..5e1eff513 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/StandardError.php +++ b/codegen/Cms/Blogs/BlogPosts/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 */ /** @@ -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('sub_category', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); diff --git a/codegen/Cms/Blogs/BlogPosts/Model/Styles.php b/codegen/Cms/Blogs/BlogPosts/Model/Styles.php index 929504e35..d766079e8 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/Styles.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/Styles.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('background_color', $data ?? [], null); $this->setIfExists('flexbox_positioning', $data ?? [], null); diff --git a/codegen/Cms/Blogs/BlogPosts/Model/UpdateLanguagesRequestVNext.php b/codegen/Cms/Blogs/BlogPosts/Model/UpdateLanguagesRequestVNext.php index d6e15b250..b835fd301 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/UpdateLanguagesRequestVNext.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/UpdateLanguagesRequestVNext.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('languages', $data ?? [], null); $this->setIfExists('primary_id', $data ?? [], null); diff --git a/codegen/Cms/Blogs/BlogPosts/Model/VersionBlogPost.php b/codegen/Cms/Blogs/BlogPosts/Model/VersionBlogPost.php index 7b1e49304..4a0f8061a 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/VersionBlogPost.php +++ b/codegen/Cms/Blogs/BlogPosts/Model/VersionBlogPost.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/Cms/Blogs/BlogPosts/Model/VersionUser.php b/codegen/Cms/Blogs/BlogPosts/Model/VersionUser.php index 37b4d8a81..619f88f53 100644 --- a/codegen/Cms/Blogs/BlogPosts/Model/VersionUser.php +++ b/codegen/Cms/Blogs/BlogPosts/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/Cms/Blogs/BlogPosts/ObjectSerializer.php b/codegen/Cms/Blogs/BlogPosts/ObjectSerializer.php index 381ac4f4d..3184195a8 100644 --- a/codegen/Cms/Blogs/BlogPosts/ObjectSerializer.php +++ b/codegen/Cms/Blogs/BlogPosts/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/Cms/Blogs/Tags/Api/BlogTagsApi.php b/codegen/Cms/Blogs/Tags/Api/BlogTagsApi.php index 2c4608e8b..e6600920a 100644 --- a/codegen/Cms/Blogs/Tags/Api/BlogTagsApi.php +++ b/codegen/Cms/Blogs/Tags/Api/BlogTagsApi.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 */ /** @@ -122,13 +122,13 @@ class BlogTagsApi * @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; } @@ -167,7 +167,7 @@ public function getConfig() * Delete a Blog Tag * * @param string $object_id The Blog Tag id. (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\Cms\Blogs\Tags\ApiException on non-2xx response or if the response body is not in the expected format @@ -185,7 +185,7 @@ public function archive($object_id, $archived = null, string $contentType = self * Delete a Blog Tag * * @param string $object_id The Blog Tag id. (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\Cms\Blogs\Tags\ApiException on non-2xx response or if the response body is not in the expected format @@ -218,18 +218,6 @@ public function archiveWithHttpInfo($object_id, $archived = null, string $conten $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } return [null, $statusCode, $response->getHeaders()]; @@ -254,7 +242,7 @@ public function archiveWithHttpInfo($object_id, $archived = null, string $conten * Delete a Blog Tag * * @param string $object_id The Blog Tag id. (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 @@ -276,7 +264,7 @@ function ($response) { * Delete a Blog Tag * * @param string $object_id The Blog Tag id. (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 @@ -314,7 +302,7 @@ function ($exception) { * Create request for operation 'archive' * * @param string $object_id The Blog Tag id. (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 @@ -472,18 +460,6 @@ public function archiveBatchWithHttpInfo($batch_input_string, string $contentTyp $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()]; @@ -712,18 +688,6 @@ public function attachToLangGroupWithHttpInfo($attach_to_lang_primary_request_v_ $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()]; @@ -953,18 +917,6 @@ public function createWithHttpInfo($tag, string $contentType = self::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: @@ -1023,6 +975,19 @@ public function createWithHttpInfo($tag, string $contentType = self::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\Cms\Blogs\Tags\Model\Tag'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1298,18 +1263,6 @@ public function createBatchWithHttpInfo($batch_input_tag, 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: @@ -1395,6 +1348,19 @@ public function createBatchWithHttpInfo($batch_input_tag, 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\Cms\Blogs\Tags\Model\BatchResponseTag'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1678,18 +1644,6 @@ public function createLangVariationWithHttpInfo($tag_clone_request_v_next, 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 200: @@ -1748,6 +1702,19 @@ public function createLangVariationWithHttpInfo($tag_clone_request_v_next, 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\Cms\Blogs\Tags\Model\Tag'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2022,18 +1989,6 @@ public function detachFromLangGroupWithHttpInfo($detach_from_lang_group_request_ $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()]; @@ -2213,8 +2168,8 @@ public function detachFromLangGroupRequest($detach_from_lang_group_request_v_nex * Retrieve a Blog Tag * * @param string $object_id The Blog Tag id. (required) - * @param bool $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) - * @param string $property property (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) + * @param string|null $property property (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\Cms\Blogs\Tags\ApiException on non-2xx response or if the response body is not in the expected format @@ -2233,8 +2188,8 @@ public function getById($object_id, $archived = null, $property = null, string $ * Retrieve a Blog Tag * * @param string $object_id The Blog Tag id. (required) - * @param bool $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) + * @param string|null $property (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\Cms\Blogs\Tags\ApiException on non-2xx response or if the response body is not in the expected format @@ -2267,18 +2222,6 @@ public function getByIdWithHttpInfo($object_id, $archived = null, $property = 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: @@ -2337,6 +2280,19 @@ public function getByIdWithHttpInfo($object_id, $archived = null, $property = 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\Cms\Blogs\Tags\Model\Tag'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2394,8 +2350,8 @@ public function getByIdWithHttpInfo($object_id, $archived = null, $property = nu * Retrieve a Blog Tag * * @param string $object_id The Blog Tag id. (required) - * @param bool $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) + * @param string|null $property (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 @@ -2417,8 +2373,8 @@ function ($response) { * Retrieve a Blog Tag * * @param string $object_id The Blog Tag id. (required) - * @param bool $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) + * @param string|null $property (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 @@ -2469,8 +2425,8 @@ function ($exception) { * Create request for operation 'getById' * * @param string $object_id The Blog Tag id. (required) - * @param bool $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) + * @param string|null $property (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 @@ -2588,17 +2544,17 @@ public function getByIdRequest($object_id, $archived = null, $property = null, s * * Get all Blog Tags * - * @param \DateTime $created_at Only return Blog Tags created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Blog Tags created after the specified time. (optional) - * @param \DateTime $created_before Only return Blog Tags created before the specified time. (optional) - * @param \DateTime $updated_at Only return Blog Tags last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Blog Tags last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Blog Tags 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 $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) - * @param string $property property (optional) + * @param \DateTime|null $created_at Only return Blog Tags created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Blog Tags created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Blog Tags created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Blog Tags last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Blog Tags last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Blog Tags 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 $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) + * @param string|null $property property (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\Cms\Blogs\Tags\ApiException on non-2xx response or if the response body is not in the expected format @@ -2616,17 +2572,17 @@ public function getPage($created_at = null, $created_after = null, $created_befo * * Get all Blog Tags * - * @param \DateTime $created_at Only return Blog Tags created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Blog Tags created after the specified time. (optional) - * @param \DateTime $created_before Only return Blog Tags created before the specified time. (optional) - * @param \DateTime $updated_at Only return Blog Tags last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Blog Tags last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Blog Tags 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 $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Blog Tags created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Blog Tags created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Blog Tags created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Blog Tags last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Blog Tags last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Blog Tags 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 $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) + * @param string|null $property (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\Cms\Blogs\Tags\ApiException on non-2xx response or if the response body is not in the expected format @@ -2659,18 +2615,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: @@ -2729,6 +2673,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\Cms\Blogs\Tags\Model\CollectionResponseWithTotalTagForwardPaging'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2785,17 +2742,17 @@ public function getPageWithHttpInfo($created_at = null, $created_after = null, $ * * Get all Blog Tags * - * @param \DateTime $created_at Only return Blog Tags created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Blog Tags created after the specified time. (optional) - * @param \DateTime $created_before Only return Blog Tags created before the specified time. (optional) - * @param \DateTime $updated_at Only return Blog Tags last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Blog Tags last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Blog Tags 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 $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Blog Tags created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Blog Tags created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Blog Tags created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Blog Tags last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Blog Tags last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Blog Tags 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 $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) + * @param string|null $property (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 @@ -2816,17 +2773,17 @@ function ($response) { * * Get all Blog Tags * - * @param \DateTime $created_at Only return Blog Tags created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Blog Tags created after the specified time. (optional) - * @param \DateTime $created_before Only return Blog Tags created before the specified time. (optional) - * @param \DateTime $updated_at Only return Blog Tags last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Blog Tags last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Blog Tags 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 $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Blog Tags created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Blog Tags created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Blog Tags created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Blog Tags last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Blog Tags last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Blog Tags 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 $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) + * @param string|null $property (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 @@ -2876,17 +2833,17 @@ function ($exception) { /** * Create request for operation 'getPage' * - * @param \DateTime $created_at Only return Blog Tags created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Blog Tags created after the specified time. (optional) - * @param \DateTime $created_before Only return Blog Tags created before the specified time. (optional) - * @param \DateTime $updated_at Only return Blog Tags last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Blog Tags last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Blog Tags 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 $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Blog Tags created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Blog Tags created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Blog Tags created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Blog Tags last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Blog Tags last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Blog Tags 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 $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) + * @param string|null $property (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 @@ -3080,7 +3037,7 @@ public function getPageRequest($created_at = null, $created_after = null, $creat * Retrieve a batch of Blog Tags * * @param \HubSpot\Client\Cms\Blogs\Tags\Model\BatchInputString $batch_input_string The JSON array of Blog Tag ids. (required) - * @param bool $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readBatch'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Blogs\Tags\ApiException on non-2xx response or if the response body is not in the expected format @@ -3099,7 +3056,7 @@ public function readBatch($batch_input_string, $archived = null, string $content * Retrieve a batch of Blog Tags * * @param \HubSpot\Client\Cms\Blogs\Tags\Model\BatchInputString $batch_input_string The JSON array of Blog Tag ids. (required) - * @param bool $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readBatch'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Blogs\Tags\ApiException on non-2xx response or if the response body is not in the expected format @@ -3132,18 +3089,6 @@ public function readBatchWithHttpInfo($batch_input_string, $archived = null, 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: @@ -3229,6 +3174,19 @@ public function readBatchWithHttpInfo($batch_input_string, $archived = null, 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\Cms\Blogs\Tags\Model\BatchResponseTag'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -3294,7 +3252,7 @@ public function readBatchWithHttpInfo($batch_input_string, $archived = null, str * Retrieve a batch of Blog Tags * * @param \HubSpot\Client\Cms\Blogs\Tags\Model\BatchInputString $batch_input_string The JSON array of Blog Tag ids. (required) - * @param bool $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readBatch'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -3316,7 +3274,7 @@ function ($response) { * Retrieve a batch of Blog Tags * * @param \HubSpot\Client\Cms\Blogs\Tags\Model\BatchInputString $batch_input_string The JSON array of Blog Tag ids. (required) - * @param bool $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readBatch'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -3367,7 +3325,7 @@ function ($exception) { * Create request for operation 'readBatch' * * @param \HubSpot\Client\Cms\Blogs\Tags\Model\BatchInputString $batch_input_string The JSON array of Blog Tag ids. (required) - * @param bool $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Blog Tags. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readBatch'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -3524,18 +3482,6 @@ public function setLangPrimaryWithHttpInfo($set_new_language_primary_request_v_n $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()]; @@ -3716,7 +3662,7 @@ public function setLangPrimaryRequest($set_new_language_primary_request_v_next, * * @param string $object_id The Blog Tag id. (required) * @param \HubSpot\Client\Cms\Blogs\Tags\Model\Tag $tag The JSON representation of the updated Blog Tag. (required) - * @param bool $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (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\Cms\Blogs\Tags\ApiException on non-2xx response or if the response body is not in the expected format @@ -3736,7 +3682,7 @@ public function update($object_id, $tag, $archived = null, string $contentType = * * @param string $object_id The Blog Tag id. (required) * @param \HubSpot\Client\Cms\Blogs\Tags\Model\Tag $tag The JSON representation of the updated Blog Tag. (required) - * @param bool $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (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\Cms\Blogs\Tags\ApiException on non-2xx response or if the response body is not in the expected format @@ -3769,18 +3715,6 @@ public function updateWithHttpInfo($object_id, $tag, $archived = null, string $c $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -3839,6 +3773,19 @@ public function updateWithHttpInfo($object_id, $tag, $archived = null, string $c ]; } + 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\Cms\Blogs\Tags\Model\Tag'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -3897,7 +3844,7 @@ public function updateWithHttpInfo($object_id, $tag, $archived = null, string $c * * @param string $object_id The Blog Tag id. (required) * @param \HubSpot\Client\Cms\Blogs\Tags\Model\Tag $tag The JSON representation of the updated Blog Tag. (required) - * @param bool $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (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 @@ -3920,7 +3867,7 @@ function ($response) { * * @param string $object_id The Blog Tag id. (required) * @param \HubSpot\Client\Cms\Blogs\Tags\Model\Tag $tag The JSON representation of the updated Blog Tag. (required) - * @param bool $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (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 @@ -3972,7 +3919,7 @@ function ($exception) { * * @param string $object_id The Blog Tag id. (required) * @param \HubSpot\Client\Cms\Blogs\Tags\Model\Tag $tag The JSON representation of the updated Blog Tag. (required) - * @param bool $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (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 @@ -4095,7 +4042,7 @@ public function updateRequest($object_id, $tag, $archived = null, string $conten * Update a batch of Blog Tags * * @param \HubSpot\Client\Cms\Blogs\Tags\Model\BatchInputJsonNode $batch_input_json_node A JSON array of the JSON representations of the updated Blog Tags. (required) - * @param bool $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBatch'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Blogs\Tags\ApiException on non-2xx response or if the response body is not in the expected format @@ -4114,7 +4061,7 @@ public function updateBatch($batch_input_json_node, $archived = null, string $co * Update a batch of Blog Tags * * @param \HubSpot\Client\Cms\Blogs\Tags\Model\BatchInputJsonNode $batch_input_json_node A JSON array of the JSON representations of the updated Blog Tags. (required) - * @param bool $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBatch'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Blogs\Tags\ApiException on non-2xx response or if the response body is not in the expected format @@ -4147,18 +4094,6 @@ public function updateBatchWithHttpInfo($batch_input_json_node, $archived = 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: @@ -4244,6 +4179,19 @@ public function updateBatchWithHttpInfo($batch_input_json_node, $archived = 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\Cms\Blogs\Tags\Model\BatchResponseTag'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -4309,7 +4257,7 @@ public function updateBatchWithHttpInfo($batch_input_json_node, $archived = null * Update a batch of Blog Tags * * @param \HubSpot\Client\Cms\Blogs\Tags\Model\BatchInputJsonNode $batch_input_json_node A JSON array of the JSON representations of the updated Blog Tags. (required) - * @param bool $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBatch'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -4331,7 +4279,7 @@ function ($response) { * Update a batch of Blog Tags * * @param \HubSpot\Client\Cms\Blogs\Tags\Model\BatchInputJsonNode $batch_input_json_node A JSON array of the JSON representations of the updated Blog Tags. (required) - * @param bool $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBatch'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -4382,7 +4330,7 @@ function ($exception) { * Create request for operation 'updateBatch' * * @param \HubSpot\Client\Cms\Blogs\Tags\Model\BatchInputJsonNode $batch_input_json_node A JSON array of the JSON representations of the updated Blog Tags. (required) - * @param bool $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Blog Tags. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBatch'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -4539,18 +4487,6 @@ public function updateLangsWithHttpInfo($update_languages_request_v_next, 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()]; diff --git a/codegen/Cms/Blogs/Tags/ApiException.php b/codegen/Cms/Blogs/Tags/ApiException.php index 634c04c74..0213c579b 100644 --- a/codegen/Cms/Blogs/Tags/ApiException.php +++ b/codegen/Cms/Blogs/Tags/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/Cms/Blogs/Tags/Configuration.php b/codegen/Cms/Blogs/Tags/Configuration.php index b35409b30..cecd52ab9 100644 --- a/codegen/Cms/Blogs/Tags/Configuration.php +++ b/codegen/Cms/Blogs/Tags/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/Cms/Blogs/Tags/HeaderSelector.php b/codegen/Cms/Blogs/Tags/HeaderSelector.php index 82960b742..f68d99656 100644 --- a/codegen/Cms/Blogs/Tags/HeaderSelector.php +++ b/codegen/Cms/Blogs/Tags/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/Cms/Blogs/Tags/Model/AttachToLangPrimaryRequestVNext.php b/codegen/Cms/Blogs/Tags/Model/AttachToLangPrimaryRequestVNext.php index 3b5286ac7..58f4a51b4 100644 --- a/codegen/Cms/Blogs/Tags/Model/AttachToLangPrimaryRequestVNext.php +++ b/codegen/Cms/Blogs/Tags/Model/AttachToLangPrimaryRequestVNext.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('language', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); diff --git a/codegen/Cms/Blogs/Tags/Model/BatchInputJsonNode.php b/codegen/Cms/Blogs/Tags/Model/BatchInputJsonNode.php index 7e59e16fc..0c6630f32 100644 --- a/codegen/Cms/Blogs/Tags/Model/BatchInputJsonNode.php +++ b/codegen/Cms/Blogs/Tags/Model/BatchInputJsonNode.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 */ /** @@ -240,10 +240,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/Cms/Blogs/Tags/Model/BatchInputString.php b/codegen/Cms/Blogs/Tags/Model/BatchInputString.php index ae472bcc5..4c181bf67 100644 --- a/codegen/Cms/Blogs/Tags/Model/BatchInputString.php +++ b/codegen/Cms/Blogs/Tags/Model/BatchInputString.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 */ /** @@ -240,10 +240,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/Cms/Blogs/Tags/Model/BatchInputTag.php b/codegen/Cms/Blogs/Tags/Model/BatchInputTag.php index dd80d03c4..110f883ef 100644 --- a/codegen/Cms/Blogs/Tags/Model/BatchInputTag.php +++ b/codegen/Cms/Blogs/Tags/Model/BatchInputTag.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 */ /** @@ -240,10 +240,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/Cms/Blogs/Tags/Model/BatchResponseTag.php b/codegen/Cms/Blogs/Tags/Model/BatchResponseTag.php index df246f4f9..52b6579d3 100644 --- a/codegen/Cms/Blogs/Tags/Model/BatchResponseTag.php +++ b/codegen/Cms/Blogs/Tags/Model/BatchResponseTag.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 */ /** @@ -289,10 +289,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/Cms/Blogs/Tags/Model/BatchResponseTagWithErrors.php b/codegen/Cms/Blogs/Tags/Model/BatchResponseTagWithErrors.php index 943170d88..69c8df3da 100644 --- a/codegen/Cms/Blogs/Tags/Model/BatchResponseTagWithErrors.php +++ b/codegen/Cms/Blogs/Tags/Model/BatchResponseTagWithErrors.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 */ /** @@ -301,10 +301,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/Cms/Blogs/Tags/Model/CollectionResponseWithTotalTagForwardPaging.php b/codegen/Cms/Blogs/Tags/Model/CollectionResponseWithTotalTagForwardPaging.php index e67ed75f7..d46ea5562 100644 --- a/codegen/Cms/Blogs/Tags/Model/CollectionResponseWithTotalTagForwardPaging.php +++ b/codegen/Cms/Blogs/Tags/Model/CollectionResponseWithTotalTagForwardPaging.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/Cms/Blogs/Tags/Model/DetachFromLangGroupRequestVNext.php b/codegen/Cms/Blogs/Tags/Model/DetachFromLangGroupRequestVNext.php index 752456162..1be5b1e85 100644 --- a/codegen/Cms/Blogs/Tags/Model/DetachFromLangGroupRequestVNext.php +++ b/codegen/Cms/Blogs/Tags/Model/DetachFromLangGroupRequestVNext.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 */ /** @@ -240,10 +240,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/Cms/Blogs/Tags/Model/Error.php b/codegen/Cms/Blogs/Tags/Model/Error.php index c284a26d4..fc110c3ff 100644 --- a/codegen/Cms/Blogs/Tags/Model/Error.php +++ b/codegen/Cms/Blogs/Tags/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/Cms/Blogs/Tags/Model/ErrorDetail.php b/codegen/Cms/Blogs/Tags/Model/ErrorDetail.php index 3fbbe65d9..b0db5bc82 100644 --- a/codegen/Cms/Blogs/Tags/Model/ErrorDetail.php +++ b/codegen/Cms/Blogs/Tags/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/Cms/Blogs/Tags/Model/ForwardPaging.php b/codegen/Cms/Blogs/Tags/Model/ForwardPaging.php index c250de4f6..fd21d92a6 100644 --- a/codegen/Cms/Blogs/Tags/Model/ForwardPaging.php +++ b/codegen/Cms/Blogs/Tags/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 */ /** @@ -240,10 +240,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/Cms/Blogs/Tags/Model/ModelInterface.php b/codegen/Cms/Blogs/Tags/Model/ModelInterface.php index 50069135f..196e9f1c9 100644 --- a/codegen/Cms/Blogs/Tags/Model/ModelInterface.php +++ b/codegen/Cms/Blogs/Tags/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/Cms/Blogs/Tags/Model/NextPage.php b/codegen/Cms/Blogs/Tags/Model/NextPage.php index 033234070..f7f5fce90 100644 --- a/codegen/Cms/Blogs/Tags/Model/NextPage.php +++ b/codegen/Cms/Blogs/Tags/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/Cms/Blogs/Tags/Model/SetNewLanguagePrimaryRequestVNext.php b/codegen/Cms/Blogs/Tags/Model/SetNewLanguagePrimaryRequestVNext.php index c991f88e7..f33850009 100644 --- a/codegen/Cms/Blogs/Tags/Model/SetNewLanguagePrimaryRequestVNext.php +++ b/codegen/Cms/Blogs/Tags/Model/SetNewLanguagePrimaryRequestVNext.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 */ /** @@ -240,10 +240,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/Cms/Blogs/Tags/Model/StandardError.php b/codegen/Cms/Blogs/Tags/Model/StandardError.php index bb6e57c11..6cbbd8808 100644 --- a/codegen/Cms/Blogs/Tags/Model/StandardError.php +++ b/codegen/Cms/Blogs/Tags/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 */ /** @@ -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('sub_category', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); diff --git a/codegen/Cms/Blogs/Tags/Model/Tag.php b/codegen/Cms/Blogs/Tags/Model/Tag.php index c10d75ddd..04bb08bb2 100644 --- a/codegen/Cms/Blogs/Tags/Model/Tag.php +++ b/codegen/Cms/Blogs/Tags/Model/Tag.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 */ /** @@ -1795,10 +1795,10 @@ public function getLanguageAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('deleted_at', $data ?? [], null); $this->setIfExists('created', $data ?? [], null); diff --git a/codegen/Cms/Blogs/Tags/Model/TagCloneRequestVNext.php b/codegen/Cms/Blogs/Tags/Model/TagCloneRequestVNext.php index a5f76a812..8d7f7e7f5 100644 --- a/codegen/Cms/Blogs/Tags/Model/TagCloneRequestVNext.php +++ b/codegen/Cms/Blogs/Tags/Model/TagCloneRequestVNext.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('name', $data ?? [], null); $this->setIfExists('language', $data ?? [], null); diff --git a/codegen/Cms/Blogs/Tags/Model/UpdateLanguagesRequestVNext.php b/codegen/Cms/Blogs/Tags/Model/UpdateLanguagesRequestVNext.php index 2c633be7d..4ee27068d 100644 --- a/codegen/Cms/Blogs/Tags/Model/UpdateLanguagesRequestVNext.php +++ b/codegen/Cms/Blogs/Tags/Model/UpdateLanguagesRequestVNext.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('languages', $data ?? [], null); $this->setIfExists('primary_id', $data ?? [], null); diff --git a/codegen/Cms/Blogs/Tags/ObjectSerializer.php b/codegen/Cms/Blogs/Tags/ObjectSerializer.php index 3f4c456d7..df6b06f9a 100644 --- a/codegen/Cms/Blogs/Tags/ObjectSerializer.php +++ b/codegen/Cms/Blogs/Tags/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) : ''; } }