diff --git a/codegen/Cms/Pages/Api/LandingPagesApi.php b/codegen/Cms/Pages/Api/LandingPagesApi.php index f908fb41b..3a7143717 100644 --- a/codegen/Cms/Pages/Api/LandingPagesApi.php +++ b/codegen/Cms/Pages/Api/LandingPagesApi.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 */ /** @@ -197,13 +197,13 @@ class LandingPagesApi * @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; } @@ -242,7 +242,7 @@ public function getConfig() * Delete a Landing Page * * @param string $object_id The Landing Page 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -260,7 +260,7 @@ public function archive($object_id, $archived = null, string $contentType = self * Delete a Landing Page * * @param string $object_id The Landing Page 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -293,18 +293,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()]; @@ -329,7 +317,7 @@ public function archiveWithHttpInfo($object_id, $archived = null, string $conten * Delete a Landing Page * * @param string $object_id The Landing Page 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 @@ -351,7 +339,7 @@ function ($response) { * Delete a Landing Page * * @param string $object_id The Landing Page 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 @@ -389,7 +377,7 @@ function ($exception) { * Create request for operation 'archive' * * @param string $object_id The Landing Page 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 @@ -547,18 +535,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()]; @@ -738,7 +714,7 @@ public function archiveBatchRequest($batch_input_string, string $contentType = s * Delete a Folder * * @param string $object_id The Folder 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['archiveFolder'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -756,7 +732,7 @@ public function archiveFolder($object_id, $archived = null, string $contentType * Delete a Folder * * @param string $object_id The Folder 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['archiveFolder'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -789,18 +765,6 @@ public function archiveFolderWithHttpInfo($object_id, $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() - ); - } return [null, $statusCode, $response->getHeaders()]; @@ -825,7 +789,7 @@ public function archiveFolderWithHttpInfo($object_id, $archived = null, string $ * Delete a Folder * * @param string $object_id The Folder 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['archiveFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -847,7 +811,7 @@ function ($response) { * Delete a Folder * * @param string $object_id The Folder 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['archiveFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -885,7 +849,7 @@ function ($exception) { * Create request for operation 'archiveFolder' * * @param string $object_id The Folder 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['archiveFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1043,18 +1007,6 @@ public function archiveFoldersWithHttpInfo($batch_input_string, string $contentT $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } return [null, $statusCode, $response->getHeaders()]; @@ -1283,18 +1235,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()]; @@ -1524,18 +1464,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: @@ -1594,6 +1522,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\Pages\Model\Page'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1868,18 +1809,6 @@ public function createWithHttpInfo($page, string $contentType = self::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()]; @@ -2117,18 +2046,6 @@ public function createABTestVariationWithHttpInfo($ab_test_create_request_v_next $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 201: @@ -2187,6 +2104,19 @@ public function createABTestVariationWithHttpInfo($ab_test_create_request_v_next ]; } + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + $returnType = '\HubSpot\Client\Cms\Pages\Model\Page'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2462,18 +2392,6 @@ public function createBatchWithHttpInfo($batch_input_page, 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: @@ -2559,6 +2477,19 @@ public function createBatchWithHttpInfo($batch_input_page, 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\Pages\Model\BatchResponsePage'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2842,18 +2773,6 @@ public function createFolderWithHttpInfo($content_folder, 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: @@ -2912,6 +2831,19 @@ public function createFolderWithHttpInfo($content_folder, 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\Pages\Model\ContentFolder'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -3187,18 +3119,6 @@ public function createFoldersWithHttpInfo($batch_input_content_folder, 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 201: @@ -3284,6 +3204,19 @@ public function createFoldersWithHttpInfo($batch_input_content_folder, 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\Pages\Model\BatchResponseContentFolder'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -3567,18 +3500,6 @@ public function createLangVariationWithHttpInfo($content_language_clone_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() - ); - } switch($statusCode) { case 200: @@ -3637,6 +3558,19 @@ public function createLangVariationWithHttpInfo($content_language_clone_request_ ]; } + if ($statusCode < 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\Pages\Model\Page'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -3911,18 +3845,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()]; @@ -4151,18 +4073,6 @@ public function endActiveABTestWithHttpInfo($ab_test_end_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()]; @@ -4342,8 +4252,8 @@ public function endActiveABTestRequest($ab_test_end_request_v_next, string $cont * Retrieve a Landing Page * * @param string $object_id The Landing Page id. (required) - * @param bool $archived Specifies whether to return deleted Landing Pages. Defaults to `false`. (optional) - * @param string $property property (optional) + * @param bool|null $archived Specifies whether to return deleted Landing Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -4362,8 +4272,8 @@ public function getById($object_id, $archived = null, $property = null, string $ * Retrieve a Landing Page * * @param string $object_id The Landing Page id. (required) - * @param bool $archived Specifies whether to return deleted Landing Pages. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Landing Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -4396,18 +4306,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: @@ -4466,6 +4364,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\Pages\Model\Page'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -4523,8 +4434,8 @@ public function getByIdWithHttpInfo($object_id, $archived = null, $property = nu * Retrieve a Landing Page * * @param string $object_id The Landing Page id. (required) - * @param bool $archived Specifies whether to return deleted Landing Pages. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Landing Pages. 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 @@ -4546,8 +4457,8 @@ function ($response) { * Retrieve a Landing Page * * @param string $object_id The Landing Page id. (required) - * @param bool $archived Specifies whether to return deleted Landing Pages. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Landing Pages. 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 @@ -4598,8 +4509,8 @@ function ($exception) { * Create request for operation 'getById' * * @param string $object_id The Landing Page id. (required) - * @param bool $archived Specifies whether to return deleted Landing Pages. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Landing Pages. 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 @@ -4768,18 +4679,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: @@ -4838,6 +4737,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\Pages\Model\Page'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -5064,8 +4976,8 @@ public function getDraftByIdRequest($object_id, string $contentType = self::cont * Retrieve a Folder * * @param string $object_id The Folder id. (required) - * @param bool $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) - * @param string $property property (optional) + * @param bool|null $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) + * @param string|null $property property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolderById'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -5084,8 +4996,8 @@ public function getFolderById($object_id, $archived = null, $property = null, st * Retrieve a Folder * * @param string $object_id The Folder id. (required) - * @param bool $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) + * @param string|null $property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolderById'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -5118,18 +5030,6 @@ public function getFolderByIdWithHttpInfo($object_id, $archived = null, $propert $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: @@ -5188,6 +5088,19 @@ public function getFolderByIdWithHttpInfo($object_id, $archived = null, $propert ]; } + if ($statusCode < 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\Pages\Model\ContentFolder'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -5245,8 +5158,8 @@ public function getFolderByIdWithHttpInfo($object_id, $archived = null, $propert * Retrieve a Folder * * @param string $object_id The Folder id. (required) - * @param bool $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) + * @param string|null $property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolderById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -5268,8 +5181,8 @@ function ($response) { * Retrieve a Folder * * @param string $object_id The Folder id. (required) - * @param bool $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) + * @param string|null $property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolderById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -5320,8 +5233,8 @@ function ($exception) { * Create request for operation 'getFolderById' * * @param string $object_id The Folder id. (required) - * @param bool $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) + * @param string|null $property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolderById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -5492,18 +5405,6 @@ public function getFolderPreviousVersionWithHttpInfo($object_id, $revision_id, 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: @@ -5562,6 +5463,19 @@ public function getFolderPreviousVersionWithHttpInfo($object_id, $revision_id, 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\Pages\Model\VersionContentFolder'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -5806,9 +5720,9 @@ public function getFolderPreviousVersionRequest($object_id, $revision_id, string * Retrieves all the previous versions of a Folder * * @param string $object_id The Folder id. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before 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['getFolderPreviousVersions'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -5827,9 +5741,9 @@ public function getFolderPreviousVersions($object_id, $after = null, $before = n * Retrieves all the previous versions of a Folder * * @param string $object_id The Folder id. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before (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['getFolderPreviousVersions'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -5862,18 +5776,6 @@ public function getFolderPreviousVersionsWithHttpInfo($object_id, $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: @@ -5932,6 +5834,19 @@ public function getFolderPreviousVersionsWithHttpInfo($object_id, $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\Pages\Model\CollectionResponseWithTotalVersionContentFolder'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -5989,9 +5904,9 @@ public function getFolderPreviousVersionsWithHttpInfo($object_id, $after = null, * Retrieves all the previous versions of a Folder * * @param string $object_id The Folder id. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before (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['getFolderPreviousVersions'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -6013,9 +5928,9 @@ function ($response) { * Retrieves all the previous versions of a Folder * * @param string $object_id The Folder id. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before (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['getFolderPreviousVersions'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -6066,9 +5981,9 @@ function ($exception) { * Create request for operation 'getFolderPreviousVersions' * * @param string $object_id The Folder id. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before (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['getFolderPreviousVersions'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -6196,17 +6111,17 @@ public function getFolderPreviousVersionsRequest($object_id, $after = null, $bef * * Get all Landing Page Folders * - * @param \DateTime $created_at Only return Folders created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Folders created after the specified time. (optional) - * @param \DateTime $created_before Only return Folders created before the specified time. (optional) - * @param \DateTime $updated_at Only return Folders last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Folders last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Folders 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 Folders. Defaults to `false`. (optional) - * @param string $property property (optional) + * @param \DateTime|null $created_at Only return Folders created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Folders created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Folders created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Folders last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Folders last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Folders 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 Folders. Defaults to `false`. (optional) + * @param string|null $property property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFoldersPage'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -6224,17 +6139,17 @@ public function getFoldersPage($created_at = null, $created_after = null, $creat * * Get all Landing Page Folders * - * @param \DateTime $created_at Only return Folders created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Folders created after the specified time. (optional) - * @param \DateTime $created_before Only return Folders created before the specified time. (optional) - * @param \DateTime $updated_at Only return Folders last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Folders last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Folders 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 Folders. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Folders created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Folders created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Folders created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Folders last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Folders last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Folders 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 Folders. Defaults to `false`. (optional) + * @param string|null $property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFoldersPage'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -6267,18 +6182,6 @@ public function getFoldersPageWithHttpInfo($created_at = null, $created_after = $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: @@ -6337,6 +6240,19 @@ public function getFoldersPageWithHttpInfo($created_at = null, $created_after = ]; } + if ($statusCode < 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\Pages\Model\CollectionResponseWithTotalContentFolderForwardPaging'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -6393,17 +6309,17 @@ public function getFoldersPageWithHttpInfo($created_at = null, $created_after = * * Get all Landing Page Folders * - * @param \DateTime $created_at Only return Folders created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Folders created after the specified time. (optional) - * @param \DateTime $created_before Only return Folders created before the specified time. (optional) - * @param \DateTime $updated_at Only return Folders last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Folders last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Folders 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 Folders. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Folders created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Folders created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Folders created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Folders last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Folders last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Folders 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 Folders. Defaults to `false`. (optional) + * @param string|null $property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFoldersPage'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -6424,17 +6340,17 @@ function ($response) { * * Get all Landing Page Folders * - * @param \DateTime $created_at Only return Folders created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Folders created after the specified time. (optional) - * @param \DateTime $created_before Only return Folders created before the specified time. (optional) - * @param \DateTime $updated_at Only return Folders last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Folders last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Folders 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 Folders. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Folders created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Folders created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Folders created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Folders last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Folders last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Folders 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 Folders. Defaults to `false`. (optional) + * @param string|null $property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFoldersPage'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -6484,17 +6400,17 @@ function ($exception) { /** * Create request for operation 'getFoldersPage' * - * @param \DateTime $created_at Only return Folders created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Folders created after the specified time. (optional) - * @param \DateTime $created_before Only return Folders created before the specified time. (optional) - * @param \DateTime $updated_at Only return Folders last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Folders last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Folders 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 Folders. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Folders created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Folders created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Folders created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Folders last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Folders last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Folders 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 Folders. Defaults to `false`. (optional) + * @param string|null $property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFoldersPage'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -6687,17 +6603,17 @@ public function getFoldersPageRequest($created_at = null, $created_after = null, * * Get all Landing Pages * - * @param \DateTime $created_at Only return Landing Pages created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Landing Pages created after the specified time. (optional) - * @param \DateTime $created_before Only return Landing Pages created before the specified time. (optional) - * @param \DateTime $updated_at Only return Landing Pages last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Landing Pages last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Landing Pages 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 Landing Pages. Defaults to `false`. (optional) - * @param string $property property (optional) + * @param \DateTime|null $created_at Only return Landing Pages created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Landing Pages created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Landing Pages created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Landing Pages last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Landing Pages last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Landing Pages 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 Landing Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -6715,17 +6631,17 @@ public function getPage($created_at = null, $created_after = null, $created_befo * * Get all Landing Pages * - * @param \DateTime $created_at Only return Landing Pages created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Landing Pages created after the specified time. (optional) - * @param \DateTime $created_before Only return Landing Pages created before the specified time. (optional) - * @param \DateTime $updated_at Only return Landing Pages last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Landing Pages last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Landing Pages 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 Landing Pages. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Landing Pages created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Landing Pages created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Landing Pages created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Landing Pages last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Landing Pages last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Landing Pages 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 Landing Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -6758,18 +6674,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: @@ -6828,6 +6732,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\Pages\Model\CollectionResponseWithTotalPageForwardPaging'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -6884,17 +6801,17 @@ public function getPageWithHttpInfo($created_at = null, $created_after = null, $ * * Get all Landing Pages * - * @param \DateTime $created_at Only return Landing Pages created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Landing Pages created after the specified time. (optional) - * @param \DateTime $created_before Only return Landing Pages created before the specified time. (optional) - * @param \DateTime $updated_at Only return Landing Pages last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Landing Pages last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Landing Pages 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 Landing Pages. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Landing Pages created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Landing Pages created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Landing Pages created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Landing Pages last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Landing Pages last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Landing Pages 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 Landing Pages. 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 @@ -6915,17 +6832,17 @@ function ($response) { * * Get all Landing Pages * - * @param \DateTime $created_at Only return Landing Pages created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Landing Pages created after the specified time. (optional) - * @param \DateTime $created_before Only return Landing Pages created before the specified time. (optional) - * @param \DateTime $updated_at Only return Landing Pages last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Landing Pages last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Landing Pages 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 Landing Pages. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Landing Pages created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Landing Pages created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Landing Pages created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Landing Pages last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Landing Pages last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Landing Pages 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 Landing Pages. 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 @@ -6975,17 +6892,17 @@ function ($exception) { /** * Create request for operation 'getPage' * - * @param \DateTime $created_at Only return Landing Pages created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Landing Pages created after the specified time. (optional) - * @param \DateTime $created_before Only return Landing Pages created before the specified time. (optional) - * @param \DateTime $updated_at Only return Landing Pages last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Landing Pages last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Landing Pages 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 Landing Pages. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Landing Pages created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Landing Pages created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Landing Pages created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Landing Pages last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Landing Pages last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Landing Pages 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 Landing Pages. 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 @@ -7231,18 +7148,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: @@ -7301,6 +7206,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\Pages\Model\VersionPage'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -7545,9 +7463,9 @@ public function getPreviousVersionRequest($object_id, $revision_id, string $cont * Retrieves all the previous versions of a Landing Page * * @param string $object_id The Landing Page id. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -7566,9 +7484,9 @@ public function getPreviousVersions($object_id, $after = null, $before = null, $ * Retrieves all the previous versions of a Landing Page * * @param string $object_id The Landing Page id. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before (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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -7601,18 +7519,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: @@ -7671,6 +7577,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\Pages\Model\CollectionResponseWithTotalVersionPage'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -7728,9 +7647,9 @@ public function getPreviousVersionsWithHttpInfo($object_id, $after = null, $befo * Retrieves all the previous versions of a Landing Page * * @param string $object_id The Landing Page id. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before (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 @@ -7752,9 +7671,9 @@ function ($response) { * Retrieves all the previous versions of a Landing Page * * @param string $object_id The Landing Page id. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before (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 @@ -7805,9 +7724,9 @@ function ($exception) { * Create request for operation 'getPreviousVersions' * * @param string $object_id The Landing Page id. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before (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 @@ -7985,18 +7904,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()]; @@ -8177,7 +8084,7 @@ public function pushLiveRequest($object_id, string $contentType = self::contentT * Retrieve a batch of Landing Pages * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputString $batch_input_string The JSON array of Landing Page ids. (required) - * @param bool $archived Specifies whether to return deleted Landing Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Landing Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -8196,7 +8103,7 @@ public function readBatch($batch_input_string, $archived = null, string $content * Retrieve a batch of Landing Pages * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputString $batch_input_string The JSON array of Landing Page ids. (required) - * @param bool $archived Specifies whether to return deleted Landing Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Landing Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -8229,18 +8136,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: @@ -8326,6 +8221,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\Pages\Model\BatchResponsePage'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -8391,7 +8299,7 @@ public function readBatchWithHttpInfo($batch_input_string, $archived = null, str * Retrieve a batch of Landing Pages * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputString $batch_input_string The JSON array of Landing Page ids. (required) - * @param bool $archived Specifies whether to return deleted Landing Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Landing Pages. 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 @@ -8413,7 +8321,7 @@ function ($response) { * Retrieve a batch of Landing Pages * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputString $batch_input_string The JSON array of Landing Page ids. (required) - * @param bool $archived Specifies whether to return deleted Landing Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Landing Pages. 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 @@ -8464,7 +8372,7 @@ function ($exception) { * Create request for operation 'readBatch' * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputString $batch_input_string The JSON array of Landing Page ids. (required) - * @param bool $archived Specifies whether to return deleted Landing Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Landing Pages. 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 @@ -8572,7 +8480,7 @@ public function readBatchRequest($batch_input_string, $archived = null, string $ * Retrieve a batch of Folders * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputString $batch_input_string The JSON array of Folder ids. (required) - * @param bool $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readFolders'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -8591,7 +8499,7 @@ public function readFolders($batch_input_string, $archived = null, string $conte * Retrieve a batch of Folders * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputString $batch_input_string The JSON array of Folder ids. (required) - * @param bool $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readFolders'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -8624,18 +8532,6 @@ public function readFoldersWithHttpInfo($batch_input_string, $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: @@ -8721,6 +8617,19 @@ public function readFoldersWithHttpInfo($batch_input_string, $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\Pages\Model\BatchResponseContentFolder'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -8786,7 +8695,7 @@ public function readFoldersWithHttpInfo($batch_input_string, $archived = null, s * Retrieve a batch of Folders * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputString $batch_input_string The JSON array of Folder ids. (required) - * @param bool $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readFolders'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -8808,7 +8717,7 @@ function ($response) { * Retrieve a batch of Folders * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputString $batch_input_string The JSON array of Folder ids. (required) - * @param bool $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readFolders'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -8859,7 +8768,7 @@ function ($exception) { * Create request for operation 'readFolders' * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputString $batch_input_string The JSON array of Folder ids. (required) - * @param bool $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Folders. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readFolders'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -9016,18 +8925,6 @@ public function rerunPreviousABTestWithHttpInfo($ab_test_rerun_request_v_next, 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()]; @@ -9256,18 +9153,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()]; @@ -9500,18 +9385,6 @@ public function restoreFolderPreviousVersionWithHttpInfo($object_id, $revision_i $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: @@ -9570,6 +9443,19 @@ public function restoreFolderPreviousVersionWithHttpInfo($object_id, $revision_i ]; } + if ($statusCode < 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\Pages\Model\ContentFolder'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -9866,18 +9752,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: @@ -9936,6 +9810,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\Pages\Model\Page'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -10232,18 +10119,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: @@ -10302,6 +10177,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\Pages\Model\Page'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -10595,18 +10483,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()]; @@ -10835,18 +10711,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()]; @@ -11027,7 +10891,7 @@ public function setLangPrimaryRequest($set_new_language_primary_request_v_next, * * @param string $object_id The Landing Page id. (required) * @param \HubSpot\Client\Cms\Pages\Model\Page $page The JSON representation of the updated Landing Page. (required) - * @param bool $archived Specifies whether to update deleted Landing Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Landing Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -11047,7 +10911,7 @@ public function update($object_id, $page, $archived = null, string $contentType * * @param string $object_id The Landing Page id. (required) * @param \HubSpot\Client\Cms\Pages\Model\Page $page The JSON representation of the updated Landing Page. (required) - * @param bool $archived Specifies whether to update deleted Landing Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Landing Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -11080,18 +10944,6 @@ public function updateWithHttpInfo($object_id, $page, $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: @@ -11150,6 +11002,19 @@ public function updateWithHttpInfo($object_id, $page, $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\Pages\Model\Page'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -11208,7 +11073,7 @@ public function updateWithHttpInfo($object_id, $page, $archived = null, string $ * * @param string $object_id The Landing Page id. (required) * @param \HubSpot\Client\Cms\Pages\Model\Page $page The JSON representation of the updated Landing Page. (required) - * @param bool $archived Specifies whether to update deleted Landing Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Landing Pages. 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 @@ -11231,7 +11096,7 @@ function ($response) { * * @param string $object_id The Landing Page id. (required) * @param \HubSpot\Client\Cms\Pages\Model\Page $page The JSON representation of the updated Landing Page. (required) - * @param bool $archived Specifies whether to update deleted Landing Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Landing Pages. 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 @@ -11283,7 +11148,7 @@ function ($exception) { * * @param string $object_id The Landing Page id. (required) * @param \HubSpot\Client\Cms\Pages\Model\Page $page The JSON representation of the updated Landing Page. (required) - * @param bool $archived Specifies whether to update deleted Landing Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Landing Pages. 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 @@ -11406,7 +11271,7 @@ public function updateRequest($object_id, $page, $archived = null, string $conte * Update a batch of Landing Pages * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputJsonNode $batch_input_json_node The JSON representation of the updated Landing Pages. (required) - * @param bool $archived Specifies whether to update deleted Landing Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Landing Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -11425,7 +11290,7 @@ public function updateBatch($batch_input_json_node, $archived = null, string $co * Update a batch of Landing Pages * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputJsonNode $batch_input_json_node The JSON representation of the updated Landing Pages. (required) - * @param bool $archived Specifies whether to update deleted Landing Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Landing Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -11458,18 +11323,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: @@ -11555,6 +11408,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\Pages\Model\BatchResponsePage'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -11620,7 +11486,7 @@ public function updateBatchWithHttpInfo($batch_input_json_node, $archived = null * Update a batch of Landing Pages * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputJsonNode $batch_input_json_node The JSON representation of the updated Landing Pages. (required) - * @param bool $archived Specifies whether to update deleted Landing Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Landing Pages. 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 @@ -11642,7 +11508,7 @@ function ($response) { * Update a batch of Landing Pages * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputJsonNode $batch_input_json_node The JSON representation of the updated Landing Pages. (required) - * @param bool $archived Specifies whether to update deleted Landing Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Landing Pages. 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 @@ -11693,7 +11559,7 @@ function ($exception) { * Create request for operation 'updateBatch' * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputJsonNode $batch_input_json_node The JSON representation of the updated Landing Pages. (required) - * @param bool $archived Specifies whether to update deleted Landing Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Landing Pages. 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 @@ -11853,18 +11719,6 @@ public function updateDraftWithHttpInfo($object_id, $page, string $contentType = $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -11923,6 +11777,19 @@ public function updateDraftWithHttpInfo($object_id, $page, 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\Pages\Model\Page'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -12167,7 +12034,7 @@ public function updateDraftRequest($object_id, $page, string $contentType = self * * @param string $object_id The Folder id. (required) * @param \HubSpot\Client\Cms\Pages\Model\ContentFolder $content_folder The JSON representation of the updated Folder. (required) - * @param bool $archived Specifies whether to update deleted Folders. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Folders. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFolder'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -12187,7 +12054,7 @@ public function updateFolder($object_id, $content_folder, $archived = null, stri * * @param string $object_id The Folder id. (required) * @param \HubSpot\Client\Cms\Pages\Model\ContentFolder $content_folder The JSON representation of the updated Folder. (required) - * @param bool $archived Specifies whether to update deleted Folders. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Folders. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFolder'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -12220,18 +12087,6 @@ public function updateFolderWithHttpInfo($object_id, $content_folder, $archived $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -12290,6 +12145,19 @@ public function updateFolderWithHttpInfo($object_id, $content_folder, $archived ]; } + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + $returnType = '\HubSpot\Client\Cms\Pages\Model\ContentFolder'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -12348,7 +12216,7 @@ public function updateFolderWithHttpInfo($object_id, $content_folder, $archived * * @param string $object_id The Folder id. (required) * @param \HubSpot\Client\Cms\Pages\Model\ContentFolder $content_folder The JSON representation of the updated Folder. (required) - * @param bool $archived Specifies whether to update deleted Folders. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Folders. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -12371,7 +12239,7 @@ function ($response) { * * @param string $object_id The Folder id. (required) * @param \HubSpot\Client\Cms\Pages\Model\ContentFolder $content_folder The JSON representation of the updated Folder. (required) - * @param bool $archived Specifies whether to update deleted Folders. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Folders. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -12423,7 +12291,7 @@ function ($exception) { * * @param string $object_id The Folder id. (required) * @param \HubSpot\Client\Cms\Pages\Model\ContentFolder $content_folder The JSON representation of the updated Folder. (required) - * @param bool $archived Specifies whether to update deleted Folders. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Folders. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -12546,7 +12414,7 @@ public function updateFolderRequest($object_id, $content_folder, $archived = nul * Update a batch of Folders * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputJsonNode $batch_input_json_node batch_input_json_node (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['updateFolders'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -12565,7 +12433,7 @@ public function updateFolders($batch_input_json_node, $archived = null, string $ * Update a batch of Folders * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputJsonNode $batch_input_json_node (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['updateFolders'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -12598,18 +12466,6 @@ public function updateFoldersWithHttpInfo($batch_input_json_node, $archived = nu $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -12695,6 +12551,19 @@ public function updateFoldersWithHttpInfo($batch_input_json_node, $archived = nu ]; } + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + $returnType = '\HubSpot\Client\Cms\Pages\Model\BatchResponseContentFolder'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -12760,7 +12629,7 @@ public function updateFoldersWithHttpInfo($batch_input_json_node, $archived = nu * Update a batch of Folders * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputJsonNode $batch_input_json_node (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['updateFolders'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -12782,7 +12651,7 @@ function ($response) { * Update a batch of Folders * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputJsonNode $batch_input_json_node (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['updateFolders'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -12833,7 +12702,7 @@ function ($exception) { * Create request for operation 'updateFolders' * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputJsonNode $batch_input_json_node (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['updateFolders'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -12990,18 +12859,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/Pages/Api/SitePagesApi.php b/codegen/Cms/Pages/Api/SitePagesApi.php index 84a537aae..28e5dd554 100644 --- a/codegen/Cms/Pages/Api/SitePagesApi.php +++ b/codegen/Cms/Pages/Api/SitePagesApi.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 */ /** @@ -161,13 +161,13 @@ class SitePagesApi * @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; } @@ -206,7 +206,7 @@ public function getConfig() * Delete a Site Page * * @param string $object_id The Site Page 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -224,7 +224,7 @@ public function archive($object_id, $archived = null, string $contentType = self * Delete a Site Page * * @param string $object_id The Site Page 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -257,18 +257,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()]; @@ -293,7 +281,7 @@ public function archiveWithHttpInfo($object_id, $archived = null, string $conten * Delete a Site Page * * @param string $object_id The Site Page 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 @@ -315,7 +303,7 @@ function ($response) { * Delete a Site Page * * @param string $object_id The Site Page 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 @@ -353,7 +341,7 @@ function ($exception) { * Create request for operation 'archive' * * @param string $object_id The Site Page 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 @@ -511,18 +499,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()]; @@ -751,18 +727,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()]; @@ -992,18 +956,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: @@ -1062,6 +1014,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\Pages\Model\Page'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1336,18 +1301,6 @@ public function createWithHttpInfo($page, string $contentType = self::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()]; @@ -1585,18 +1538,6 @@ public function createABTestVariationWithHttpInfo($ab_test_create_request_v_next $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 201: @@ -1655,6 +1596,19 @@ public function createABTestVariationWithHttpInfo($ab_test_create_request_v_next ]; } + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + $returnType = '\HubSpot\Client\Cms\Pages\Model\Page'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1930,18 +1884,6 @@ public function createBatchWithHttpInfo($batch_input_page, 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: @@ -2027,6 +1969,19 @@ public function createBatchWithHttpInfo($batch_input_page, 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\Pages\Model\BatchResponsePage'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2310,18 +2265,6 @@ public function createLangVariationWithHttpInfo($content_language_clone_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() - ); - } switch($statusCode) { case 200: @@ -2380,6 +2323,19 @@ public function createLangVariationWithHttpInfo($content_language_clone_request_ ]; } + if ($statusCode < 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\Pages\Model\Page'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2654,18 +2610,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()]; @@ -2894,18 +2838,6 @@ public function endActiveABTestWithHttpInfo($ab_test_end_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()]; @@ -3085,8 +3017,8 @@ public function endActiveABTestRequest($ab_test_end_request_v_next, string $cont * Retrieve a Site Page * * @param string $object_id The Site Page id. (required) - * @param bool $archived Specifies whether to return deleted Site Pages. Defaults to `false`. (optional) - * @param string $property property (optional) + * @param bool|null $archived Specifies whether to return deleted Site Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -3105,8 +3037,8 @@ public function getById($object_id, $archived = null, $property = null, string $ * Retrieve a Site Page * * @param string $object_id The Site Page id. (required) - * @param bool $archived Specifies whether to return deleted Site Pages. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Site Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -3139,18 +3071,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: @@ -3209,6 +3129,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\Pages\Model\Page'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -3266,8 +3199,8 @@ public function getByIdWithHttpInfo($object_id, $archived = null, $property = nu * Retrieve a Site Page * * @param string $object_id The Site Page id. (required) - * @param bool $archived Specifies whether to return deleted Site Pages. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Site Pages. 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 @@ -3289,8 +3222,8 @@ function ($response) { * Retrieve a Site Page * * @param string $object_id The Site Page id. (required) - * @param bool $archived Specifies whether to return deleted Site Pages. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Site Pages. 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 @@ -3341,8 +3274,8 @@ function ($exception) { * Create request for operation 'getById' * * @param string $object_id The Site Page id. (required) - * @param bool $archived Specifies whether to return deleted Site Pages. Defaults to `false`. (optional) - * @param string $property (optional) + * @param bool|null $archived Specifies whether to return deleted Site Pages. 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 @@ -3511,18 +3444,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: @@ -3581,6 +3502,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\Pages\Model\Page'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -3806,17 +3740,17 @@ public function getDraftByIdRequest($object_id, string $contentType = self::cont * * Get all Site Pages * - * @param \DateTime $created_at Only return Site Pages created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Site Pages created after the specified time. (optional) - * @param \DateTime $created_before Only return Site Pages created before the specified time. (optional) - * @param \DateTime $updated_at Only return Site Pages last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Site Pages last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Site Pages 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 Site Pages. Defaults to `false`. (optional) - * @param string $property property (optional) + * @param \DateTime|null $created_at Only return Site Pages created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Site Pages created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Site Pages created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Site Pages last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Site Pages last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Site Pages 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 Site Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -3834,17 +3768,17 @@ public function getPage($created_at = null, $created_after = null, $created_befo * * Get all Site Pages * - * @param \DateTime $created_at Only return Site Pages created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Site Pages created after the specified time. (optional) - * @param \DateTime $created_before Only return Site Pages created before the specified time. (optional) - * @param \DateTime $updated_at Only return Site Pages last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Site Pages last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Site Pages 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 Site Pages. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Site Pages created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Site Pages created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Site Pages created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Site Pages last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Site Pages last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Site Pages 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 Site Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -3877,18 +3811,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: @@ -3947,6 +3869,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\Pages\Model\CollectionResponseWithTotalPageForwardPaging'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -4003,17 +3938,17 @@ public function getPageWithHttpInfo($created_at = null, $created_after = null, $ * * Get all Site Pages * - * @param \DateTime $created_at Only return Site Pages created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Site Pages created after the specified time. (optional) - * @param \DateTime $created_before Only return Site Pages created before the specified time. (optional) - * @param \DateTime $updated_at Only return Site Pages last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Site Pages last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Site Pages 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 Site Pages. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Site Pages created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Site Pages created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Site Pages created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Site Pages last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Site Pages last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Site Pages 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 Site Pages. 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 @@ -4034,17 +3969,17 @@ function ($response) { * * Get all Site Pages * - * @param \DateTime $created_at Only return Site Pages created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Site Pages created after the specified time. (optional) - * @param \DateTime $created_before Only return Site Pages created before the specified time. (optional) - * @param \DateTime $updated_at Only return Site Pages last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Site Pages last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Site Pages 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 Site Pages. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Site Pages created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Site Pages created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Site Pages created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Site Pages last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Site Pages last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Site Pages 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 Site Pages. 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 @@ -4094,17 +4029,17 @@ function ($exception) { /** * Create request for operation 'getPage' * - * @param \DateTime $created_at Only return Site Pages created at exactly the specified time. (optional) - * @param \DateTime $created_after Only return Site Pages created after the specified time. (optional) - * @param \DateTime $created_before Only return Site Pages created before the specified time. (optional) - * @param \DateTime $updated_at Only return Site Pages last updated at exactly the specified time. (optional) - * @param \DateTime $updated_after Only return Site Pages last updated after the specified time. (optional) - * @param \DateTime $updated_before Only return Site Pages 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 Site Pages. Defaults to `false`. (optional) - * @param string $property (optional) + * @param \DateTime|null $created_at Only return Site Pages created at exactly the specified time. (optional) + * @param \DateTime|null $created_after Only return Site Pages created after the specified time. (optional) + * @param \DateTime|null $created_before Only return Site Pages created before the specified time. (optional) + * @param \DateTime|null $updated_at Only return Site Pages last updated at exactly the specified time. (optional) + * @param \DateTime|null $updated_after Only return Site Pages last updated after the specified time. (optional) + * @param \DateTime|null $updated_before Only return Site Pages 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 Site Pages. 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 @@ -4350,18 +4285,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: @@ -4420,6 +4343,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\Pages\Model\VersionPage'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -4664,9 +4600,9 @@ public function getPreviousVersionRequest($object_id, $revision_id, string $cont * Retrieves all the previous versions of a Site Page * * @param string $object_id The Site Page id. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -4685,9 +4621,9 @@ public function getPreviousVersions($object_id, $after = null, $before = null, $ * Retrieves all the previous versions of a Site Page * * @param string $object_id The Site Page id. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before (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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -4720,18 +4656,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: @@ -4790,6 +4714,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\Pages\Model\CollectionResponseWithTotalVersionPage'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -4847,9 +4784,9 @@ public function getPreviousVersionsWithHttpInfo($object_id, $after = null, $befo * Retrieves all the previous versions of a Site Page * * @param string $object_id The Site Page id. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before (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 @@ -4871,9 +4808,9 @@ function ($response) { * Retrieves all the previous versions of a Site Page * * @param string $object_id The Site Page id. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before (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 @@ -4924,9 +4861,9 @@ function ($exception) { * Create request for operation 'getPreviousVersions' * * @param string $object_id The Site Page id. (required) - * @param string $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before (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 @@ -5104,18 +5041,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()]; @@ -5296,7 +5221,7 @@ public function pushLiveRequest($object_id, string $contentType = self::contentT * Retrieve a batch of Site Pages * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputString $batch_input_string The JSON array of Site Page ids. (required) - * @param bool $archived Specifies whether to return deleted Site Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Site Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -5315,7 +5240,7 @@ public function readBatch($batch_input_string, $archived = null, string $content * Retrieve a batch of Site Pages * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputString $batch_input_string The JSON array of Site Page ids. (required) - * @param bool $archived Specifies whether to return deleted Site Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Site Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -5348,18 +5273,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: @@ -5445,6 +5358,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\Pages\Model\BatchResponsePage'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -5510,7 +5436,7 @@ public function readBatchWithHttpInfo($batch_input_string, $archived = null, str * Retrieve a batch of Site Pages * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputString $batch_input_string The JSON array of Site Page ids. (required) - * @param bool $archived Specifies whether to return deleted Site Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Site Pages. 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 @@ -5532,7 +5458,7 @@ function ($response) { * Retrieve a batch of Site Pages * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputString $batch_input_string The JSON array of Site Page ids. (required) - * @param bool $archived Specifies whether to return deleted Site Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Site Pages. 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 @@ -5583,7 +5509,7 @@ function ($exception) { * Create request for operation 'readBatch' * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputString $batch_input_string The JSON array of Site Page ids. (required) - * @param bool $archived Specifies whether to return deleted Site Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to return deleted Site Pages. 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 @@ -5740,18 +5666,6 @@ public function rerunPreviousABTestWithHttpInfo($ab_test_rerun_request_v_next, 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()]; @@ -5980,18 +5894,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()]; @@ -6224,18 +6126,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: @@ -6294,6 +6184,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\Pages\Model\Page'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -6590,18 +6493,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: @@ -6660,6 +6551,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\Pages\Model\Page'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -6953,18 +6857,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()]; @@ -7193,18 +7085,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()]; @@ -7385,7 +7265,7 @@ public function setLangPrimaryRequest($set_new_language_primary_request_v_next, * * @param string $object_id The Site Page id. (required) * @param \HubSpot\Client\Cms\Pages\Model\Page $page The JSON representation of the updated Site Page. (required) - * @param bool $archived Specifies whether to update deleted Site Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Site Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -7405,7 +7285,7 @@ public function update($object_id, $page, $archived = null, string $contentType * * @param string $object_id The Site Page id. (required) * @param \HubSpot\Client\Cms\Pages\Model\Page $page The JSON representation of the updated Site Page. (required) - * @param bool $archived Specifies whether to update deleted Site Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Site Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -7438,18 +7318,6 @@ public function updateWithHttpInfo($object_id, $page, $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: @@ -7508,6 +7376,19 @@ public function updateWithHttpInfo($object_id, $page, $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\Pages\Model\Page'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -7566,7 +7447,7 @@ public function updateWithHttpInfo($object_id, $page, $archived = null, string $ * * @param string $object_id The Site Page id. (required) * @param \HubSpot\Client\Cms\Pages\Model\Page $page The JSON representation of the updated Site Page. (required) - * @param bool $archived Specifies whether to update deleted Site Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Site Pages. 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 @@ -7589,7 +7470,7 @@ function ($response) { * * @param string $object_id The Site Page id. (required) * @param \HubSpot\Client\Cms\Pages\Model\Page $page The JSON representation of the updated Site Page. (required) - * @param bool $archived Specifies whether to update deleted Site Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Site Pages. 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 @@ -7641,7 +7522,7 @@ function ($exception) { * * @param string $object_id The Site Page id. (required) * @param \HubSpot\Client\Cms\Pages\Model\Page $page The JSON representation of the updated Site Page. (required) - * @param bool $archived Specifies whether to update deleted Site Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Site Pages. 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 @@ -7764,7 +7645,7 @@ public function updateRequest($object_id, $page, $archived = null, string $conte * Update a batch of Site Pages * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputJsonNode $batch_input_json_node The JSON representation of the updated Site Pages. (required) - * @param bool $archived Specifies whether to update deleted Site Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Site Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -7783,7 +7664,7 @@ public function updateBatch($batch_input_json_node, $archived = null, string $co * Update a batch of Site Pages * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputJsonNode $batch_input_json_node The JSON representation of the updated Site Pages. (required) - * @param bool $archived Specifies whether to update deleted Site Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Site Pages. 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\Pages\ApiException on non-2xx response or if the response body is not in the expected format @@ -7816,18 +7697,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: @@ -7913,6 +7782,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\Pages\Model\BatchResponsePage'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -7978,7 +7860,7 @@ public function updateBatchWithHttpInfo($batch_input_json_node, $archived = null * Update a batch of Site Pages * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputJsonNode $batch_input_json_node The JSON representation of the updated Site Pages. (required) - * @param bool $archived Specifies whether to update deleted Site Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Site Pages. 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 @@ -8000,7 +7882,7 @@ function ($response) { * Update a batch of Site Pages * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputJsonNode $batch_input_json_node The JSON representation of the updated Site Pages. (required) - * @param bool $archived Specifies whether to update deleted Site Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Site Pages. 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 @@ -8051,7 +7933,7 @@ function ($exception) { * Create request for operation 'updateBatch' * * @param \HubSpot\Client\Cms\Pages\Model\BatchInputJsonNode $batch_input_json_node The JSON representation of the updated Site Pages. (required) - * @param bool $archived Specifies whether to update deleted Site Pages. Defaults to `false`. (optional) + * @param bool|null $archived Specifies whether to update deleted Site Pages. 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 @@ -8211,18 +8093,6 @@ public function updateDraftWithHttpInfo($object_id, $page, string $contentType = $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -8281,6 +8151,19 @@ public function updateDraftWithHttpInfo($object_id, $page, 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\Pages\Model\Page'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -8573,18 +8456,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/Pages/ApiException.php b/codegen/Cms/Pages/ApiException.php index 0bc0e64b2..957db140d 100644 --- a/codegen/Cms/Pages/ApiException.php +++ b/codegen/Cms/Pages/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/Pages/Configuration.php b/codegen/Cms/Pages/Configuration.php index 46c50f9ae..1c3b1cf1e 100644 --- a/codegen/Cms/Pages/Configuration.php +++ b/codegen/Cms/Pages/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/Pages/HeaderSelector.php b/codegen/Cms/Pages/HeaderSelector.php index c584c15d0..15d573734 100644 --- a/codegen/Cms/Pages/HeaderSelector.php +++ b/codegen/Cms/Pages/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/Pages/Model/AbTestCreateRequestVNext.php b/codegen/Cms/Pages/Model/AbTestCreateRequestVNext.php index d05fbefec..c066ee150 100644 --- a/codegen/Cms/Pages/Model/AbTestCreateRequestVNext.php +++ b/codegen/Cms/Pages/Model/AbTestCreateRequestVNext.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -246,10 +246,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('variation_name', $data ?? [], null); $this->setIfExists('content_id', $data ?? [], null); diff --git a/codegen/Cms/Pages/Model/AbTestEndRequestVNext.php b/codegen/Cms/Pages/Model/AbTestEndRequestVNext.php index 560e9ef9c..798a340b6 100644 --- a/codegen/Cms/Pages/Model/AbTestEndRequestVNext.php +++ b/codegen/Cms/Pages/Model/AbTestEndRequestVNext.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('winner_id', $data ?? [], null); $this->setIfExists('ab_test_id', $data ?? [], null); diff --git a/codegen/Cms/Pages/Model/AbTestRerunRequestVNext.php b/codegen/Cms/Pages/Model/AbTestRerunRequestVNext.php index 751e90a30..efcea51b6 100644 --- a/codegen/Cms/Pages/Model/AbTestRerunRequestVNext.php +++ b/codegen/Cms/Pages/Model/AbTestRerunRequestVNext.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -246,10 +246,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('variation_id', $data ?? [], null); $this->setIfExists('ab_test_id', $data ?? [], null); diff --git a/codegen/Cms/Pages/Model/Angle.php b/codegen/Cms/Pages/Model/Angle.php index 0ebb419af..7cb54a435 100644 --- a/codegen/Cms/Pages/Model/Angle.php +++ b/codegen/Cms/Pages/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/Pages/Model/AttachToLangPrimaryRequestVNext.php b/codegen/Cms/Pages/Model/AttachToLangPrimaryRequestVNext.php index 4cc77876d..87a189faa 100644 --- a/codegen/Cms/Pages/Model/AttachToLangPrimaryRequestVNext.php +++ b/codegen/Cms/Pages/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/Pages/Model/BackgroundImage.php b/codegen/Cms/Pages/Model/BackgroundImage.php index 692e77187..65ed9ecb1 100644 --- a/codegen/Cms/Pages/Model/BackgroundImage.php +++ b/codegen/Cms/Pages/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/Pages/Model/BatchInputContentFolder.php b/codegen/Cms/Pages/Model/BatchInputContentFolder.php index bfac6615e..bfdc2f830 100644 --- a/codegen/Cms/Pages/Model/BatchInputContentFolder.php +++ b/codegen/Cms/Pages/Model/BatchInputContentFolder.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/Pages/Model/BatchInputJsonNode.php b/codegen/Cms/Pages/Model/BatchInputJsonNode.php index 045c27ce1..a38d938ea 100644 --- a/codegen/Cms/Pages/Model/BatchInputJsonNode.php +++ b/codegen/Cms/Pages/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/Pages/Model/BatchInputPage.php b/codegen/Cms/Pages/Model/BatchInputPage.php index f544debee..9652b9e9b 100644 --- a/codegen/Cms/Pages/Model/BatchInputPage.php +++ b/codegen/Cms/Pages/Model/BatchInputPage.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/Pages/Model/BatchInputString.php b/codegen/Cms/Pages/Model/BatchInputString.php index aecc8022e..f9c8d0624 100644 --- a/codegen/Cms/Pages/Model/BatchInputString.php +++ b/codegen/Cms/Pages/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/Pages/Model/BatchResponseContentFolder.php b/codegen/Cms/Pages/Model/BatchResponseContentFolder.php index 101aad392..93b563c98 100644 --- a/codegen/Cms/Pages/Model/BatchResponseContentFolder.php +++ b/codegen/Cms/Pages/Model/BatchResponseContentFolder.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/Pages/Model/BatchResponseContentFolderWithErrors.php b/codegen/Cms/Pages/Model/BatchResponseContentFolderWithErrors.php index ac2cf005d..c0c5a0fc6 100644 --- a/codegen/Cms/Pages/Model/BatchResponseContentFolderWithErrors.php +++ b/codegen/Cms/Pages/Model/BatchResponseContentFolderWithErrors.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/Pages/Model/BatchResponsePage.php b/codegen/Cms/Pages/Model/BatchResponsePage.php index fef504ba3..b7a81cf06 100644 --- a/codegen/Cms/Pages/Model/BatchResponsePage.php +++ b/codegen/Cms/Pages/Model/BatchResponsePage.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/Pages/Model/BatchResponsePageWithErrors.php b/codegen/Cms/Pages/Model/BatchResponsePageWithErrors.php index 0aca79a30..f88a91b83 100644 --- a/codegen/Cms/Pages/Model/BatchResponsePageWithErrors.php +++ b/codegen/Cms/Pages/Model/BatchResponsePageWithErrors.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/Pages/Model/CollectionResponseWithTotalContentFolderForwardPaging.php b/codegen/Cms/Pages/Model/CollectionResponseWithTotalContentFolderForwardPaging.php index 10252eb97..b89a0815a 100644 --- a/codegen/Cms/Pages/Model/CollectionResponseWithTotalContentFolderForwardPaging.php +++ b/codegen/Cms/Pages/Model/CollectionResponseWithTotalContentFolderForwardPaging.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/Pages/Model/CollectionResponseWithTotalPageForwardPaging.php b/codegen/Cms/Pages/Model/CollectionResponseWithTotalPageForwardPaging.php index ad7c4dde7..d2d6c268a 100644 --- a/codegen/Cms/Pages/Model/CollectionResponseWithTotalPageForwardPaging.php +++ b/codegen/Cms/Pages/Model/CollectionResponseWithTotalPageForwardPaging.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/Pages/Model/CollectionResponseWithTotalVersionContentFolder.php b/codegen/Cms/Pages/Model/CollectionResponseWithTotalVersionContentFolder.php index fd5f531ed..24026c0aa 100644 --- a/codegen/Cms/Pages/Model/CollectionResponseWithTotalVersionContentFolder.php +++ b/codegen/Cms/Pages/Model/CollectionResponseWithTotalVersionContentFolder.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/Pages/Model/CollectionResponseWithTotalVersionPage.php b/codegen/Cms/Pages/Model/CollectionResponseWithTotalVersionPage.php index 183e006b2..601371eb5 100644 --- a/codegen/Cms/Pages/Model/CollectionResponseWithTotalVersionPage.php +++ b/codegen/Cms/Pages/Model/CollectionResponseWithTotalVersionPage.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/Pages/Model/ColorStop.php b/codegen/Cms/Pages/Model/ColorStop.php index ed9746d76..3a9edd704 100644 --- a/codegen/Cms/Pages/Model/ColorStop.php +++ b/codegen/Cms/Pages/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/Pages/Model/ContentCloneRequestVNext.php b/codegen/Cms/Pages/Model/ContentCloneRequestVNext.php index fa0f93d5a..bf3916736 100644 --- a/codegen/Cms/Pages/Model/ContentCloneRequestVNext.php +++ b/codegen/Cms/Pages/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/Pages/Model/ContentFolder.php b/codegen/Cms/Pages/Model/ContentFolder.php index a93b867ca..683727c12 100644 --- a/codegen/Cms/Pages/Model/ContentFolder.php +++ b/codegen/Cms/Pages/Model/ContentFolder.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 */ /** @@ -276,10 +276,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('deleted_at', $data ?? [], null); $this->setIfExists('parent_folder_id', $data ?? [], null); diff --git a/codegen/Cms/Pages/Model/ContentLanguageCloneRequestVNext.php b/codegen/Cms/Pages/Model/ContentLanguageCloneRequestVNext.php index ac215ad33..513ef000a 100644 --- a/codegen/Cms/Pages/Model/ContentLanguageCloneRequestVNext.php +++ b/codegen/Cms/Pages/Model/ContentLanguageCloneRequestVNext.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('language', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); diff --git a/codegen/Cms/Pages/Model/ContentLanguageVariation.php b/codegen/Cms/Pages/Model/ContentLanguageVariation.php index dd0c01285..77fd5b299 100644 --- a/codegen/Cms/Pages/Model/ContentLanguageVariation.php +++ b/codegen/Cms/Pages/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 */ /** @@ -317,10 +317,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/Pages/Model/ContentScheduleRequestVNext.php b/codegen/Cms/Pages/Model/ContentScheduleRequestVNext.php index df779bbcd..93ca56cf5 100644 --- a/codegen/Cms/Pages/Model/ContentScheduleRequestVNext.php +++ b/codegen/Cms/Pages/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/Pages/Model/DetachFromLangGroupRequestVNext.php b/codegen/Cms/Pages/Model/DetachFromLangGroupRequestVNext.php index 3e6d11d94..d3f840337 100644 --- a/codegen/Cms/Pages/Model/DetachFromLangGroupRequestVNext.php +++ b/codegen/Cms/Pages/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/Pages/Model/Error.php b/codegen/Cms/Pages/Model/Error.php index 9d9143e02..64112543c 100644 --- a/codegen/Cms/Pages/Model/Error.php +++ b/codegen/Cms/Pages/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/Pages/Model/ErrorDetail.php b/codegen/Cms/Pages/Model/ErrorDetail.php index 058cbc11b..7c401aa27 100644 --- a/codegen/Cms/Pages/Model/ErrorDetail.php +++ b/codegen/Cms/Pages/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/Pages/Model/ForwardPaging.php b/codegen/Cms/Pages/Model/ForwardPaging.php index 6f8f69092..b587e7207 100644 --- a/codegen/Cms/Pages/Model/ForwardPaging.php +++ b/codegen/Cms/Pages/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/Pages/Model/Gradient.php b/codegen/Cms/Pages/Model/Gradient.php index bc6288434..ed3c59a0e 100644 --- a/codegen/Cms/Pages/Model/Gradient.php +++ b/codegen/Cms/Pages/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/Pages/Model/LayoutSection.php b/codegen/Cms/Pages/Model/LayoutSection.php index 2fe36c81e..7812c81e6 100644 --- a/codegen/Cms/Pages/Model/LayoutSection.php +++ b/codegen/Cms/Pages/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/Pages/Model/ModelInterface.php b/codegen/Cms/Pages/Model/ModelInterface.php index 0203d87a2..eee7c6b21 100644 --- a/codegen/Cms/Pages/Model/ModelInterface.php +++ b/codegen/Cms/Pages/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/Pages/Model/NextPage.php b/codegen/Cms/Pages/Model/NextPage.php index e1b6a0cb2..b5c94b253 100644 --- a/codegen/Cms/Pages/Model/NextPage.php +++ b/codegen/Cms/Pages/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/Pages/Model/Page.php b/codegen/Cms/Pages/Model/Page.php index ad9d43c25..639812d2d 100644 --- a/codegen/Cms/Pages/Model/Page.php +++ b/codegen/Cms/Pages/Model/Page.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 */ /** @@ -2232,10 +2232,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/Pages/Model/Paging.php b/codegen/Cms/Pages/Model/Paging.php index bb4b19276..14fab9b77 100644 --- a/codegen/Cms/Pages/Model/Paging.php +++ b/codegen/Cms/Pages/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/Pages/Model/PreviousPage.php b/codegen/Cms/Pages/Model/PreviousPage.php index 116c5e562..e36be4bd1 100644 --- a/codegen/Cms/Pages/Model/PreviousPage.php +++ b/codegen/Cms/Pages/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/Pages/Model/RGBAColor.php b/codegen/Cms/Pages/Model/RGBAColor.php index 78218c99c..a621763b4 100644 --- a/codegen/Cms/Pages/Model/RGBAColor.php +++ b/codegen/Cms/Pages/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/Pages/Model/RowMetaData.php b/codegen/Cms/Pages/Model/RowMetaData.php index b40fe33d2..5fc87f419 100644 --- a/codegen/Cms/Pages/Model/RowMetaData.php +++ b/codegen/Cms/Pages/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/Pages/Model/SetNewLanguagePrimaryRequestVNext.php b/codegen/Cms/Pages/Model/SetNewLanguagePrimaryRequestVNext.php index 1067158df..4b3beaf6e 100644 --- a/codegen/Cms/Pages/Model/SetNewLanguagePrimaryRequestVNext.php +++ b/codegen/Cms/Pages/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/Pages/Model/SideOrCorner.php b/codegen/Cms/Pages/Model/SideOrCorner.php index 2bfb65e19..92735e54b 100644 --- a/codegen/Cms/Pages/Model/SideOrCorner.php +++ b/codegen/Cms/Pages/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/Pages/Model/StandardError.php b/codegen/Cms/Pages/Model/StandardError.php index 360a9e9df..124ba1e2c 100644 --- a/codegen/Cms/Pages/Model/StandardError.php +++ b/codegen/Cms/Pages/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/Pages/Model/Styles.php b/codegen/Cms/Pages/Model/Styles.php index 131aefe62..c7ff00746 100644 --- a/codegen/Cms/Pages/Model/Styles.php +++ b/codegen/Cms/Pages/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 */ /** @@ -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('background_color', $data ?? [], null); $this->setIfExists('flexbox_positioning', $data ?? [], null); diff --git a/codegen/Cms/Pages/Model/UpdateLanguagesRequestVNext.php b/codegen/Cms/Pages/Model/UpdateLanguagesRequestVNext.php index c06eb02fd..3aa8d4593 100644 --- a/codegen/Cms/Pages/Model/UpdateLanguagesRequestVNext.php +++ b/codegen/Cms/Pages/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/Pages/Model/VersionContentFolder.php b/codegen/Cms/Pages/Model/VersionContentFolder.php index e899c8a3a..65582b595 100644 --- a/codegen/Cms/Pages/Model/VersionContentFolder.php +++ b/codegen/Cms/Pages/Model/VersionContentFolder.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/Pages/Model/VersionPage.php b/codegen/Cms/Pages/Model/VersionPage.php index 42122787b..bae25f8da 100644 --- a/codegen/Cms/Pages/Model/VersionPage.php +++ b/codegen/Cms/Pages/Model/VersionPage.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/Pages/Model/VersionUser.php b/codegen/Cms/Pages/Model/VersionUser.php index f7850bd41..519646d6d 100644 --- a/codegen/Cms/Pages/Model/VersionUser.php +++ b/codegen/Cms/Pages/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/Pages/ObjectSerializer.php b/codegen/Cms/Pages/ObjectSerializer.php index 6466347b7..a162189a4 100644 --- a/codegen/Cms/Pages/ObjectSerializer.php +++ b/codegen/Cms/Pages/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/Performance/Api/PublicPerformanceApi.php b/codegen/Cms/Performance/Api/PublicPerformanceApi.php index 8ccc229f8..3cd50a81e 100644 --- a/codegen/Cms/Performance/Api/PublicPerformanceApi.php +++ b/codegen/Cms/Performance/Api/PublicPerformanceApi.php @@ -10,13 +10,13 @@ */ /** - * CMS Performance + * Performance * * Use these endpoints to get a time series view of your website's performance. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -86,13 +86,13 @@ class PublicPerformanceApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); $this->headerSelector = $selector ?: new HeaderSelector(); $this->hostIndex = $hostIndex; } @@ -130,14 +130,14 @@ public function getConfig() * * View your website's performance. * - * @param string $domain The domain to search return data for. (optional) - * @param string $path The url path of the domain to return data for. (optional) - * @param bool $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) - * @param bool $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) - * @param string $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param string $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param int $start A timestamp in milliseconds that indicates the start of the time period. (optional) - * @param int $end A timestamp in milliseconds that indicates the end of the time period. (optional) + * @param string|null $domain The domain to search return data for. (optional) + * @param string|null $path The url path of the domain to return data for. (optional) + * @param bool|null $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) + * @param bool|null $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) + * @param string|null $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param string|null $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param int|null $start A timestamp in milliseconds that indicates the start of the time period. (optional) + * @param int|null $end A timestamp in milliseconds that indicates the end of the time period. (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\Performance\ApiException on non-2xx response or if the response body is not in the expected format @@ -155,14 +155,14 @@ public function getPage($domain = null, $path = null, $pad = null, $sum = null, * * View your website's performance. * - * @param string $domain The domain to search return data for. (optional) - * @param string $path The url path of the domain to return data for. (optional) - * @param bool $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) - * @param bool $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) - * @param string $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param string $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param int $start A timestamp in milliseconds that indicates the start of the time period. (optional) - * @param int $end A timestamp in milliseconds that indicates the end of the time period. (optional) + * @param string|null $domain The domain to search return data for. (optional) + * @param string|null $path The url path of the domain to return data for. (optional) + * @param bool|null $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) + * @param bool|null $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) + * @param string|null $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param string|null $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param int|null $start A timestamp in milliseconds that indicates the start of the time period. (optional) + * @param int|null $end A timestamp in milliseconds that indicates the end of the time period. (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\Performance\ApiException on non-2xx response or if the response body is not in the expected format @@ -195,18 +195,6 @@ public function getPageWithHttpInfo($domain = null, $path = null, $pad = 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: @@ -265,6 +253,19 @@ public function getPageWithHttpInfo($domain = null, $path = null, $pad = 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\Performance\Model\PublicPerformanceResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -321,14 +322,14 @@ public function getPageWithHttpInfo($domain = null, $path = null, $pad = null, $ * * View your website's performance. * - * @param string $domain The domain to search return data for. (optional) - * @param string $path The url path of the domain to return data for. (optional) - * @param bool $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) - * @param bool $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) - * @param string $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param string $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param int $start A timestamp in milliseconds that indicates the start of the time period. (optional) - * @param int $end A timestamp in milliseconds that indicates the end of the time period. (optional) + * @param string|null $domain The domain to search return data for. (optional) + * @param string|null $path The url path of the domain to return data for. (optional) + * @param bool|null $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) + * @param bool|null $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) + * @param string|null $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param string|null $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param int|null $start A timestamp in milliseconds that indicates the start of the time period. (optional) + * @param int|null $end A timestamp in milliseconds that indicates the end of the time period. (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 @@ -349,14 +350,14 @@ function ($response) { * * View your website's performance. * - * @param string $domain The domain to search return data for. (optional) - * @param string $path The url path of the domain to return data for. (optional) - * @param bool $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) - * @param bool $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) - * @param string $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param string $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param int $start A timestamp in milliseconds that indicates the start of the time period. (optional) - * @param int $end A timestamp in milliseconds that indicates the end of the time period. (optional) + * @param string|null $domain The domain to search return data for. (optional) + * @param string|null $path The url path of the domain to return data for. (optional) + * @param bool|null $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) + * @param bool|null $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) + * @param string|null $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param string|null $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param int|null $start A timestamp in milliseconds that indicates the start of the time period. (optional) + * @param int|null $end A timestamp in milliseconds that indicates the end of the time period. (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 @@ -406,14 +407,14 @@ function ($exception) { /** * Create request for operation 'getPage' * - * @param string $domain The domain to search return data for. (optional) - * @param string $path The url path of the domain to return data for. (optional) - * @param bool $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) - * @param bool $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) - * @param string $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param string $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param int $start A timestamp in milliseconds that indicates the start of the time period. (optional) - * @param int $end A timestamp in milliseconds that indicates the end of the time period. (optional) + * @param string|null $domain The domain to search return data for. (optional) + * @param string|null $path The url path of the domain to return data for. (optional) + * @param bool|null $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) + * @param bool|null $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) + * @param string|null $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param string|null $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param int|null $start A timestamp in milliseconds that indicates the start of the time period. (optional) + * @param int|null $end A timestamp in milliseconds that indicates the end of the time period. (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 @@ -576,14 +577,14 @@ public function getPageRequest($domain = null, $path = null, $pad = null, $sum = * * View your website's uptime. * - * @param string $domain The domain to search return data for. (optional) - * @param string $path path (optional) - * @param bool $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) - * @param bool $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) - * @param string $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param string $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param int $start A timestamp in milliseconds that indicates the start of the time period. (optional) - * @param int $end A timestamp in milliseconds that indicates the end of the time period. (optional) + * @param string|null $domain The domain to search return data for. (optional) + * @param string|null $path path (optional) + * @param bool|null $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) + * @param bool|null $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) + * @param string|null $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param string|null $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param int|null $start A timestamp in milliseconds that indicates the start of the time period. (optional) + * @param int|null $end A timestamp in milliseconds that indicates the end of the time period. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUptime'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Performance\ApiException on non-2xx response or if the response body is not in the expected format @@ -601,14 +602,14 @@ public function getUptime($domain = null, $path = null, $pad = null, $sum = null * * View your website's uptime. * - * @param string $domain The domain to search return data for. (optional) - * @param string $path (optional) - * @param bool $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) - * @param bool $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) - * @param string $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param string $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param int $start A timestamp in milliseconds that indicates the start of the time period. (optional) - * @param int $end A timestamp in milliseconds that indicates the end of the time period. (optional) + * @param string|null $domain The domain to search return data for. (optional) + * @param string|null $path (optional) + * @param bool|null $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) + * @param bool|null $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) + * @param string|null $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param string|null $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param int|null $start A timestamp in milliseconds that indicates the start of the time period. (optional) + * @param int|null $end A timestamp in milliseconds that indicates the end of the time period. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUptime'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Performance\ApiException on non-2xx response or if the response body is not in the expected format @@ -641,18 +642,6 @@ public function getUptimeWithHttpInfo($domain = null, $path = null, $pad = 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: @@ -711,6 +700,19 @@ public function getUptimeWithHttpInfo($domain = null, $path = null, $pad = 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\Performance\Model\PublicPerformanceResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -767,14 +769,14 @@ public function getUptimeWithHttpInfo($domain = null, $path = null, $pad = null, * * View your website's uptime. * - * @param string $domain The domain to search return data for. (optional) - * @param string $path (optional) - * @param bool $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) - * @param bool $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) - * @param string $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param string $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param int $start A timestamp in milliseconds that indicates the start of the time period. (optional) - * @param int $end A timestamp in milliseconds that indicates the end of the time period. (optional) + * @param string|null $domain The domain to search return data for. (optional) + * @param string|null $path (optional) + * @param bool|null $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) + * @param bool|null $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) + * @param string|null $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param string|null $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param int|null $start A timestamp in milliseconds that indicates the start of the time period. (optional) + * @param int|null $end A timestamp in milliseconds that indicates the end of the time period. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUptime'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -795,14 +797,14 @@ function ($response) { * * View your website's uptime. * - * @param string $domain The domain to search return data for. (optional) - * @param string $path (optional) - * @param bool $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) - * @param bool $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) - * @param string $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param string $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param int $start A timestamp in milliseconds that indicates the start of the time period. (optional) - * @param int $end A timestamp in milliseconds that indicates the end of the time period. (optional) + * @param string|null $domain The domain to search return data for. (optional) + * @param string|null $path (optional) + * @param bool|null $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) + * @param bool|null $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) + * @param string|null $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param string|null $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param int|null $start A timestamp in milliseconds that indicates the start of the time period. (optional) + * @param int|null $end A timestamp in milliseconds that indicates the end of the time period. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUptime'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -852,14 +854,14 @@ function ($exception) { /** * Create request for operation 'getUptime' * - * @param string $domain The domain to search return data for. (optional) - * @param string $path (optional) - * @param bool $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) - * @param bool $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) - * @param string $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param string $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) - * @param int $start A timestamp in milliseconds that indicates the start of the time period. (optional) - * @param int $end A timestamp in milliseconds that indicates the end of the time period. (optional) + * @param string|null $domain The domain to search return data for. (optional) + * @param string|null $path (optional) + * @param bool|null $pad Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. (optional) + * @param bool|null $sum Specifies whether the time series data should be summated for the given period. Defaults to false. (optional) + * @param string|null $period A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param string|null $interval The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] (optional) + * @param int|null $start A timestamp in milliseconds that indicates the start of the time period. (optional) + * @param int|null $end A timestamp in milliseconds that indicates the end of the time period. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUptime'] to see the possible values for this operation * * @throws \InvalidArgumentException diff --git a/codegen/Cms/Performance/ApiException.php b/codegen/Cms/Performance/ApiException.php index d9bf257bb..e6d2b24c9 100644 --- a/codegen/Cms/Performance/ApiException.php +++ b/codegen/Cms/Performance/ApiException.php @@ -10,13 +10,13 @@ */ /** - * CMS Performance + * Performance * * Use these endpoints to get a time series view of your website's performance. * * 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/Performance/Configuration.php b/codegen/Cms/Performance/Configuration.php index 00f23fdc6..860901180 100644 --- a/codegen/Cms/Performance/Configuration.php +++ b/codegen/Cms/Performance/Configuration.php @@ -10,13 +10,13 @@ */ /** - * CMS Performance + * Performance * * Use these endpoints to get a time series view of your website's performance. * * 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/Performance/HeaderSelector.php b/codegen/Cms/Performance/HeaderSelector.php index 274f3b512..d23cda3dd 100644 --- a/codegen/Cms/Performance/HeaderSelector.php +++ b/codegen/Cms/Performance/HeaderSelector.php @@ -10,13 +10,13 @@ */ /** - * CMS Performance + * Performance * * Use these endpoints to get a time series view of your website's performance. * * 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/Performance/Model/Error.php b/codegen/Cms/Performance/Model/Error.php index c09bed04c..0c7fc66cf 100644 --- a/codegen/Cms/Performance/Model/Error.php +++ b/codegen/Cms/Performance/Model/Error.php @@ -11,13 +11,13 @@ */ /** - * CMS Performance + * Performance * * Use these endpoints to get a time series view of your website's performance. * * 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/Performance/Model/ErrorDetail.php b/codegen/Cms/Performance/Model/ErrorDetail.php index d47676142..e77d03c7c 100644 --- a/codegen/Cms/Performance/Model/ErrorDetail.php +++ b/codegen/Cms/Performance/Model/ErrorDetail.php @@ -11,13 +11,13 @@ */ /** - * CMS Performance + * Performance * * Use these endpoints to get a time series view of your website's performance. * * 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/Performance/Model/ModelInterface.php b/codegen/Cms/Performance/Model/ModelInterface.php index c9cd04b20..cfd0c8207 100644 --- a/codegen/Cms/Performance/Model/ModelInterface.php +++ b/codegen/Cms/Performance/Model/ModelInterface.php @@ -11,13 +11,13 @@ */ /** - * CMS Performance + * Performance * * Use these endpoints to get a time series view of your website's performance. * * 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/Performance/Model/PerformanceView.php b/codegen/Cms/Performance/Model/PerformanceView.php index 0826257a1..1189c0a04 100644 --- a/codegen/Cms/Performance/Model/PerformanceView.php +++ b/codegen/Cms/Performance/Model/PerformanceView.php @@ -11,13 +11,13 @@ */ /** - * CMS Performance + * Performance * * Use these endpoints to get a time series view of your website's performance. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -366,10 +366,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('_403', $data ?? [], null); $this->setIfExists('_404', $data ?? [], null); diff --git a/codegen/Cms/Performance/Model/PublicPerformanceResponse.php b/codegen/Cms/Performance/Model/PublicPerformanceResponse.php index 4d4fb1f63..12ba6031a 100644 --- a/codegen/Cms/Performance/Model/PublicPerformanceResponse.php +++ b/codegen/Cms/Performance/Model/PublicPerformanceResponse.php @@ -11,13 +11,13 @@ */ /** - * CMS Performance + * Performance * * Use these endpoints to get a time series view of your website's performance. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -337,10 +337,10 @@ public function getIntervalAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('path', $data ?? [], null); $this->setIfExists('period', $data ?? [], null); diff --git a/codegen/Cms/Performance/ObjectSerializer.php b/codegen/Cms/Performance/ObjectSerializer.php index b3a77a6ef..8790009fb 100644 --- a/codegen/Cms/Performance/ObjectSerializer.php +++ b/codegen/Cms/Performance/ObjectSerializer.php @@ -11,13 +11,13 @@ */ /** - * CMS Performance + * Performance * * Use these endpoints to get a time series view of your website's performance. * * 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/SiteSearch/Api/PublicApi.php b/codegen/Cms/SiteSearch/Api/PublicApi.php index 9a4785bb1..207f7b796 100644 --- a/codegen/Cms/SiteSearch/Api/PublicApi.php +++ b/codegen/Cms/SiteSearch/Api/PublicApi.php @@ -10,13 +10,13 @@ */ /** - * CMS Site Search + * Site Search * * Use these endpoints for searching content on your HubSpot hosted CMS website(s). * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -86,13 +86,13 @@ class PublicApi * @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; } @@ -131,7 +131,7 @@ public function getConfig() * Get indexed properties. * * @param string $content_id ID of the target document when searching for indexed properties. (required) - * @param string $type The type of document. Can be one of `SITE_PAGE`, `BLOG_POST`, or `KNOWLEDGE_ARTICLE`. (optional) + * @param string|null $type The type of document. Can be one of `SITE_PAGE`, `BLOG_POST`, or `KNOWLEDGE_ARTICLE`. (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\SiteSearch\ApiException on non-2xx response or if the response body is not in the expected format @@ -150,7 +150,7 @@ public function getById($content_id, $type = null, string $contentType = self::c * Get indexed properties. * * @param string $content_id ID of the target document when searching for indexed properties. (required) - * @param string $type The type of document. Can be one of `SITE_PAGE`, `BLOG_POST`, or `KNOWLEDGE_ARTICLE`. (optional) + * @param string|null $type The type of document. Can be one of `SITE_PAGE`, `BLOG_POST`, or `KNOWLEDGE_ARTICLE`. (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\SiteSearch\ApiException on non-2xx response or if the response body is not in the expected format @@ -183,18 +183,6 @@ public function getByIdWithHttpInfo($content_id, $type = null, string $contentTy $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: @@ -253,6 +241,19 @@ public function getByIdWithHttpInfo($content_id, $type = null, string $contentTy ]; } + if ($statusCode < 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\SiteSearch\Model\IndexedData'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -310,7 +311,7 @@ public function getByIdWithHttpInfo($content_id, $type = null, string $contentTy * Get indexed properties. * * @param string $content_id ID of the target document when searching for indexed properties. (required) - * @param string $type The type of document. Can be one of `SITE_PAGE`, `BLOG_POST`, or `KNOWLEDGE_ARTICLE`. (optional) + * @param string|null $type The type of document. Can be one of `SITE_PAGE`, `BLOG_POST`, or `KNOWLEDGE_ARTICLE`. (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 @@ -332,7 +333,7 @@ function ($response) { * Get indexed properties. * * @param string $content_id ID of the target document when searching for indexed properties. (required) - * @param string $type The type of document. Can be one of `SITE_PAGE`, `BLOG_POST`, or `KNOWLEDGE_ARTICLE`. (optional) + * @param string|null $type The type of document. Can be one of `SITE_PAGE`, `BLOG_POST`, or `KNOWLEDGE_ARTICLE`. (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 @@ -383,7 +384,7 @@ function ($exception) { * Create request for operation 'getById' * * @param string $content_id ID of the target document when searching for indexed properties. (required) - * @param string $type The type of document. Can be one of `SITE_PAGE`, `BLOG_POST`, or `KNOWLEDGE_ARTICLE`. (optional) + * @param string|null $type The type of document. Can be one of `SITE_PAGE`, `BLOG_POST`, or `KNOWLEDGE_ARTICLE`. (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 @@ -494,23 +495,23 @@ public function getByIdRequest($content_id, $type = null, string $contentType = * * Search your site. * - * @param string $q The term to search for. (optional) - * @param int $limit Specifies the number of results to be returned in a single response. Defaults to `10`. Maximum value is `100`. (optional) - * @param int $offset Used to page through the results. If there are more results than specified by the `limit` parameter, you will need to use the value of offset returned in the previous request to get the next set of results. (optional) - * @param string $language Specifies the language of content to be searched. This value must be a valid [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `es` for Spanish) (optional) - * @param bool $match_prefix Inverts the behavior of the pathPrefix filter when set to `false`. Defaults to `true`. (optional) - * @param bool $autocomplete Specifies whether or not you are showing autocomplete results. Defaults to false. (optional) - * @param float $popularity_boost Specifies how strongly a result is boosted based on its view count. Defaults to 1.0. (optional) - * @param float $boost_limit Specifies the maximum amount a result will be boosted based on its view count. Defaults to 5.0. Read more about elasticsearch boosting [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-boost.html). (optional) - * @param string $boost_recent Specifies a relative time window where scores of documents published outside this time window decay. This can only be used for blog posts. For example, boostRecent=10d will boost documents published within the last 10 days. Supported timeunits are ms (milliseconds), s (seconds), m (minutes), h (hours), d (days). (optional) - * @param int $table_id Specifies a specific HubDB table to search. Only returns results from the specified table. Can be used in tandem with the `hubdbQuery` parameter to further filter results. (optional) - * @param string $hubdb_query Specify a HubDB query to further filter the search results. (optional) - * @param string[] $domain A domain to match search results for. Multiple domains can be provided with &. (optional) - * @param string[] $type Specifies the type of content to search. Can be one or more of SITE_PAGE, LANDING_PAGE, BLOG_POST, LISTING_PAGE, and KNOWLEDGE_ARTICLE. Defaults to all content types except LANDING_PAGE and KNOWLEDGE_ARTICLE (optional) - * @param string[] $path_prefix Specifies a path prefix to filter search results. Will only return results with URL paths that start with the specified parameter. Can be used multiple times. (optional) - * @param string[] $property Specifies which properties to include in the search. Options include `title`, `description`, and `html`. All properties will be searched by default. (optional) - * @param string $length Specifies the length of the search results. Can be set to `LONG` or `SHORT`. `SHORT` will return the first 128 characters of the content's meta description. `LONG` will build a more detailed content snippet based on the html/content of the page. (optional) - * @param int[] $group_id Specifies which blog(s) to be searched by blog ID. Can be used multiple times to search more than one blog. (optional) + * @param string|null $q The term to search for. (optional) + * @param int|null $limit Specifies the number of results to be returned in a single response. Defaults to `10`. Maximum value is `100`. (optional) + * @param int|null $offset Used to page through the results. If there are more results than specified by the `limit` parameter, you will need to use the value of offset returned in the previous request to get the next set of results. (optional) + * @param string|null $language Specifies the language of content to be searched. This value must be a valid [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `es` for Spanish) (optional) + * @param bool|null $match_prefix Inverts the behavior of the pathPrefix filter when set to `false`. Defaults to `true`. (optional) + * @param bool|null $autocomplete Specifies whether or not you are showing autocomplete results. Defaults to false. (optional) + * @param float|null $popularity_boost Specifies how strongly a result is boosted based on its view count. Defaults to 1.0. (optional) + * @param float|null $boost_limit Specifies the maximum amount a result will be boosted based on its view count. Defaults to 5.0. Read more about elasticsearch boosting [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-boost.html). (optional) + * @param string|null $boost_recent Specifies a relative time window where scores of documents published outside this time window decay. This can only be used for blog posts. For example, boostRecent=10d will boost documents published within the last 10 days. Supported timeunits are ms (milliseconds), s (seconds), m (minutes), h (hours), d (days). (optional) + * @param int|null $table_id Specifies a specific HubDB table to search. Only returns results from the specified table. Can be used in tandem with the `hubdbQuery` parameter to further filter results. (optional) + * @param string|null $hubdb_query Specify a HubDB query to further filter the search results. (optional) + * @param string[]|null $domain A domain to match search results for. Multiple domains can be provided with &. (optional) + * @param string[]|null $type Specifies the type of content to search. Can be one or more of SITE_PAGE, LANDING_PAGE, BLOG_POST, LISTING_PAGE, and KNOWLEDGE_ARTICLE. Defaults to all content types except LANDING_PAGE and KNOWLEDGE_ARTICLE (optional) + * @param string[]|null $path_prefix Specifies a path prefix to filter search results. Will only return results with URL paths that start with the specified parameter. Can be used multiple times. (optional) + * @param string[]|null $property Specifies which properties to include in the search. Options include `title`, `description`, and `html`. All properties will be searched by default. (optional) + * @param string|null $length Specifies the length of the search results. Can be set to `LONG` or `SHORT`. `SHORT` will return the first 128 characters of the content's meta description. `LONG` will build a more detailed content snippet based on the html/content of the page. (optional) + * @param int[]|null $group_id Specifies which blog(s) to be searched by blog ID. Can be used multiple times to search more than one blog. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['search'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\SiteSearch\ApiException on non-2xx response or if the response body is not in the expected format @@ -528,23 +529,23 @@ public function search($q = null, $limit = null, $offset = null, $language = nul * * Search your site. * - * @param string $q The term to search for. (optional) - * @param int $limit Specifies the number of results to be returned in a single response. Defaults to `10`. Maximum value is `100`. (optional) - * @param int $offset Used to page through the results. If there are more results than specified by the `limit` parameter, you will need to use the value of offset returned in the previous request to get the next set of results. (optional) - * @param string $language Specifies the language of content to be searched. This value must be a valid [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `es` for Spanish) (optional) - * @param bool $match_prefix Inverts the behavior of the pathPrefix filter when set to `false`. Defaults to `true`. (optional) - * @param bool $autocomplete Specifies whether or not you are showing autocomplete results. Defaults to false. (optional) - * @param float $popularity_boost Specifies how strongly a result is boosted based on its view count. Defaults to 1.0. (optional) - * @param float $boost_limit Specifies the maximum amount a result will be boosted based on its view count. Defaults to 5.0. Read more about elasticsearch boosting [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-boost.html). (optional) - * @param string $boost_recent Specifies a relative time window where scores of documents published outside this time window decay. This can only be used for blog posts. For example, boostRecent=10d will boost documents published within the last 10 days. Supported timeunits are ms (milliseconds), s (seconds), m (minutes), h (hours), d (days). (optional) - * @param int $table_id Specifies a specific HubDB table to search. Only returns results from the specified table. Can be used in tandem with the `hubdbQuery` parameter to further filter results. (optional) - * @param string $hubdb_query Specify a HubDB query to further filter the search results. (optional) - * @param string[] $domain A domain to match search results for. Multiple domains can be provided with &. (optional) - * @param string[] $type Specifies the type of content to search. Can be one or more of SITE_PAGE, LANDING_PAGE, BLOG_POST, LISTING_PAGE, and KNOWLEDGE_ARTICLE. Defaults to all content types except LANDING_PAGE and KNOWLEDGE_ARTICLE (optional) - * @param string[] $path_prefix Specifies a path prefix to filter search results. Will only return results with URL paths that start with the specified parameter. Can be used multiple times. (optional) - * @param string[] $property Specifies which properties to include in the search. Options include `title`, `description`, and `html`. All properties will be searched by default. (optional) - * @param string $length Specifies the length of the search results. Can be set to `LONG` or `SHORT`. `SHORT` will return the first 128 characters of the content's meta description. `LONG` will build a more detailed content snippet based on the html/content of the page. (optional) - * @param int[] $group_id Specifies which blog(s) to be searched by blog ID. Can be used multiple times to search more than one blog. (optional) + * @param string|null $q The term to search for. (optional) + * @param int|null $limit Specifies the number of results to be returned in a single response. Defaults to `10`. Maximum value is `100`. (optional) + * @param int|null $offset Used to page through the results. If there are more results than specified by the `limit` parameter, you will need to use the value of offset returned in the previous request to get the next set of results. (optional) + * @param string|null $language Specifies the language of content to be searched. This value must be a valid [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `es` for Spanish) (optional) + * @param bool|null $match_prefix Inverts the behavior of the pathPrefix filter when set to `false`. Defaults to `true`. (optional) + * @param bool|null $autocomplete Specifies whether or not you are showing autocomplete results. Defaults to false. (optional) + * @param float|null $popularity_boost Specifies how strongly a result is boosted based on its view count. Defaults to 1.0. (optional) + * @param float|null $boost_limit Specifies the maximum amount a result will be boosted based on its view count. Defaults to 5.0. Read more about elasticsearch boosting [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-boost.html). (optional) + * @param string|null $boost_recent Specifies a relative time window where scores of documents published outside this time window decay. This can only be used for blog posts. For example, boostRecent=10d will boost documents published within the last 10 days. Supported timeunits are ms (milliseconds), s (seconds), m (minutes), h (hours), d (days). (optional) + * @param int|null $table_id Specifies a specific HubDB table to search. Only returns results from the specified table. Can be used in tandem with the `hubdbQuery` parameter to further filter results. (optional) + * @param string|null $hubdb_query Specify a HubDB query to further filter the search results. (optional) + * @param string[]|null $domain A domain to match search results for. Multiple domains can be provided with &. (optional) + * @param string[]|null $type Specifies the type of content to search. Can be one or more of SITE_PAGE, LANDING_PAGE, BLOG_POST, LISTING_PAGE, and KNOWLEDGE_ARTICLE. Defaults to all content types except LANDING_PAGE and KNOWLEDGE_ARTICLE (optional) + * @param string[]|null $path_prefix Specifies a path prefix to filter search results. Will only return results with URL paths that start with the specified parameter. Can be used multiple times. (optional) + * @param string[]|null $property Specifies which properties to include in the search. Options include `title`, `description`, and `html`. All properties will be searched by default. (optional) + * @param string|null $length Specifies the length of the search results. Can be set to `LONG` or `SHORT`. `SHORT` will return the first 128 characters of the content's meta description. `LONG` will build a more detailed content snippet based on the html/content of the page. (optional) + * @param int[]|null $group_id Specifies which blog(s) to be searched by blog ID. Can be used multiple times to search more than one blog. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['search'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\SiteSearch\ApiException on non-2xx response or if the response body is not in the expected format @@ -577,18 +578,6 @@ public function searchWithHttpInfo($q = null, $limit = null, $offset = null, $la $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: @@ -647,6 +636,19 @@ public function searchWithHttpInfo($q = null, $limit = null, $offset = null, $la ]; } + if ($statusCode < 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\SiteSearch\Model\PublicSearchResults'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -703,23 +705,23 @@ public function searchWithHttpInfo($q = null, $limit = null, $offset = null, $la * * Search your site. * - * @param string $q The term to search for. (optional) - * @param int $limit Specifies the number of results to be returned in a single response. Defaults to `10`. Maximum value is `100`. (optional) - * @param int $offset Used to page through the results. If there are more results than specified by the `limit` parameter, you will need to use the value of offset returned in the previous request to get the next set of results. (optional) - * @param string $language Specifies the language of content to be searched. This value must be a valid [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `es` for Spanish) (optional) - * @param bool $match_prefix Inverts the behavior of the pathPrefix filter when set to `false`. Defaults to `true`. (optional) - * @param bool $autocomplete Specifies whether or not you are showing autocomplete results. Defaults to false. (optional) - * @param float $popularity_boost Specifies how strongly a result is boosted based on its view count. Defaults to 1.0. (optional) - * @param float $boost_limit Specifies the maximum amount a result will be boosted based on its view count. Defaults to 5.0. Read more about elasticsearch boosting [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-boost.html). (optional) - * @param string $boost_recent Specifies a relative time window where scores of documents published outside this time window decay. This can only be used for blog posts. For example, boostRecent=10d will boost documents published within the last 10 days. Supported timeunits are ms (milliseconds), s (seconds), m (minutes), h (hours), d (days). (optional) - * @param int $table_id Specifies a specific HubDB table to search. Only returns results from the specified table. Can be used in tandem with the `hubdbQuery` parameter to further filter results. (optional) - * @param string $hubdb_query Specify a HubDB query to further filter the search results. (optional) - * @param string[] $domain A domain to match search results for. Multiple domains can be provided with &. (optional) - * @param string[] $type Specifies the type of content to search. Can be one or more of SITE_PAGE, LANDING_PAGE, BLOG_POST, LISTING_PAGE, and KNOWLEDGE_ARTICLE. Defaults to all content types except LANDING_PAGE and KNOWLEDGE_ARTICLE (optional) - * @param string[] $path_prefix Specifies a path prefix to filter search results. Will only return results with URL paths that start with the specified parameter. Can be used multiple times. (optional) - * @param string[] $property Specifies which properties to include in the search. Options include `title`, `description`, and `html`. All properties will be searched by default. (optional) - * @param string $length Specifies the length of the search results. Can be set to `LONG` or `SHORT`. `SHORT` will return the first 128 characters of the content's meta description. `LONG` will build a more detailed content snippet based on the html/content of the page. (optional) - * @param int[] $group_id Specifies which blog(s) to be searched by blog ID. Can be used multiple times to search more than one blog. (optional) + * @param string|null $q The term to search for. (optional) + * @param int|null $limit Specifies the number of results to be returned in a single response. Defaults to `10`. Maximum value is `100`. (optional) + * @param int|null $offset Used to page through the results. If there are more results than specified by the `limit` parameter, you will need to use the value of offset returned in the previous request to get the next set of results. (optional) + * @param string|null $language Specifies the language of content to be searched. This value must be a valid [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `es` for Spanish) (optional) + * @param bool|null $match_prefix Inverts the behavior of the pathPrefix filter when set to `false`. Defaults to `true`. (optional) + * @param bool|null $autocomplete Specifies whether or not you are showing autocomplete results. Defaults to false. (optional) + * @param float|null $popularity_boost Specifies how strongly a result is boosted based on its view count. Defaults to 1.0. (optional) + * @param float|null $boost_limit Specifies the maximum amount a result will be boosted based on its view count. Defaults to 5.0. Read more about elasticsearch boosting [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-boost.html). (optional) + * @param string|null $boost_recent Specifies a relative time window where scores of documents published outside this time window decay. This can only be used for blog posts. For example, boostRecent=10d will boost documents published within the last 10 days. Supported timeunits are ms (milliseconds), s (seconds), m (minutes), h (hours), d (days). (optional) + * @param int|null $table_id Specifies a specific HubDB table to search. Only returns results from the specified table. Can be used in tandem with the `hubdbQuery` parameter to further filter results. (optional) + * @param string|null $hubdb_query Specify a HubDB query to further filter the search results. (optional) + * @param string[]|null $domain A domain to match search results for. Multiple domains can be provided with &. (optional) + * @param string[]|null $type Specifies the type of content to search. Can be one or more of SITE_PAGE, LANDING_PAGE, BLOG_POST, LISTING_PAGE, and KNOWLEDGE_ARTICLE. Defaults to all content types except LANDING_PAGE and KNOWLEDGE_ARTICLE (optional) + * @param string[]|null $path_prefix Specifies a path prefix to filter search results. Will only return results with URL paths that start with the specified parameter. Can be used multiple times. (optional) + * @param string[]|null $property Specifies which properties to include in the search. Options include `title`, `description`, and `html`. All properties will be searched by default. (optional) + * @param string|null $length Specifies the length of the search results. Can be set to `LONG` or `SHORT`. `SHORT` will return the first 128 characters of the content's meta description. `LONG` will build a more detailed content snippet based on the html/content of the page. (optional) + * @param int[]|null $group_id Specifies which blog(s) to be searched by blog ID. Can be used multiple times to search more than one blog. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['search'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -740,23 +742,23 @@ function ($response) { * * Search your site. * - * @param string $q The term to search for. (optional) - * @param int $limit Specifies the number of results to be returned in a single response. Defaults to `10`. Maximum value is `100`. (optional) - * @param int $offset Used to page through the results. If there are more results than specified by the `limit` parameter, you will need to use the value of offset returned in the previous request to get the next set of results. (optional) - * @param string $language Specifies the language of content to be searched. This value must be a valid [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `es` for Spanish) (optional) - * @param bool $match_prefix Inverts the behavior of the pathPrefix filter when set to `false`. Defaults to `true`. (optional) - * @param bool $autocomplete Specifies whether or not you are showing autocomplete results. Defaults to false. (optional) - * @param float $popularity_boost Specifies how strongly a result is boosted based on its view count. Defaults to 1.0. (optional) - * @param float $boost_limit Specifies the maximum amount a result will be boosted based on its view count. Defaults to 5.0. Read more about elasticsearch boosting [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-boost.html). (optional) - * @param string $boost_recent Specifies a relative time window where scores of documents published outside this time window decay. This can only be used for blog posts. For example, boostRecent=10d will boost documents published within the last 10 days. Supported timeunits are ms (milliseconds), s (seconds), m (minutes), h (hours), d (days). (optional) - * @param int $table_id Specifies a specific HubDB table to search. Only returns results from the specified table. Can be used in tandem with the `hubdbQuery` parameter to further filter results. (optional) - * @param string $hubdb_query Specify a HubDB query to further filter the search results. (optional) - * @param string[] $domain A domain to match search results for. Multiple domains can be provided with &. (optional) - * @param string[] $type Specifies the type of content to search. Can be one or more of SITE_PAGE, LANDING_PAGE, BLOG_POST, LISTING_PAGE, and KNOWLEDGE_ARTICLE. Defaults to all content types except LANDING_PAGE and KNOWLEDGE_ARTICLE (optional) - * @param string[] $path_prefix Specifies a path prefix to filter search results. Will only return results with URL paths that start with the specified parameter. Can be used multiple times. (optional) - * @param string[] $property Specifies which properties to include in the search. Options include `title`, `description`, and `html`. All properties will be searched by default. (optional) - * @param string $length Specifies the length of the search results. Can be set to `LONG` or `SHORT`. `SHORT` will return the first 128 characters of the content's meta description. `LONG` will build a more detailed content snippet based on the html/content of the page. (optional) - * @param int[] $group_id Specifies which blog(s) to be searched by blog ID. Can be used multiple times to search more than one blog. (optional) + * @param string|null $q The term to search for. (optional) + * @param int|null $limit Specifies the number of results to be returned in a single response. Defaults to `10`. Maximum value is `100`. (optional) + * @param int|null $offset Used to page through the results. If there are more results than specified by the `limit` parameter, you will need to use the value of offset returned in the previous request to get the next set of results. (optional) + * @param string|null $language Specifies the language of content to be searched. This value must be a valid [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `es` for Spanish) (optional) + * @param bool|null $match_prefix Inverts the behavior of the pathPrefix filter when set to `false`. Defaults to `true`. (optional) + * @param bool|null $autocomplete Specifies whether or not you are showing autocomplete results. Defaults to false. (optional) + * @param float|null $popularity_boost Specifies how strongly a result is boosted based on its view count. Defaults to 1.0. (optional) + * @param float|null $boost_limit Specifies the maximum amount a result will be boosted based on its view count. Defaults to 5.0. Read more about elasticsearch boosting [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-boost.html). (optional) + * @param string|null $boost_recent Specifies a relative time window where scores of documents published outside this time window decay. This can only be used for blog posts. For example, boostRecent=10d will boost documents published within the last 10 days. Supported timeunits are ms (milliseconds), s (seconds), m (minutes), h (hours), d (days). (optional) + * @param int|null $table_id Specifies a specific HubDB table to search. Only returns results from the specified table. Can be used in tandem with the `hubdbQuery` parameter to further filter results. (optional) + * @param string|null $hubdb_query Specify a HubDB query to further filter the search results. (optional) + * @param string[]|null $domain A domain to match search results for. Multiple domains can be provided with &. (optional) + * @param string[]|null $type Specifies the type of content to search. Can be one or more of SITE_PAGE, LANDING_PAGE, BLOG_POST, LISTING_PAGE, and KNOWLEDGE_ARTICLE. Defaults to all content types except LANDING_PAGE and KNOWLEDGE_ARTICLE (optional) + * @param string[]|null $path_prefix Specifies a path prefix to filter search results. Will only return results with URL paths that start with the specified parameter. Can be used multiple times. (optional) + * @param string[]|null $property Specifies which properties to include in the search. Options include `title`, `description`, and `html`. All properties will be searched by default. (optional) + * @param string|null $length Specifies the length of the search results. Can be set to `LONG` or `SHORT`. `SHORT` will return the first 128 characters of the content's meta description. `LONG` will build a more detailed content snippet based on the html/content of the page. (optional) + * @param int[]|null $group_id Specifies which blog(s) to be searched by blog ID. Can be used multiple times to search more than one blog. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['search'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -806,23 +808,23 @@ function ($exception) { /** * Create request for operation 'search' * - * @param string $q The term to search for. (optional) - * @param int $limit Specifies the number of results to be returned in a single response. Defaults to `10`. Maximum value is `100`. (optional) - * @param int $offset Used to page through the results. If there are more results than specified by the `limit` parameter, you will need to use the value of offset returned in the previous request to get the next set of results. (optional) - * @param string $language Specifies the language of content to be searched. This value must be a valid [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `es` for Spanish) (optional) - * @param bool $match_prefix Inverts the behavior of the pathPrefix filter when set to `false`. Defaults to `true`. (optional) - * @param bool $autocomplete Specifies whether or not you are showing autocomplete results. Defaults to false. (optional) - * @param float $popularity_boost Specifies how strongly a result is boosted based on its view count. Defaults to 1.0. (optional) - * @param float $boost_limit Specifies the maximum amount a result will be boosted based on its view count. Defaults to 5.0. Read more about elasticsearch boosting [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-boost.html). (optional) - * @param string $boost_recent Specifies a relative time window where scores of documents published outside this time window decay. This can only be used for blog posts. For example, boostRecent=10d will boost documents published within the last 10 days. Supported timeunits are ms (milliseconds), s (seconds), m (minutes), h (hours), d (days). (optional) - * @param int $table_id Specifies a specific HubDB table to search. Only returns results from the specified table. Can be used in tandem with the `hubdbQuery` parameter to further filter results. (optional) - * @param string $hubdb_query Specify a HubDB query to further filter the search results. (optional) - * @param string[] $domain A domain to match search results for. Multiple domains can be provided with &. (optional) - * @param string[] $type Specifies the type of content to search. Can be one or more of SITE_PAGE, LANDING_PAGE, BLOG_POST, LISTING_PAGE, and KNOWLEDGE_ARTICLE. Defaults to all content types except LANDING_PAGE and KNOWLEDGE_ARTICLE (optional) - * @param string[] $path_prefix Specifies a path prefix to filter search results. Will only return results with URL paths that start with the specified parameter. Can be used multiple times. (optional) - * @param string[] $property Specifies which properties to include in the search. Options include `title`, `description`, and `html`. All properties will be searched by default. (optional) - * @param string $length Specifies the length of the search results. Can be set to `LONG` or `SHORT`. `SHORT` will return the first 128 characters of the content's meta description. `LONG` will build a more detailed content snippet based on the html/content of the page. (optional) - * @param int[] $group_id Specifies which blog(s) to be searched by blog ID. Can be used multiple times to search more than one blog. (optional) + * @param string|null $q The term to search for. (optional) + * @param int|null $limit Specifies the number of results to be returned in a single response. Defaults to `10`. Maximum value is `100`. (optional) + * @param int|null $offset Used to page through the results. If there are more results than specified by the `limit` parameter, you will need to use the value of offset returned in the previous request to get the next set of results. (optional) + * @param string|null $language Specifies the language of content to be searched. This value must be a valid [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `es` for Spanish) (optional) + * @param bool|null $match_prefix Inverts the behavior of the pathPrefix filter when set to `false`. Defaults to `true`. (optional) + * @param bool|null $autocomplete Specifies whether or not you are showing autocomplete results. Defaults to false. (optional) + * @param float|null $popularity_boost Specifies how strongly a result is boosted based on its view count. Defaults to 1.0. (optional) + * @param float|null $boost_limit Specifies the maximum amount a result will be boosted based on its view count. Defaults to 5.0. Read more about elasticsearch boosting [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-boost.html). (optional) + * @param string|null $boost_recent Specifies a relative time window where scores of documents published outside this time window decay. This can only be used for blog posts. For example, boostRecent=10d will boost documents published within the last 10 days. Supported timeunits are ms (milliseconds), s (seconds), m (minutes), h (hours), d (days). (optional) + * @param int|null $table_id Specifies a specific HubDB table to search. Only returns results from the specified table. Can be used in tandem with the `hubdbQuery` parameter to further filter results. (optional) + * @param string|null $hubdb_query Specify a HubDB query to further filter the search results. (optional) + * @param string[]|null $domain A domain to match search results for. Multiple domains can be provided with &. (optional) + * @param string[]|null $type Specifies the type of content to search. Can be one or more of SITE_PAGE, LANDING_PAGE, BLOG_POST, LISTING_PAGE, and KNOWLEDGE_ARTICLE. Defaults to all content types except LANDING_PAGE and KNOWLEDGE_ARTICLE (optional) + * @param string[]|null $path_prefix Specifies a path prefix to filter search results. Will only return results with URL paths that start with the specified parameter. Can be used multiple times. (optional) + * @param string[]|null $property Specifies which properties to include in the search. Options include `title`, `description`, and `html`. All properties will be searched by default. (optional) + * @param string|null $length Specifies the length of the search results. Can be set to `LONG` or `SHORT`. `SHORT` will return the first 128 characters of the content's meta description. `LONG` will build a more detailed content snippet based on the html/content of the page. (optional) + * @param int[]|null $group_id Specifies which blog(s) to be searched by blog ID. Can be used multiple times to search more than one blog. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['search'] to see the possible values for this operation * * @throws \InvalidArgumentException diff --git a/codegen/Cms/SiteSearch/ApiException.php b/codegen/Cms/SiteSearch/ApiException.php index 799560f5c..5110a8fe9 100644 --- a/codegen/Cms/SiteSearch/ApiException.php +++ b/codegen/Cms/SiteSearch/ApiException.php @@ -10,13 +10,13 @@ */ /** - * CMS Site Search + * Site Search * * Use these endpoints for searching content on your HubSpot hosted CMS website(s). * * 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/SiteSearch/Configuration.php b/codegen/Cms/SiteSearch/Configuration.php index e0315b669..95594c7dc 100644 --- a/codegen/Cms/SiteSearch/Configuration.php +++ b/codegen/Cms/SiteSearch/Configuration.php @@ -10,13 +10,13 @@ */ /** - * CMS Site Search + * Site Search * * Use these endpoints for searching content on your HubSpot hosted CMS website(s). * * 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/SiteSearch/HeaderSelector.php b/codegen/Cms/SiteSearch/HeaderSelector.php index b3992fdb2..1218bd9a1 100644 --- a/codegen/Cms/SiteSearch/HeaderSelector.php +++ b/codegen/Cms/SiteSearch/HeaderSelector.php @@ -10,13 +10,13 @@ */ /** - * CMS Site Search + * Site Search * * Use these endpoints for searching content on your HubSpot hosted CMS website(s). * * 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/SiteSearch/Model/ContentSearchResult.php b/codegen/Cms/SiteSearch/Model/ContentSearchResult.php index 71f7e2955..f19c34af8 100644 --- a/codegen/Cms/SiteSearch/Model/ContentSearchResult.php +++ b/codegen/Cms/SiteSearch/Model/ContentSearchResult.php @@ -11,13 +11,13 @@ */ /** - * CMS Site Search + * Site Search * * Use these endpoints for searching content on your HubSpot hosted CMS website(s). * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -1876,10 +1876,10 @@ public function getTypeAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('combined_id', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); diff --git a/codegen/Cms/SiteSearch/Model/Error.php b/codegen/Cms/SiteSearch/Model/Error.php index 8dce9382a..07b94af28 100644 --- a/codegen/Cms/SiteSearch/Model/Error.php +++ b/codegen/Cms/SiteSearch/Model/Error.php @@ -11,13 +11,13 @@ */ /** - * CMS Site Search + * Site Search * * Use these endpoints for searching content on your HubSpot hosted CMS website(s). * * 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/SiteSearch/Model/ErrorDetail.php b/codegen/Cms/SiteSearch/Model/ErrorDetail.php index 7837cfaba..f6e5109b6 100644 --- a/codegen/Cms/SiteSearch/Model/ErrorDetail.php +++ b/codegen/Cms/SiteSearch/Model/ErrorDetail.php @@ -11,13 +11,13 @@ */ /** - * CMS Site Search + * Site Search * * Use these endpoints for searching content on your HubSpot hosted CMS website(s). * * 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/SiteSearch/Model/IndexedData.php b/codegen/Cms/SiteSearch/Model/IndexedData.php index d4190a0a8..221f957a2 100644 --- a/codegen/Cms/SiteSearch/Model/IndexedData.php +++ b/codegen/Cms/SiteSearch/Model/IndexedData.php @@ -11,13 +11,13 @@ */ /** - * CMS Site Search + * Site Search * * Use these endpoints for searching content on your HubSpot hosted CMS website(s). * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -273,10 +273,10 @@ public function getTypeAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); diff --git a/codegen/Cms/SiteSearch/Model/IndexedField.php b/codegen/Cms/SiteSearch/Model/IndexedField.php index ba32081c1..322feda99 100644 --- a/codegen/Cms/SiteSearch/Model/IndexedField.php +++ b/codegen/Cms/SiteSearch/Model/IndexedField.php @@ -11,13 +11,13 @@ */ /** - * CMS Site Search + * Site Search * * Use these endpoints for searching content on your HubSpot hosted CMS website(s). * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -257,10 +257,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('values', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); diff --git a/codegen/Cms/SiteSearch/Model/ModelInterface.php b/codegen/Cms/SiteSearch/Model/ModelInterface.php index 0d09b1276..c0ddc1fc9 100644 --- a/codegen/Cms/SiteSearch/Model/ModelInterface.php +++ b/codegen/Cms/SiteSearch/Model/ModelInterface.php @@ -11,13 +11,13 @@ */ /** - * CMS Site Search + * Site Search * * Use these endpoints for searching content on your HubSpot hosted CMS website(s). * * 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/SiteSearch/Model/PublicSearchResults.php b/codegen/Cms/SiteSearch/Model/PublicSearchResults.php index 0b5959a7f..2d856ebb2 100644 --- a/codegen/Cms/SiteSearch/Model/PublicSearchResults.php +++ b/codegen/Cms/SiteSearch/Model/PublicSearchResults.php @@ -11,13 +11,13 @@ */ /** - * CMS Site Search + * Site Search * * Use these endpoints for searching content on your HubSpot hosted CMS website(s). * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -269,10 +269,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('total', $data ?? [], null); $this->setIfExists('search_term', $data ?? [], null); diff --git a/codegen/Cms/SiteSearch/ObjectSerializer.php b/codegen/Cms/SiteSearch/ObjectSerializer.php index 5ecf36be9..5b9742b12 100644 --- a/codegen/Cms/SiteSearch/ObjectSerializer.php +++ b/codegen/Cms/SiteSearch/ObjectSerializer.php @@ -11,13 +11,13 @@ */ /** - * CMS Site Search + * Site Search * * Use these endpoints for searching content on your HubSpot hosted CMS website(s). * * 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/SourceCode/Api/ContentApi.php b/codegen/Cms/SourceCode/Api/ContentApi.php index 356a5b5d2..f4e02c725 100644 --- a/codegen/Cms/SourceCode/Api/ContentApi.php +++ b/codegen/Cms/SourceCode/Api/ContentApi.php @@ -10,13 +10,13 @@ */ /** - * CMS Source Code + * Source Code * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * 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 ContentApi * @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; } @@ -188,18 +188,6 @@ public function archiveWithHttpInfo($environment, $path, 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()]; @@ -402,7 +390,7 @@ public function archiveRequest($environment, $path, string $contentType = self:: * * @param string $environment The environment of the file (\"draft\" or \"published\"). (required) * @param string $path The file system location of the file. (required) - * @param \SplFileObject $file file (optional) + * @param \SplFileObject|null $file file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\SourceCode\ApiException on non-2xx response or if the response body is not in the expected format @@ -423,7 +411,7 @@ public function create($environment, $path, $file = null, string $contentType = * * @param string $environment The environment of the file (\"draft\" or \"published\"). (required) * @param string $path The file system location of the file. (required) - * @param \SplFileObject $file (optional) + * @param \SplFileObject|null $file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\SourceCode\ApiException on non-2xx response or if the response body is not in the expected format @@ -457,18 +445,6 @@ public function createWithHttpInfo($environment, $path, $file = null, string $co $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -527,6 +503,19 @@ public function createWithHttpInfo($environment, $path, $file = null, string $co ]; } + if ($statusCode < 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\SourceCode\Model\AssetFileMetadata'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -585,7 +574,7 @@ public function createWithHttpInfo($environment, $path, $file = null, string $co * * @param string $environment The environment of the file (\"draft\" or \"published\"). (required) * @param string $path The file system location of the file. (required) - * @param \SplFileObject $file (optional) + * @param \SplFileObject|null $file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -609,7 +598,7 @@ function ($response) { * * @param string $environment The environment of the file (\"draft\" or \"published\"). (required) * @param string $path The file system location of the file. (required) - * @param \SplFileObject $file (optional) + * @param \SplFileObject|null $file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -662,7 +651,7 @@ function ($exception) { * * @param string $environment The environment of the file (\"draft\" or \"published\"). (required) * @param string $path The file system location of the file. (required) - * @param \SplFileObject $file (optional) + * @param \SplFileObject|null $file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -730,6 +719,7 @@ public function createRequest($environment, $path, $file = null, string $content } } + $multipart = true; $headers = $this->headerSelector->selectHeaders( ['application/json', '*/*', ], $contentType, @@ -794,7 +784,7 @@ public function createRequest($environment, $path, $file = null, string $content * * @param string $environment The environment of the file (\"draft\" or \"published\"). (required) * @param string $path The file system location of the file. (required) - * @param \SplFileObject $file file (optional) + * @param \SplFileObject|null $file file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOrUpdate'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\SourceCode\ApiException on non-2xx response or if the response body is not in the expected format @@ -814,7 +804,7 @@ public function createOrUpdate($environment, $path, $file = null, string $conten * * @param string $environment The environment of the file (\"draft\" or \"published\"). (required) * @param string $path The file system location of the file. (required) - * @param \SplFileObject $file (optional) + * @param \SplFileObject|null $file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOrUpdate'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\SourceCode\ApiException on non-2xx response or if the response body is not in the expected format @@ -847,18 +837,6 @@ public function createOrUpdateWithHttpInfo($environment, $path, $file = null, st $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -917,6 +895,19 @@ public function createOrUpdateWithHttpInfo($environment, $path, $file = null, st ]; } + if ($statusCode < 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\SourceCode\Model\AssetFileMetadata'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -975,7 +966,7 @@ public function createOrUpdateWithHttpInfo($environment, $path, $file = null, st * * @param string $environment The environment of the file (\"draft\" or \"published\"). (required) * @param string $path The file system location of the file. (required) - * @param \SplFileObject $file (optional) + * @param \SplFileObject|null $file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOrUpdate'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -998,7 +989,7 @@ function ($response) { * * @param string $environment The environment of the file (\"draft\" or \"published\"). (required) * @param string $path The file system location of the file. (required) - * @param \SplFileObject $file (optional) + * @param \SplFileObject|null $file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOrUpdate'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1050,7 +1041,7 @@ function ($exception) { * * @param string $environment The environment of the file (\"draft\" or \"published\"). (required) * @param string $path The file system location of the file. (required) - * @param \SplFileObject $file (optional) + * @param \SplFileObject|null $file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOrUpdate'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1117,6 +1108,7 @@ public function createOrUpdateRequest($environment, $path, $file = null, string } } + $multipart = true; $headers = $this->headerSelector->selectHeaders( ['application/json', '*/*', ], $contentType, @@ -1232,18 +1224,6 @@ public function downloadWithHttpInfo($environment, $path, 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) { default: @@ -1275,6 +1255,19 @@ public function downloadWithHttpInfo($environment, $path, 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\SourceCode\Model\Error'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer diff --git a/codegen/Cms/SourceCode/Api/ExtractApi.php b/codegen/Cms/SourceCode/Api/ExtractApi.php index 989b8d473..496a0a71b 100644 --- a/codegen/Cms/SourceCode/Api/ExtractApi.php +++ b/codegen/Cms/SourceCode/Api/ExtractApi.php @@ -10,13 +10,13 @@ */ /** - * CMS Source Code + * Source Code * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -86,13 +86,13 @@ class ExtractApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); $this->headerSelector = $selector ?: new HeaderSelector(); $this->hostIndex = $hostIndex; } @@ -181,18 +181,6 @@ public function doAsyncWithHttpInfo($file_extract_request, string $contentType = $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 202: @@ -251,6 +239,19 @@ public function doAsyncWithHttpInfo($file_extract_request, string $contentType = ]; } + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + $returnType = '\HubSpot\Client\Cms\SourceCode\Model\TaskLocator'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -526,18 +527,6 @@ public function getAsyncStatusWithHttpInfo($task_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: @@ -596,6 +585,19 @@ public function getAsyncStatusWithHttpInfo($task_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\SourceCode\Model\ActionResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer diff --git a/codegen/Cms/SourceCode/Api/MetadataApi.php b/codegen/Cms/SourceCode/Api/MetadataApi.php index 335733fbb..58e2a2b25 100644 --- a/codegen/Cms/SourceCode/Api/MetadataApi.php +++ b/codegen/Cms/SourceCode/Api/MetadataApi.php @@ -10,13 +10,13 @@ */ /** - * CMS Source Code + * Source Code * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -83,13 +83,13 @@ class MetadataApi * @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; } @@ -129,7 +129,7 @@ public function getConfig() * * @param string $environment The environment of the file (\"draft\" or \"published\"). (required) * @param string $path The file system location of the file. (required) - * @param string $properties properties (optional) + * @param string|null $properties properties (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['get'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\SourceCode\ApiException on non-2xx response or if the response body is not in the expected format @@ -149,7 +149,7 @@ public function get($environment, $path, $properties = null, string $contentType * * @param string $environment The environment of the file (\"draft\" or \"published\"). (required) * @param string $path The file system location of the file. (required) - * @param string $properties (optional) + * @param string|null $properties (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['get'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\SourceCode\ApiException on non-2xx response or if the response body is not in the expected format @@ -182,18 +182,6 @@ public function getWithHttpInfo($environment, $path, $properties = 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: @@ -252,6 +240,19 @@ public function getWithHttpInfo($environment, $path, $properties = 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\SourceCode\Model\AssetFileMetadata'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -310,7 +311,7 @@ public function getWithHttpInfo($environment, $path, $properties = null, string * * @param string $environment The environment of the file (\"draft\" or \"published\"). (required) * @param string $path The file system location of the file. (required) - * @param string $properties (optional) + * @param string|null $properties (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['get'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -333,7 +334,7 @@ function ($response) { * * @param string $environment The environment of the file (\"draft\" or \"published\"). (required) * @param string $path The file system location of the file. (required) - * @param string $properties (optional) + * @param string|null $properties (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['get'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -385,7 +386,7 @@ function ($exception) { * * @param string $environment The environment of the file (\"draft\" or \"published\"). (required) * @param string $path The file system location of the file. (required) - * @param string $properties (optional) + * @param string|null $properties (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['get'] to see the possible values for this operation * * @throws \InvalidArgumentException diff --git a/codegen/Cms/SourceCode/Api/ValidationApi.php b/codegen/Cms/SourceCode/Api/ValidationApi.php index 17cf03e81..20a313e8d 100644 --- a/codegen/Cms/SourceCode/Api/ValidationApi.php +++ b/codegen/Cms/SourceCode/Api/ValidationApi.php @@ -10,13 +10,13 @@ */ /** - * CMS Source Code + * Source Code * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -83,13 +83,13 @@ class ValidationApi * @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; } @@ -128,7 +128,7 @@ public function getConfig() * Validate the contents of a file * * @param string $path The file system location of the file. (required) - * @param \SplFileObject $file file (optional) + * @param \SplFileObject|null $file file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['doValidate'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\SourceCode\ApiException on non-2xx response or if the response body is not in the expected format @@ -147,7 +147,7 @@ public function doValidate($path, $file = null, string $contentType = self::cont * Validate the contents of a file * * @param string $path The file system location of the file. (required) - * @param \SplFileObject $file (optional) + * @param \SplFileObject|null $file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['doValidate'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\SourceCode\ApiException on non-2xx response or if the response body is not in the expected format @@ -180,18 +180,6 @@ public function doValidateWithHttpInfo($path, $file = null, string $contentType $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { default: @@ -223,6 +211,19 @@ public function doValidateWithHttpInfo($path, $file = null, 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\SourceCode\Model\Error'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -272,7 +273,7 @@ public function doValidateWithHttpInfo($path, $file = null, string $contentType * Validate the contents of a file * * @param string $path The file system location of the file. (required) - * @param \SplFileObject $file (optional) + * @param \SplFileObject|null $file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['doValidate'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -294,7 +295,7 @@ function ($response) { * Validate the contents of a file * * @param string $path The file system location of the file. (required) - * @param \SplFileObject $file (optional) + * @param \SplFileObject|null $file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['doValidate'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -345,7 +346,7 @@ function ($exception) { * Create request for operation 'doValidate' * * @param string $path The file system location of the file. (required) - * @param \SplFileObject $file (optional) + * @param \SplFileObject|null $file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['doValidate'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -397,6 +398,7 @@ public function doValidateRequest($path, $file = null, string $contentType = sel } } + $multipart = true; $headers = $this->headerSelector->selectHeaders( ['*/*', ], $contentType, diff --git a/codegen/Cms/SourceCode/ApiException.php b/codegen/Cms/SourceCode/ApiException.php index 741a3e941..2ef6e4e65 100644 --- a/codegen/Cms/SourceCode/ApiException.php +++ b/codegen/Cms/SourceCode/ApiException.php @@ -10,13 +10,13 @@ */ /** - * CMS Source Code + * Source Code * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * 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/SourceCode/Configuration.php b/codegen/Cms/SourceCode/Configuration.php index b16acaf76..644e899e2 100644 --- a/codegen/Cms/SourceCode/Configuration.php +++ b/codegen/Cms/SourceCode/Configuration.php @@ -10,13 +10,13 @@ */ /** - * CMS Source Code + * Source Code * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * 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/SourceCode/HeaderSelector.php b/codegen/Cms/SourceCode/HeaderSelector.php index b6f9ad0e5..89cd7039e 100644 --- a/codegen/Cms/SourceCode/HeaderSelector.php +++ b/codegen/Cms/SourceCode/HeaderSelector.php @@ -10,13 +10,13 @@ */ /** - * CMS Source Code + * Source Code * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * 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/SourceCode/Model/ActionResponse.php b/codegen/Cms/SourceCode/Model/ActionResponse.php index f7e545d0a..d19b5ce14 100644 --- a/codegen/Cms/SourceCode/Model/ActionResponse.php +++ b/codegen/Cms/SourceCode/Model/ActionResponse.php @@ -11,13 +11,13 @@ */ /** - * CMS Source Code + * Source Code * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * 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 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/SourceCode/Model/AssetFileMetadata.php b/codegen/Cms/SourceCode/Model/AssetFileMetadata.php index a0a21309e..94a38e17b 100644 --- a/codegen/Cms/SourceCode/Model/AssetFileMetadata.php +++ b/codegen/Cms/SourceCode/Model/AssetFileMetadata.php @@ -11,13 +11,13 @@ */ /** - * CMS Source Code + * Source Code * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -281,10 +281,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('archived_at', $data ?? [], null); diff --git a/codegen/Cms/SourceCode/Model/Error.php b/codegen/Cms/SourceCode/Model/Error.php index a672e098e..c30dafd17 100644 --- a/codegen/Cms/SourceCode/Model/Error.php +++ b/codegen/Cms/SourceCode/Model/Error.php @@ -11,13 +11,13 @@ */ /** - * CMS Source Code + * Source Code * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * 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/SourceCode/Model/ErrorDetail.php b/codegen/Cms/SourceCode/Model/ErrorDetail.php index e81a1b956..9d706d064 100644 --- a/codegen/Cms/SourceCode/Model/ErrorDetail.php +++ b/codegen/Cms/SourceCode/Model/ErrorDetail.php @@ -11,13 +11,13 @@ */ /** - * CMS Source Code + * Source Code * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * 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/SourceCode/Model/FileExtractRequest.php b/codegen/Cms/SourceCode/Model/FileExtractRequest.php index e227bbf81..eca7b6730 100644 --- a/codegen/Cms/SourceCode/Model/FileExtractRequest.php +++ b/codegen/Cms/SourceCode/Model/FileExtractRequest.php @@ -11,13 +11,13 @@ */ /** - * CMS Source Code + * Source Code * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * 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('path', $data ?? [], null); } diff --git a/codegen/Cms/SourceCode/Model/ModelInterface.php b/codegen/Cms/SourceCode/Model/ModelInterface.php index ba0cd4229..66e15c5df 100644 --- a/codegen/Cms/SourceCode/Model/ModelInterface.php +++ b/codegen/Cms/SourceCode/Model/ModelInterface.php @@ -11,13 +11,13 @@ */ /** - * CMS Source Code + * Source Code * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * 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/SourceCode/Model/TaskLocator.php b/codegen/Cms/SourceCode/Model/TaskLocator.php index af9941250..c903746ed 100644 --- a/codegen/Cms/SourceCode/Model/TaskLocator.php +++ b/codegen/Cms/SourceCode/Model/TaskLocator.php @@ -11,13 +11,13 @@ */ /** - * CMS Source Code + * Source Code * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('links', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); diff --git a/codegen/Cms/SourceCode/ObjectSerializer.php b/codegen/Cms/SourceCode/ObjectSerializer.php index 9173ac6a6..66ab500f8 100644 --- a/codegen/Cms/SourceCode/ObjectSerializer.php +++ b/codegen/Cms/SourceCode/ObjectSerializer.php @@ -11,13 +11,13 @@ */ /** - * CMS Source Code + * Source Code * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * 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/UrlRedirects/Api/RedirectsApi.php b/codegen/Cms/UrlRedirects/Api/RedirectsApi.php index d60ee7a8a..7d3f1f93e 100644 --- a/codegen/Cms/UrlRedirects/Api/RedirectsApi.php +++ b/codegen/Cms/UrlRedirects/Api/RedirectsApi.php @@ -10,13 +10,13 @@ */ /** - * CMS Url Redirects + * Url Redirects * * URL redirect operations * * 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 RedirectsApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); $this->headerSelector = $selector ?: new HeaderSelector(); $this->hostIndex = $hostIndex; } @@ -189,18 +189,6 @@ public function archiveWithHttpInfo($url_redirect_id, string $contentType = self $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } return [null, $statusCode, $response->getHeaders()]; @@ -431,18 +419,6 @@ public function createWithHttpInfo($url_mapping_create_request_body, 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 201: @@ -501,6 +477,19 @@ public function createWithHttpInfo($url_mapping_create_request_body, 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\UrlRedirects\Model\UrlMapping'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -776,18 +765,6 @@ public function getByIdWithHttpInfo($url_redirect_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: @@ -846,6 +823,19 @@ public function getByIdWithHttpInfo($url_redirect_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\UrlRedirects\Model\UrlMapping'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1071,16 +1061,16 @@ public function getByIdRequest($url_redirect_id, string $contentType = self::con * * Get current redirects * - * @param \DateTime $created_at Only return redirects created on exactly this date. (optional) - * @param \DateTime $created_after Only return redirects created after this date. (optional) - * @param \DateTime $created_before Only return redirects created before this date. (optional) - * @param \DateTime $updated_at Only return redirects last updated on exactly this date. (optional) - * @param \DateTime $updated_after Only return redirects last updated after this date. (optional) - * @param \DateTime $updated_before Only return redirects last updated before this date. (optional) - * @param string[] $sort sort (optional) - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit Maximum number of result per page (optional) - * @param bool $archived Whether to return only results that have been archived. (optional) + * @param \DateTime|null $created_at Only return redirects created on exactly this date. (optional) + * @param \DateTime|null $created_after Only return redirects created after this date. (optional) + * @param \DateTime|null $created_before Only return redirects created before this date. (optional) + * @param \DateTime|null $updated_at Only return redirects last updated on exactly this date. (optional) + * @param \DateTime|null $updated_after Only return redirects last updated after this date. (optional) + * @param \DateTime|null $updated_before Only return redirects last updated before this date. (optional) + * @param string[]|null $sort sort (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit Maximum number of result per page (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['getPage'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\UrlRedirects\ApiException on non-2xx response or if the response body is not in the expected format @@ -1098,16 +1088,16 @@ public function getPage($created_at = null, $created_after = null, $created_befo * * Get current redirects * - * @param \DateTime $created_at Only return redirects created on exactly this date. (optional) - * @param \DateTime $created_after Only return redirects created after this date. (optional) - * @param \DateTime $created_before Only return redirects created before this date. (optional) - * @param \DateTime $updated_at Only return redirects last updated on exactly this date. (optional) - * @param \DateTime $updated_after Only return redirects last updated after this date. (optional) - * @param \DateTime $updated_before Only return redirects last updated before this date. (optional) - * @param string[] $sort (optional) - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit Maximum number of result per page (optional) - * @param bool $archived Whether to return only results that have been archived. (optional) + * @param \DateTime|null $created_at Only return redirects created on exactly this date. (optional) + * @param \DateTime|null $created_after Only return redirects created after this date. (optional) + * @param \DateTime|null $created_before Only return redirects created before this date. (optional) + * @param \DateTime|null $updated_at Only return redirects last updated on exactly this date. (optional) + * @param \DateTime|null $updated_after Only return redirects last updated after this date. (optional) + * @param \DateTime|null $updated_before Only return redirects last updated before this date. (optional) + * @param string[]|null $sort (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit Maximum number of result per page (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['getPage'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\UrlRedirects\ApiException on non-2xx response or if the response body is not in the expected format @@ -1140,18 +1130,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: @@ -1210,6 +1188,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\UrlRedirects\Model\CollectionResponseWithTotalUrlMappingForwardPaging'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1266,16 +1257,16 @@ public function getPageWithHttpInfo($created_at = null, $created_after = null, $ * * Get current redirects * - * @param \DateTime $created_at Only return redirects created on exactly this date. (optional) - * @param \DateTime $created_after Only return redirects created after this date. (optional) - * @param \DateTime $created_before Only return redirects created before this date. (optional) - * @param \DateTime $updated_at Only return redirects last updated on exactly this date. (optional) - * @param \DateTime $updated_after Only return redirects last updated after this date. (optional) - * @param \DateTime $updated_before Only return redirects last updated before this date. (optional) - * @param string[] $sort (optional) - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit Maximum number of result per page (optional) - * @param bool $archived Whether to return only results that have been archived. (optional) + * @param \DateTime|null $created_at Only return redirects created on exactly this date. (optional) + * @param \DateTime|null $created_after Only return redirects created after this date. (optional) + * @param \DateTime|null $created_before Only return redirects created before this date. (optional) + * @param \DateTime|null $updated_at Only return redirects last updated on exactly this date. (optional) + * @param \DateTime|null $updated_after Only return redirects last updated after this date. (optional) + * @param \DateTime|null $updated_before Only return redirects last updated before this date. (optional) + * @param string[]|null $sort (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit Maximum number of result per page (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['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1296,16 +1287,16 @@ function ($response) { * * Get current redirects * - * @param \DateTime $created_at Only return redirects created on exactly this date. (optional) - * @param \DateTime $created_after Only return redirects created after this date. (optional) - * @param \DateTime $created_before Only return redirects created before this date. (optional) - * @param \DateTime $updated_at Only return redirects last updated on exactly this date. (optional) - * @param \DateTime $updated_after Only return redirects last updated after this date. (optional) - * @param \DateTime $updated_before Only return redirects last updated before this date. (optional) - * @param string[] $sort (optional) - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit Maximum number of result per page (optional) - * @param bool $archived Whether to return only results that have been archived. (optional) + * @param \DateTime|null $created_at Only return redirects created on exactly this date. (optional) + * @param \DateTime|null $created_after Only return redirects created after this date. (optional) + * @param \DateTime|null $created_before Only return redirects created before this date. (optional) + * @param \DateTime|null $updated_at Only return redirects last updated on exactly this date. (optional) + * @param \DateTime|null $updated_after Only return redirects last updated after this date. (optional) + * @param \DateTime|null $updated_before Only return redirects last updated before this date. (optional) + * @param string[]|null $sort (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit Maximum number of result per page (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['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1355,16 +1346,16 @@ function ($exception) { /** * Create request for operation 'getPage' * - * @param \DateTime $created_at Only return redirects created on exactly this date. (optional) - * @param \DateTime $created_after Only return redirects created after this date. (optional) - * @param \DateTime $created_before Only return redirects created before this date. (optional) - * @param \DateTime $updated_at Only return redirects last updated on exactly this date. (optional) - * @param \DateTime $updated_after Only return redirects last updated after this date. (optional) - * @param \DateTime $updated_before Only return redirects last updated before this date. (optional) - * @param string[] $sort (optional) - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit Maximum number of result per page (optional) - * @param bool $archived Whether to return only results that have been archived. (optional) + * @param \DateTime|null $created_at Only return redirects created on exactly this date. (optional) + * @param \DateTime|null $created_after Only return redirects created after this date. (optional) + * @param \DateTime|null $created_before Only return redirects created before this date. (optional) + * @param \DateTime|null $updated_at Only return redirects last updated on exactly this date. (optional) + * @param \DateTime|null $updated_after Only return redirects last updated after this date. (optional) + * @param \DateTime|null $updated_before Only return redirects last updated before this date. (optional) + * @param string[]|null $sort (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit Maximum number of result per page (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['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1600,18 +1591,6 @@ public function updateWithHttpInfo($url_redirect_id, $url_mapping, string $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 200: @@ -1670,6 +1649,19 @@ public function updateWithHttpInfo($url_redirect_id, $url_mapping, string $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\UrlRedirects\Model\UrlMapping'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer diff --git a/codegen/Cms/UrlRedirects/ApiException.php b/codegen/Cms/UrlRedirects/ApiException.php index 5d2299fdc..0597ecf3e 100644 --- a/codegen/Cms/UrlRedirects/ApiException.php +++ b/codegen/Cms/UrlRedirects/ApiException.php @@ -10,13 +10,13 @@ */ /** - * CMS Url Redirects + * Url Redirects * * URL redirect operations * * 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/UrlRedirects/Configuration.php b/codegen/Cms/UrlRedirects/Configuration.php index dda854482..3ac42677d 100644 --- a/codegen/Cms/UrlRedirects/Configuration.php +++ b/codegen/Cms/UrlRedirects/Configuration.php @@ -10,13 +10,13 @@ */ /** - * CMS Url Redirects + * Url Redirects * * URL redirect operations * * 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/UrlRedirects/HeaderSelector.php b/codegen/Cms/UrlRedirects/HeaderSelector.php index 5762a9557..875088de4 100644 --- a/codegen/Cms/UrlRedirects/HeaderSelector.php +++ b/codegen/Cms/UrlRedirects/HeaderSelector.php @@ -10,13 +10,13 @@ */ /** - * CMS Url Redirects + * Url Redirects * * URL redirect operations * * 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/UrlRedirects/Model/CollectionResponseWithTotalUrlMappingForwardPaging.php b/codegen/Cms/UrlRedirects/Model/CollectionResponseWithTotalUrlMappingForwardPaging.php index 7fdfa15d0..c8ddf0c1f 100644 --- a/codegen/Cms/UrlRedirects/Model/CollectionResponseWithTotalUrlMappingForwardPaging.php +++ b/codegen/Cms/UrlRedirects/Model/CollectionResponseWithTotalUrlMappingForwardPaging.php @@ -11,13 +11,13 @@ */ /** - * CMS Url Redirects + * Url Redirects * * URL redirect operations * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -251,10 +251,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('total', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); diff --git a/codegen/Cms/UrlRedirects/Model/Error.php b/codegen/Cms/UrlRedirects/Model/Error.php index 5dba9267e..59cce5a1c 100644 --- a/codegen/Cms/UrlRedirects/Model/Error.php +++ b/codegen/Cms/UrlRedirects/Model/Error.php @@ -11,13 +11,13 @@ */ /** - * CMS Url Redirects + * Url Redirects * * URL redirect operations * * 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/UrlRedirects/Model/ErrorDetail.php b/codegen/Cms/UrlRedirects/Model/ErrorDetail.php index fdb97fa12..b4f18fbbc 100644 --- a/codegen/Cms/UrlRedirects/Model/ErrorDetail.php +++ b/codegen/Cms/UrlRedirects/Model/ErrorDetail.php @@ -11,13 +11,13 @@ */ /** - * CMS Url Redirects + * Url Redirects * * URL redirect operations * * 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/UrlRedirects/Model/ForwardPaging.php b/codegen/Cms/UrlRedirects/Model/ForwardPaging.php index bdd649279..53d173f47 100644 --- a/codegen/Cms/UrlRedirects/Model/ForwardPaging.php +++ b/codegen/Cms/UrlRedirects/Model/ForwardPaging.php @@ -11,13 +11,13 @@ */ /** - * CMS Url Redirects + * Url Redirects * * URL redirect operations * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('next', $data ?? [], null); } diff --git a/codegen/Cms/UrlRedirects/Model/ModelInterface.php b/codegen/Cms/UrlRedirects/Model/ModelInterface.php index f8cfe73c7..4bdc0f458 100644 --- a/codegen/Cms/UrlRedirects/Model/ModelInterface.php +++ b/codegen/Cms/UrlRedirects/Model/ModelInterface.php @@ -11,13 +11,13 @@ */ /** - * CMS Url Redirects + * Url Redirects * * URL redirect operations * * 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/UrlRedirects/Model/NextPage.php b/codegen/Cms/UrlRedirects/Model/NextPage.php index 9104737e9..09366c85e 100644 --- a/codegen/Cms/UrlRedirects/Model/NextPage.php +++ b/codegen/Cms/UrlRedirects/Model/NextPage.php @@ -11,13 +11,13 @@ */ /** - * CMS Url Redirects + * Url Redirects * * URL redirect operations * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('link', $data ?? [], null); $this->setIfExists('after', $data ?? [], null); diff --git a/codegen/Cms/UrlRedirects/Model/UrlMapping.php b/codegen/Cms/UrlRedirects/Model/UrlMapping.php index 4a7ffc56a..88ca7095d 100644 --- a/codegen/Cms/UrlRedirects/Model/UrlMapping.php +++ b/codegen/Cms/UrlRedirects/Model/UrlMapping.php @@ -11,13 +11,13 @@ */ /** - * CMS Url Redirects + * Url Redirects * * URL redirect operations * * 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('is_trailing_slash_optional', $data ?? [], null); $this->setIfExists('redirect_style', $data ?? [], null); diff --git a/codegen/Cms/UrlRedirects/Model/UrlMappingCreateRequestBody.php b/codegen/Cms/UrlRedirects/Model/UrlMappingCreateRequestBody.php index 971ac202d..d8e4a8da4 100644 --- a/codegen/Cms/UrlRedirects/Model/UrlMappingCreateRequestBody.php +++ b/codegen/Cms/UrlRedirects/Model/UrlMappingCreateRequestBody.php @@ -11,13 +11,13 @@ */ /** - * CMS Url Redirects + * Url Redirects * * URL redirect operations * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -293,10 +293,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('is_trailing_slash_optional', $data ?? [], null); $this->setIfExists('is_match_query_string', $data ?? [], null); diff --git a/codegen/Cms/UrlRedirects/ObjectSerializer.php b/codegen/Cms/UrlRedirects/ObjectSerializer.php index efa761bd4..f419acab1 100644 --- a/codegen/Cms/UrlRedirects/ObjectSerializer.php +++ b/codegen/Cms/UrlRedirects/ObjectSerializer.php @@ -11,13 +11,13 @@ */ /** - * CMS Url Redirects + * Url Redirects * * URL redirect operations * * 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) : ''; } }