From 26e5d90f03c1c2e77b33a71ce07657ae0489608a Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Mon, 10 Nov 2025 12:41:43 +0300 Subject: [PATCH] Codegen: CRM Extensions Cards and Video Conferencing --- codegen/Crm/Extensions/Cards/Api/CardsApi.php | 475 ++++++------------ .../Cards/Api/SampleResponseApi.php | 161 +++--- codegen/Crm/Extensions/Cards/ApiException.php | 4 +- .../Crm/Extensions/Cards/Configuration.php | 63 ++- .../Extensions/Cards/FormDataProcessor.php | 246 +++++++++ .../Crm/Extensions/Cards/HeaderSelector.php | 4 +- .../Cards/Model/ActionConfirmationBody.php | 16 +- .../Cards/Model/ActionHookActionBody.php | 16 +- .../Extensions/Cards/Model/CardActions.php | 16 +- .../Cards/Model/CardAuditResponse.php | 16 +- .../Cards/Model/CardCreateRequest.php | 16 +- .../Cards/Model/CardDisplayBody.php | 16 +- .../Cards/Model/CardDisplayProperty.php | 16 +- .../Extensions/Cards/Model/CardFetchBody.php | 16 +- .../Cards/Model/CardFetchBodyPatch.php | 16 +- .../Cards/Model/CardObjectTypeBody.php | 16 +- .../Cards/Model/CardPatchRequest.php | 16 +- .../Extensions/Cards/Model/DisplayOption.php | 16 +- codegen/Crm/Extensions/Cards/Model/Error.php | 16 +- .../Extensions/Cards/Model/ErrorDetail.php | 16 +- .../Cards/Model/IFrameActionBody.php | 16 +- .../Model/IntegratorCardPayloadResponse.php | 16 +- .../Cards/Model/IntegratorObjectResult.php | 16 +- .../IntegratorObjectResultActionsInner.php | 21 +- .../Extensions/Cards/Model/ModelInterface.php | 4 +- .../Extensions/Cards/Model/ObjectToken.php | 16 +- .../Cards/Model/PublicCardFetchBody.php | 16 +- .../Cards/Model/PublicCardListResponse.php | 16 +- .../Cards/Model/PublicCardResponse.php | 16 +- .../Cards/Model/TopLevelActions.php | 16 +- .../Crm/Extensions/Cards/ObjectSerializer.php | 24 +- .../Videoconferencing/Api/SettingsApi.php | 323 +++++------- .../Videoconferencing/ApiException.php | 4 +- .../Videoconferencing/Configuration.php | 63 ++- .../Videoconferencing/FormDataProcessor.php | 246 +++++++++ .../Videoconferencing/HeaderSelector.php | 4 +- .../Videoconferencing/Model/Error.php | 16 +- .../Videoconferencing/Model/ErrorDetail.php | 16 +- .../Model/ExternalSettings.php | 16 +- .../Model/ModelInterface.php | 4 +- .../Videoconferencing/ObjectSerializer.php | 24 +- 41 files changed, 1178 insertions(+), 892 deletions(-) create mode 100644 codegen/Crm/Extensions/Cards/FormDataProcessor.php create mode 100644 codegen/Crm/Extensions/Videoconferencing/FormDataProcessor.php diff --git a/codegen/Crm/Extensions/Cards/Api/CardsApi.php b/codegen/Crm/Extensions/Cards/Api/CardsApi.php index fcbfe4b2..87045254 100644 --- a/codegen/Crm/Extensions/Cards/Api/CardsApi.php +++ b/codegen/Crm/Extensions/Cards/Api/CardsApi.php @@ -1,7 +1,7 @@ getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -203,8 +205,10 @@ public function archiveWithHttpInfo($card_id, $app_id, string $contentType = sel $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -445,61 +449,21 @@ public function createWithHttpInfo($app_id, $card_create_request, string $conten switch($statusCode) { case 201: - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\Error' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Extensions\Cards\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Cards\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -513,34 +477,11 @@ public function createWithHttpInfo($app_id, $card_create_request, string $conten ); } - $returnType = '\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 201: @@ -550,7 +491,7 @@ public function createWithHttpInfo($app_id, $card_create_request, string $conten $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -558,8 +499,10 @@ public function createWithHttpInfo($app_id, $card_create_request, string $conten $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -810,61 +753,21 @@ public function getAllWithHttpInfo($app_id, string $contentType = self::contentT switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardListResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardListResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardListResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardListResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\Error' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Extensions\Cards\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Cards\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -878,34 +781,11 @@ public function getAllWithHttpInfo($app_id, string $contentType = self::contentT ); } - $returnType = '\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardListResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardListResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -915,7 +795,7 @@ public function getAllWithHttpInfo($app_id, string $contentType = self::contentT $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -923,8 +803,10 @@ public function getAllWithHttpInfo($app_id, string $contentType = self::contentT $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1160,61 +1042,21 @@ public function getByIdWithHttpInfo($card_id, $app_id, string $contentType = sel switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\Error' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Extensions\Cards\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Cards\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1228,34 +1070,11 @@ public function getByIdWithHttpInfo($card_id, $app_id, string $contentType = sel ); } - $returnType = '\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1265,7 +1084,7 @@ public function getByIdWithHttpInfo($card_id, $app_id, string $contentType = sel $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1273,8 +1092,10 @@ public function getByIdWithHttpInfo($card_id, $app_id, string $contentType = sel $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1530,61 +1351,21 @@ public function updateWithHttpInfo($card_id, $app_id, $card_patch_request, strin switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\Error' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Extensions\Cards\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Cards\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1598,34 +1379,11 @@ public function updateWithHttpInfo($card_id, $app_id, $card_patch_request, strin ); } - $returnType = '\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Cards\Model\PublicCardResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1635,7 +1393,7 @@ public function updateWithHttpInfo($card_id, $app_id, $card_patch_request, strin $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1643,8 +1401,10 @@ public function updateWithHttpInfo($card_id, $app_id, $card_patch_request, strin $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1870,6 +1630,57 @@ protected function createHttpClientOption() } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/codegen/Crm/Extensions/Cards/Api/SampleResponseApi.php b/codegen/Crm/Extensions/Cards/Api/SampleResponseApi.php index a6f9d61a..dfc25088 100644 --- a/codegen/Crm/Extensions/Cards/Api/SampleResponseApi.php +++ b/codegen/Crm/Extensions/Cards/Api/SampleResponseApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\IntegratorCardPayloadResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Extensions\Cards\Model\IntegratorCardPayloadResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Cards\Model\IntegratorCardPayloadResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Extensions\Cards\Model\Error' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Extensions\Cards\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Cards\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -247,34 +210,11 @@ public function getCardsSampleResponseWithHttpInfo(string $contentType = self::c ); } - $returnType = '\HubSpot\Client\Crm\Extensions\Cards\Model\IntegratorCardPayloadResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Cards\Model\IntegratorCardPayloadResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -284,7 +224,7 @@ public function getCardsSampleResponseWithHttpInfo(string $contentType = self::c $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -292,8 +232,10 @@ public function getCardsSampleResponseWithHttpInfo(string $contentType = self::c $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -461,6 +403,57 @@ protected function createHttpClientOption() } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/codegen/Crm/Extensions/Cards/ApiException.php b/codegen/Crm/Extensions/Cards/ApiException.php index abd45abf..9f15087a 100644 --- a/codegen/Crm/Extensions/Cards/ApiException.php +++ b/codegen/Crm/Extensions/Cards/ApiException.php @@ -1,7 +1,7 @@ tempFolderPath; } + /** + * Sets the certificate file path, for mTLS + * + * @return $this + */ + public function setCertFile($certFile) + { + $this->certFile = $certFile; + return $this; + } + + /** + * Gets the certificate file path, for mTLS + * + * @return string Certificate file path + */ + public function getCertFile() + { + return $this->certFile; + } + + /** + * Sets the certificate key path, for mTLS + * + * @return $this + */ + public function setKeyFile($keyFile) + { + $this->keyFile = $keyFile; + return $this; + } + + /** + * Gets the certificate key path, for mTLS + * + * @return string Certificate key path + */ + public function getKeyFile() + { + return $this->keyFile; + } + + /** * Gets the default configuration instance * diff --git a/codegen/Crm/Extensions/Cards/FormDataProcessor.php b/codegen/Crm/Extensions/Cards/FormDataProcessor.php new file mode 100644 index 00000000..cbd2426e --- /dev/null +++ b/codegen/Crm/Extensions/Cards/FormDataProcessor.php @@ -0,0 +1,246 @@ + $values the value of the form parameter + * + * @return array [key => value] of formdata + */ + public function prepare(array $values): array + { + $this->has_file = false; + $result = []; + + foreach ($values as $k => $v) { + if ($v === null) { + continue; + } + + $result[$k] = $this->makeFormSafe($v); + } + + return $result; + } + + /** + * Flattens a multi-level array of data and generates a single-level array + * compatible with formdata - a single-level array where the keys use bracket + * notation to signify nested data. + * + * credit: https://github.com/FranBar1966/FlatPHP + */ + public static function flatten(array $source, string $start = ''): array + { + $opt = [ + 'prefix' => '[', + 'suffix' => ']', + 'suffix-end' => true, + 'prefix-list' => '[', + 'suffix-list' => ']', + 'suffix-list-end' => true, + ]; + + if ($start === '') { + $currentPrefix = ''; + $currentSuffix = ''; + $currentSuffixEnd = false; + } elseif (array_is_list($source)) { + $currentPrefix = $opt['prefix-list']; + $currentSuffix = $opt['suffix-list']; + $currentSuffixEnd = $opt['suffix-list-end']; + } else { + $currentPrefix = $opt['prefix']; + $currentSuffix = $opt['suffix']; + $currentSuffixEnd = $opt['suffix-end']; + } + + $currentName = $start; + $result = []; + + foreach ($source as $key => $val) { + $currentName .= $currentPrefix.$key; + + if (is_array($val) && !empty($val)) { + $currentName .= $currentSuffix; + $result += self::flatten($val, $currentName); + } else { + if ($currentSuffixEnd) { + $currentName .= $currentSuffix; + } + + if (is_resource($val)) { + $result[$currentName] = $val; + } else { + $result[$currentName] = ObjectSerializer::toString($val); + } + } + + $currentName = $start; + } + + return $result; + } + + /** + * formdata must be limited to scalars or arrays of scalar values, + * or a resource for a file upload. Here we iterate through all available + * data and identify how to handle each scenario + */ + protected function makeFormSafe($value) + { + if ($value instanceof SplFileObject) { + return $this->processFiles([$value])[0]; + } + + if (is_resource($value)) { + $this->has_file = true; + + return $value; + } + + if ($value instanceof ModelInterface) { + return $this->processModel($value); + } + + if (is_array($value) || (is_object($value) && !$value instanceof \DateTimeInterface)) { + $data = []; + + foreach ($value as $k => $v) { + $data[$k] = $this->makeFormSafe($v); + } + + return $data; + } + + return ObjectSerializer::toString($value); + } + + /** + * We are able to handle nested ModelInterface. We do not simply call + * json_decode(json_encode()) because any given model may have binary data + * or other data that cannot be serialized to a JSON string + */ + protected function processModel(ModelInterface $model): array + { + $result = []; + + foreach ($model::openAPITypes() as $name => $type) { + $value = $model->offsetGet($name); + + if ($value === null) { + continue; + } + + if (strpos($type, '\SplFileObject') !== false) { + $file = is_array($value) ? $value : [$value]; + $result[$name] = $this->processFiles($file); + + continue; + } + + if ($value instanceof ModelInterface) { + $result[$name] = $this->processModel($value); + + continue; + } + + if (is_array($value) || is_object($value)) { + $result[$name] = $this->makeFormSafe($value); + + continue; + } + + $result[$name] = ObjectSerializer::toString($value); + } + + return $result; + } + + /** + * Handle file data + */ + protected function processFiles(array $files): array + { + $this->has_file = true; + + $result = []; + + foreach ($files as $i => $file) { + if (is_array($file)) { + $result[$i] = $this->processFiles($file); + + continue; + } + + if ($file instanceof StreamInterface) { + $result[$i] = $file; + + continue; + } + + if ($file instanceof SplFileObject) { + $result[$i] = $this->tryFopen($file); + } + } + + return $result; + } + + private function tryFopen(SplFileObject $file) + { + return Utils::tryFopen($file->getRealPath(), 'rb'); + } +} diff --git a/codegen/Crm/Extensions/Cards/HeaderSelector.php b/codegen/Crm/Extensions/Cards/HeaderSelector.php index f64007c6..e221c3d7 100644 --- a/codegen/Crm/Extensions/Cards/HeaderSelector.php +++ b/codegen/Crm/Extensions/Cards/HeaderSelector.php @@ -1,7 +1,7 @@ container[$offset]); } @@ -407,12 +407,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -437,11 +437,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/ActionHookActionBody.php b/codegen/Crm/Extensions/Cards/Model/ActionHookActionBody.php index 1a70056f..066a0e24 100644 --- a/codegen/Crm/Extensions/Cards/Model/ActionHookActionBody.php +++ b/codegen/Crm/Extensions/Cards/Model/ActionHookActionBody.php @@ -2,7 +2,7 @@ /** * ActionHookActionBody * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -580,11 +580,11 @@ public function setUrl($url) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -592,12 +592,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -622,11 +622,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/CardActions.php b/codegen/Crm/Extensions/Cards/Model/CardActions.php index bfca6a37..e2dc27ef 100644 --- a/codegen/Crm/Extensions/Cards/Model/CardActions.php +++ b/codegen/Crm/Extensions/Cards/Model/CardActions.php @@ -2,7 +2,7 @@ /** * CardActions * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -322,11 +322,11 @@ public function setBaseUrls($base_urls) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/CardAuditResponse.php b/codegen/Crm/Extensions/Cards/Model/CardAuditResponse.php index 78662da5..125dd6b1 100644 --- a/codegen/Crm/Extensions/Cards/Model/CardAuditResponse.php +++ b/codegen/Crm/Extensions/Cards/Model/CardAuditResponse.php @@ -2,7 +2,7 @@ /** * CardAuditResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -578,11 +578,11 @@ public function setInitiatingUserId($initiating_user_id) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -590,12 +590,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -620,11 +620,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/CardCreateRequest.php b/codegen/Crm/Extensions/Cards/Model/CardCreateRequest.php index 8c6fdbe7..47b8518c 100644 --- a/codegen/Crm/Extensions/Cards/Model/CardCreateRequest.php +++ b/codegen/Crm/Extensions/Cards/Model/CardCreateRequest.php @@ -2,7 +2,7 @@ /** * CardCreateRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -433,11 +433,11 @@ public function setActions($actions) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -445,12 +445,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -475,11 +475,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/CardDisplayBody.php b/codegen/Crm/Extensions/Cards/Model/CardDisplayBody.php index b4c13f7d..53909610 100644 --- a/codegen/Crm/Extensions/Cards/Model/CardDisplayBody.php +++ b/codegen/Crm/Extensions/Cards/Model/CardDisplayBody.php @@ -2,7 +2,7 @@ /** * CardDisplayBody * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -322,11 +322,11 @@ public function setProperties($properties) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/CardDisplayProperty.php b/codegen/Crm/Extensions/Cards/Model/CardDisplayProperty.php index aa516eb2..3501d82c 100644 --- a/codegen/Crm/Extensions/Cards/Model/CardDisplayProperty.php +++ b/codegen/Crm/Extensions/Cards/Model/CardDisplayProperty.php @@ -2,7 +2,7 @@ /** * CardDisplayProperty * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -481,11 +481,11 @@ public function setLabel($label) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -493,12 +493,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -523,11 +523,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/CardFetchBody.php b/codegen/Crm/Extensions/Cards/Model/CardFetchBody.php index 920c19ef..05e53e1b 100644 --- a/codegen/Crm/Extensions/Cards/Model/CardFetchBody.php +++ b/codegen/Crm/Extensions/Cards/Model/CardFetchBody.php @@ -2,7 +2,7 @@ /** * CardFetchBody * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -461,11 +461,11 @@ public function setTargetUrl($target_url) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -473,12 +473,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -503,11 +503,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/CardFetchBodyPatch.php b/codegen/Crm/Extensions/Cards/Model/CardFetchBodyPatch.php index 67b86aee..66ea467b 100644 --- a/codegen/Crm/Extensions/Cards/Model/CardFetchBodyPatch.php +++ b/codegen/Crm/Extensions/Cards/Model/CardFetchBodyPatch.php @@ -2,7 +2,7 @@ /** * CardFetchBodyPatch * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -458,11 +458,11 @@ public function setTargetUrl($target_url) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -470,12 +470,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -500,11 +500,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/CardObjectTypeBody.php b/codegen/Crm/Extensions/Cards/Model/CardObjectTypeBody.php index b059c8ba..0cd6a335 100644 --- a/codegen/Crm/Extensions/Cards/Model/CardObjectTypeBody.php +++ b/codegen/Crm/Extensions/Cards/Model/CardObjectTypeBody.php @@ -2,7 +2,7 @@ /** * CardObjectTypeBody * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -398,11 +398,11 @@ public function setPropertiesToSend($properties_to_send) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -410,12 +410,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -440,11 +440,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/CardPatchRequest.php b/codegen/Crm/Extensions/Cards/Model/CardPatchRequest.php index ccc847a4..524ca48d 100644 --- a/codegen/Crm/Extensions/Cards/Model/CardPatchRequest.php +++ b/codegen/Crm/Extensions/Cards/Model/CardPatchRequest.php @@ -2,7 +2,7 @@ /** * CardPatchRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -421,11 +421,11 @@ public function setActions($actions) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -433,12 +433,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -463,11 +463,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/DisplayOption.php b/codegen/Crm/Extensions/Cards/Model/DisplayOption.php index d0903bb7..aa95ddc8 100644 --- a/codegen/Crm/Extensions/Cards/Model/DisplayOption.php +++ b/codegen/Crm/Extensions/Cards/Model/DisplayOption.php @@ -2,7 +2,7 @@ /** * DisplayOption * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -436,11 +436,11 @@ public function setType($type) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -448,12 +448,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -478,11 +478,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/Error.php b/codegen/Crm/Extensions/Cards/Model/Error.php index 74af8d8b..209c8994 100644 --- a/codegen/Crm/Extensions/Cards/Model/Error.php +++ b/codegen/Crm/Extensions/Cards/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -531,11 +531,11 @@ public function setErrors($errors) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -543,12 +543,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -573,11 +573,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/ErrorDetail.php b/codegen/Crm/Extensions/Cards/Model/ErrorDetail.php index 38f4c56b..4e47e3af 100644 --- a/codegen/Crm/Extensions/Cards/Model/ErrorDetail.php +++ b/codegen/Crm/Extensions/Cards/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -457,11 +457,11 @@ public function setMessage($message) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -469,12 +469,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -499,11 +499,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/IFrameActionBody.php b/codegen/Crm/Extensions/Cards/Model/IFrameActionBody.php index 943ca7cf..90d7d570 100644 --- a/codegen/Crm/Extensions/Cards/Model/IFrameActionBody.php +++ b/codegen/Crm/Extensions/Cards/Model/IFrameActionBody.php @@ -2,7 +2,7 @@ /** * IFrameActionBody * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -535,11 +535,11 @@ public function setHeight($height) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -547,12 +547,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -577,11 +577,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/IntegratorCardPayloadResponse.php b/codegen/Crm/Extensions/Cards/Model/IntegratorCardPayloadResponse.php index c97c9982..510886d3 100644 --- a/codegen/Crm/Extensions/Cards/Model/IntegratorCardPayloadResponse.php +++ b/codegen/Crm/Extensions/Cards/Model/IntegratorCardPayloadResponse.php @@ -2,7 +2,7 @@ /** * IntegratorCardPayloadResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -526,11 +526,11 @@ public function setSections($sections) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -538,12 +538,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -568,11 +568,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/IntegratorObjectResult.php b/codegen/Crm/Extensions/Cards/Model/IntegratorObjectResult.php index 401fc7de..6cbc476d 100644 --- a/codegen/Crm/Extensions/Cards/Model/IntegratorObjectResult.php +++ b/codegen/Crm/Extensions/Cards/Model/IntegratorObjectResult.php @@ -2,7 +2,7 @@ /** * IntegratorObjectResult * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -466,11 +466,11 @@ public function setActions($actions) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -478,12 +478,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -508,11 +508,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/IntegratorObjectResultActionsInner.php b/codegen/Crm/Extensions/Cards/Model/IntegratorObjectResultActionsInner.php index 34f367e9..4aa2c805 100644 --- a/codegen/Crm/Extensions/Cards/Model/IntegratorObjectResultActionsInner.php +++ b/codegen/Crm/Extensions/Cards/Model/IntegratorObjectResultActionsInner.php @@ -2,7 +2,7 @@ /** * IntegratorObjectResultActionsInner * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -42,7 +42,7 @@ */ class IntegratorObjectResultActionsInner implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = null; + public const DISCRIMINATOR = 'type'; /** * The original name of the model. @@ -338,6 +338,9 @@ public function __construct(?array $data = null) $this->setIfExists('url', $data ?? [], null); $this->setIfExists('width', $data ?? [], null); $this->setIfExists('height', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; } /** @@ -656,11 +659,11 @@ public function setHeight($height) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -668,12 +671,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -698,11 +701,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/ModelInterface.php b/codegen/Crm/Extensions/Cards/Model/ModelInterface.php index c3ac81a1..ead3a1af 100644 --- a/codegen/Crm/Extensions/Cards/Model/ModelInterface.php +++ b/codegen/Crm/Extensions/Cards/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards\Model @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** diff --git a/codegen/Crm/Extensions/Cards/Model/ObjectToken.php b/codegen/Crm/Extensions/Cards/Model/ObjectToken.php index aa3de3a3..464b69c3 100644 --- a/codegen/Crm/Extensions/Cards/Model/ObjectToken.php +++ b/codegen/Crm/Extensions/Cards/Model/ObjectToken.php @@ -2,7 +2,7 @@ /** * ObjectToken * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -471,11 +471,11 @@ public function setValue($value) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -483,12 +483,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -513,11 +513,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/PublicCardFetchBody.php b/codegen/Crm/Extensions/Cards/Model/PublicCardFetchBody.php index f892b350..d6b18024 100644 --- a/codegen/Crm/Extensions/Cards/Model/PublicCardFetchBody.php +++ b/codegen/Crm/Extensions/Cards/Model/PublicCardFetchBody.php @@ -2,7 +2,7 @@ /** * PublicCardFetchBody * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -358,11 +358,11 @@ public function setTargetUrl($target_url) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -370,12 +370,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -400,11 +400,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/PublicCardListResponse.php b/codegen/Crm/Extensions/Cards/Model/PublicCardListResponse.php index 30257926..d51272d9 100644 --- a/codegen/Crm/Extensions/Cards/Model/PublicCardListResponse.php +++ b/codegen/Crm/Extensions/Cards/Model/PublicCardListResponse.php @@ -2,7 +2,7 @@ /** * PublicCardListResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -321,11 +321,11 @@ public function setResults($results) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -333,12 +333,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -363,11 +363,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/PublicCardResponse.php b/codegen/Crm/Extensions/Cards/Model/PublicCardResponse.php index b9cb9656..680e12c5 100644 --- a/codegen/Crm/Extensions/Cards/Model/PublicCardResponse.php +++ b/codegen/Crm/Extensions/Cards/Model/PublicCardResponse.php @@ -2,7 +2,7 @@ /** * PublicCardResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -574,11 +574,11 @@ public function setUpdatedAt($updated_at) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -586,12 +586,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -616,11 +616,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/Model/TopLevelActions.php b/codegen/Crm/Extensions/Cards/Model/TopLevelActions.php index db9da126..ded21277 100644 --- a/codegen/Crm/Extensions/Cards/Model/TopLevelActions.php +++ b/codegen/Crm/Extensions/Cards/Model/TopLevelActions.php @@ -2,7 +2,7 @@ /** * TopLevelActions * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -389,11 +389,11 @@ public function setPrimary($primary) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -401,12 +401,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -431,11 +431,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Cards/ObjectSerializer.php b/codegen/Crm/Extensions/Cards/ObjectSerializer.php index 612446c1..9d58a6d3 100644 --- a/codegen/Crm/Extensions/Cards/ObjectSerializer.php +++ b/codegen/Crm/Extensions/Cards/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Cards @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -323,24 +323,6 @@ public static function toHeaderValue($value) return self::toString($value); } - /** - * Take value and turn it into a string suitable for inclusion in - * the http body (form parameter). If it's a string, pass through unchanged - * If it's a datetime object, format it in ISO8601 - * - * @param string|\SplFileObject $value the value of the form parameter - * - * @return string the form string - */ - public static function toFormValue($value) - { - if ($value instanceof \SplFileObject) { - return $value->getRealPath(); - } else { - return self::toString($value); - } - } - /** * Take value and turn it into a string suitable for inclusion in * the parameter. If it's a string, pass through unchanged @@ -612,6 +594,6 @@ public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): } } - return $qs ? (string) substr($qs, 0, -1) : ''; + return $qs ? substr($qs, 0, -1) : ''; } } diff --git a/codegen/Crm/Extensions/Videoconferencing/Api/SettingsApi.php b/codegen/Crm/Extensions/Videoconferencing/Api/SettingsApi.php index acd477c7..5aea866b 100644 --- a/codegen/Crm/Extensions/Videoconferencing/Api/SettingsApi.php +++ b/codegen/Crm/Extensions/Videoconferencing/Api/SettingsApi.php @@ -1,7 +1,7 @@ getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -195,8 +193,10 @@ public function archiveWithHttpInfo($app_id, string $contentType = self::content $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -204,9 +204,7 @@ public function archiveWithHttpInfo($app_id, string $contentType = self::content /** * Operation archiveAsync * - * Delete settings - * - * @param int $app_id The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal. (required) + * @param int $app_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archive'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -225,9 +223,7 @@ function ($response) { /** * Operation archiveAsyncWithHttpInfo * - * Delete settings - * - * @param int $app_id The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal. (required) + * @param int $app_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archive'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -264,7 +260,7 @@ function ($exception) { /** * Create request for operation 'archive' * - * @param int $app_id The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal. (required) + * @param int $app_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archive'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -361,9 +357,7 @@ public function archiveRequest($app_id, string $contentType = self::contentTypes /** * Operation getById * - * Get settings - * - * @param int $app_id The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal. (required) + * @param int $app_id app_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Extensions\Videoconferencing\ApiException on non-2xx response or if the response body is not in the expected format @@ -379,9 +373,7 @@ public function getById($app_id, string $contentType = self::contentTypes['getBy /** * Operation getByIdWithHttpInfo * - * Get settings - * - * @param int $app_id The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal. (required) + * @param int $app_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Extensions\Videoconferencing\ApiException on non-2xx response or if the response body is not in the expected format @@ -417,61 +409,21 @@ public function getByIdWithHttpInfo($app_id, string $contentType = self::content switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\ExternalSettings' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\ExternalSettings' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\ExternalSettings', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\ExternalSettings', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\Error' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -485,34 +437,11 @@ public function getByIdWithHttpInfo($app_id, string $contentType = self::content ); } - $returnType = '\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\ExternalSettings'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\ExternalSettings', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -522,7 +451,7 @@ public function getByIdWithHttpInfo($app_id, string $contentType = self::content $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -530,8 +459,10 @@ public function getByIdWithHttpInfo($app_id, string $contentType = self::content $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -539,9 +470,7 @@ public function getByIdWithHttpInfo($app_id, string $contentType = self::content /** * Operation getByIdAsync * - * Get settings - * - * @param int $app_id The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal. (required) + * @param int $app_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -560,9 +489,7 @@ function ($response) { /** * Operation getByIdAsyncWithHttpInfo * - * Get settings - * - * @param int $app_id The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal. (required) + * @param int $app_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -612,7 +539,7 @@ function ($exception) { /** * Create request for operation 'getById' * - * @param int $app_id The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal. (required) + * @param int $app_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -709,9 +636,7 @@ public function getByIdRequest($app_id, string $contentType = self::contentTypes /** * Operation replace * - * Update settings - * - * @param int $app_id The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal. (required) + * @param int $app_id app_id (required) * @param \HubSpot\Client\Crm\Extensions\Videoconferencing\Model\ExternalSettings $external_settings external_settings (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['replace'] to see the possible values for this operation * @@ -728,9 +653,7 @@ public function replace($app_id, $external_settings, string $contentType = self: /** * Operation replaceWithHttpInfo * - * Update settings - * - * @param int $app_id The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal. (required) + * @param int $app_id (required) * @param \HubSpot\Client\Crm\Extensions\Videoconferencing\Model\ExternalSettings $external_settings (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['replace'] to see the possible values for this operation * @@ -767,61 +690,21 @@ public function replaceWithHttpInfo($app_id, $external_settings, string $content switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\ExternalSettings' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\ExternalSettings' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\ExternalSettings', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\ExternalSettings', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\Error' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -835,34 +718,11 @@ public function replaceWithHttpInfo($app_id, $external_settings, string $content ); } - $returnType = '\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\ExternalSettings'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Extensions\Videoconferencing\Model\ExternalSettings', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -872,7 +732,7 @@ public function replaceWithHttpInfo($app_id, $external_settings, string $content $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -880,8 +740,10 @@ public function replaceWithHttpInfo($app_id, $external_settings, string $content $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -889,9 +751,7 @@ public function replaceWithHttpInfo($app_id, $external_settings, string $content /** * Operation replaceAsync * - * Update settings - * - * @param int $app_id The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal. (required) + * @param int $app_id (required) * @param \HubSpot\Client\Crm\Extensions\Videoconferencing\Model\ExternalSettings $external_settings (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['replace'] to see the possible values for this operation * @@ -911,9 +771,7 @@ function ($response) { /** * Operation replaceAsyncWithHttpInfo * - * Update settings - * - * @param int $app_id The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal. (required) + * @param int $app_id (required) * @param \HubSpot\Client\Crm\Extensions\Videoconferencing\Model\ExternalSettings $external_settings (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['replace'] to see the possible values for this operation * @@ -964,7 +822,7 @@ function ($exception) { /** * Create request for operation 'replace' * - * @param int $app_id The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal. (required) + * @param int $app_id (required) * @param \HubSpot\Client\Crm\Extensions\Videoconferencing\Model\ExternalSettings $external_settings (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['replace'] to see the possible values for this operation * @@ -1089,6 +947,57 @@ protected function createHttpClientOption() } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/codegen/Crm/Extensions/Videoconferencing/ApiException.php b/codegen/Crm/Extensions/Videoconferencing/ApiException.php index 4dc3622f..69e4c85a 100644 --- a/codegen/Crm/Extensions/Videoconferencing/ApiException.php +++ b/codegen/Crm/Extensions/Videoconferencing/ApiException.php @@ -1,7 +1,7 @@ tempFolderPath; } + /** + * Sets the certificate file path, for mTLS + * + * @return $this + */ + public function setCertFile($certFile) + { + $this->certFile = $certFile; + return $this; + } + + /** + * Gets the certificate file path, for mTLS + * + * @return string Certificate file path + */ + public function getCertFile() + { + return $this->certFile; + } + + /** + * Sets the certificate key path, for mTLS + * + * @return $this + */ + public function setKeyFile($keyFile) + { + $this->keyFile = $keyFile; + return $this; + } + + /** + * Gets the certificate key path, for mTLS + * + * @return string Certificate key path + */ + public function getKeyFile() + { + return $this->keyFile; + } + + /** * Gets the default configuration instance * diff --git a/codegen/Crm/Extensions/Videoconferencing/FormDataProcessor.php b/codegen/Crm/Extensions/Videoconferencing/FormDataProcessor.php new file mode 100644 index 00000000..97d73455 --- /dev/null +++ b/codegen/Crm/Extensions/Videoconferencing/FormDataProcessor.php @@ -0,0 +1,246 @@ + $values the value of the form parameter + * + * @return array [key => value] of formdata + */ + public function prepare(array $values): array + { + $this->has_file = false; + $result = []; + + foreach ($values as $k => $v) { + if ($v === null) { + continue; + } + + $result[$k] = $this->makeFormSafe($v); + } + + return $result; + } + + /** + * Flattens a multi-level array of data and generates a single-level array + * compatible with formdata - a single-level array where the keys use bracket + * notation to signify nested data. + * + * credit: https://github.com/FranBar1966/FlatPHP + */ + public static function flatten(array $source, string $start = ''): array + { + $opt = [ + 'prefix' => '[', + 'suffix' => ']', + 'suffix-end' => true, + 'prefix-list' => '[', + 'suffix-list' => ']', + 'suffix-list-end' => true, + ]; + + if ($start === '') { + $currentPrefix = ''; + $currentSuffix = ''; + $currentSuffixEnd = false; + } elseif (array_is_list($source)) { + $currentPrefix = $opt['prefix-list']; + $currentSuffix = $opt['suffix-list']; + $currentSuffixEnd = $opt['suffix-list-end']; + } else { + $currentPrefix = $opt['prefix']; + $currentSuffix = $opt['suffix']; + $currentSuffixEnd = $opt['suffix-end']; + } + + $currentName = $start; + $result = []; + + foreach ($source as $key => $val) { + $currentName .= $currentPrefix.$key; + + if (is_array($val) && !empty($val)) { + $currentName .= $currentSuffix; + $result += self::flatten($val, $currentName); + } else { + if ($currentSuffixEnd) { + $currentName .= $currentSuffix; + } + + if (is_resource($val)) { + $result[$currentName] = $val; + } else { + $result[$currentName] = ObjectSerializer::toString($val); + } + } + + $currentName = $start; + } + + return $result; + } + + /** + * formdata must be limited to scalars or arrays of scalar values, + * or a resource for a file upload. Here we iterate through all available + * data and identify how to handle each scenario + */ + protected function makeFormSafe($value) + { + if ($value instanceof SplFileObject) { + return $this->processFiles([$value])[0]; + } + + if (is_resource($value)) { + $this->has_file = true; + + return $value; + } + + if ($value instanceof ModelInterface) { + return $this->processModel($value); + } + + if (is_array($value) || (is_object($value) && !$value instanceof \DateTimeInterface)) { + $data = []; + + foreach ($value as $k => $v) { + $data[$k] = $this->makeFormSafe($v); + } + + return $data; + } + + return ObjectSerializer::toString($value); + } + + /** + * We are able to handle nested ModelInterface. We do not simply call + * json_decode(json_encode()) because any given model may have binary data + * or other data that cannot be serialized to a JSON string + */ + protected function processModel(ModelInterface $model): array + { + $result = []; + + foreach ($model::openAPITypes() as $name => $type) { + $value = $model->offsetGet($name); + + if ($value === null) { + continue; + } + + if (strpos($type, '\SplFileObject') !== false) { + $file = is_array($value) ? $value : [$value]; + $result[$name] = $this->processFiles($file); + + continue; + } + + if ($value instanceof ModelInterface) { + $result[$name] = $this->processModel($value); + + continue; + } + + if (is_array($value) || is_object($value)) { + $result[$name] = $this->makeFormSafe($value); + + continue; + } + + $result[$name] = ObjectSerializer::toString($value); + } + + return $result; + } + + /** + * Handle file data + */ + protected function processFiles(array $files): array + { + $this->has_file = true; + + $result = []; + + foreach ($files as $i => $file) { + if (is_array($file)) { + $result[$i] = $this->processFiles($file); + + continue; + } + + if ($file instanceof StreamInterface) { + $result[$i] = $file; + + continue; + } + + if ($file instanceof SplFileObject) { + $result[$i] = $this->tryFopen($file); + } + } + + return $result; + } + + private function tryFopen(SplFileObject $file) + { + return Utils::tryFopen($file->getRealPath(), 'rb'); + } +} diff --git a/codegen/Crm/Extensions/Videoconferencing/HeaderSelector.php b/codegen/Crm/Extensions/Videoconferencing/HeaderSelector.php index 04cb47eb..bd98a16e 100644 --- a/codegen/Crm/Extensions/Videoconferencing/HeaderSelector.php +++ b/codegen/Crm/Extensions/Videoconferencing/HeaderSelector.php @@ -1,7 +1,7 @@ container[$offset]); } @@ -543,12 +543,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -573,11 +573,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Videoconferencing/Model/ErrorDetail.php b/codegen/Crm/Extensions/Videoconferencing/Model/ErrorDetail.php index bdcbee7d..24f9123c 100644 --- a/codegen/Crm/Extensions/Videoconferencing/Model/ErrorDetail.php +++ b/codegen/Crm/Extensions/Videoconferencing/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Videoconferencing @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -457,11 +457,11 @@ public function setMessage($message) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -469,12 +469,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -499,11 +499,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Videoconferencing/Model/ExternalSettings.php b/codegen/Crm/Extensions/Videoconferencing/Model/ExternalSettings.php index 6384269e..60a30ca6 100644 --- a/codegen/Crm/Extensions/Videoconferencing/Model/ExternalSettings.php +++ b/codegen/Crm/Extensions/Videoconferencing/Model/ExternalSettings.php @@ -2,7 +2,7 @@ /** * ExternalSettings * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Videoconferencing @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -458,11 +458,11 @@ public function setDeleteMeetingUrl($delete_meeting_url) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -470,12 +470,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -500,11 +500,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Extensions/Videoconferencing/Model/ModelInterface.php b/codegen/Crm/Extensions/Videoconferencing/Model/ModelInterface.php index 7410ca03..008e6974 100644 --- a/codegen/Crm/Extensions/Videoconferencing/Model/ModelInterface.php +++ b/codegen/Crm/Extensions/Videoconferencing/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Videoconferencing\Model @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** diff --git a/codegen/Crm/Extensions/Videoconferencing/ObjectSerializer.php b/codegen/Crm/Extensions/Videoconferencing/ObjectSerializer.php index 080d608b..c9d87259 100644 --- a/codegen/Crm/Extensions/Videoconferencing/ObjectSerializer.php +++ b/codegen/Crm/Extensions/Videoconferencing/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Extensions\Videoconferencing @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -323,24 +323,6 @@ public static function toHeaderValue($value) return self::toString($value); } - /** - * Take value and turn it into a string suitable for inclusion in - * the http body (form parameter). If it's a string, pass through unchanged - * If it's a datetime object, format it in ISO8601 - * - * @param string|\SplFileObject $value the value of the form parameter - * - * @return string the form string - */ - public static function toFormValue($value) - { - if ($value instanceof \SplFileObject) { - return $value->getRealPath(); - } else { - return self::toString($value); - } - } - /** * Take value and turn it into a string suitable for inclusion in * the parameter. If it's a string, pass through unchanged @@ -612,6 +594,6 @@ public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): } } - return $qs ? (string) substr($qs, 0, -1) : ''; + return $qs ? substr($qs, 0, -1) : ''; } }