From b8259da334331341549b058be76c44fa24494a20 Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Thu, 29 Jan 2026 16:12:26 +0300 Subject: [PATCH 1/4] Codegen: CRM Calls and Communications --- codegen/Crm/Objects/Calls/Api/BasicApi.php | 544 +++++--------- codegen/Crm/Objects/Calls/Api/BatchApi.php | 637 ++++------------ codegen/Crm/Objects/Calls/Api/SearchApi.php | 171 +++-- codegen/Crm/Objects/Calls/ApiException.php | 6 +- codegen/Crm/Objects/Calls/Configuration.php | 65 +- .../Crm/Objects/Calls/FormDataProcessor.php | 246 +++++++ codegen/Crm/Objects/Calls/HeaderSelector.php | 6 +- .../Crm/Objects/Calls/Model/AssociatedId.php | 23 +- .../Objects/Calls/Model/AssociationSpec.php | 27 +- ...BatchInputSimplePublicObjectBatchInput.php | 18 +- ...tSimplePublicObjectBatchInputForCreate.php | 18 +- ...nputSimplePublicObjectBatchInputUpsert.php | 18 +- .../Model/BatchInputSimplePublicObjectId.php | 18 +- .../BatchReadInputSimplePublicObjectId.php | 107 +-- .../Model/BatchResponseSimplePublicObject.php | 193 +++-- ...chResponseSimplePublicObjectWithErrors.php | 697 ------------------ .../BatchResponseSimplePublicUpsertObject.php | 193 +++-- ...onseSimplePublicUpsertObjectWithErrors.php | 697 ------------------ .../Model/CollectionResponseAssociatedId.php | 18 +- ...nseSimplePublicObjectWithAssociations.php} | 32 +- ...onResponseWithTotalSimplePublicObject.php} | 119 +-- codegen/Crm/Objects/Calls/Model/Error.php | 160 ++-- .../Crm/Objects/Calls/Model/ErrorDetail.php | 136 ++-- codegen/Crm/Objects/Calls/Model/Filter.php | 167 ++--- .../Crm/Objects/Calls/Model/FilterGroup.php | 18 +- .../Crm/Objects/Calls/Model/ForwardPaging.php | 409 ---------- .../Objects/Calls/Model/ModelInterface.php | 6 +- codegen/Crm/Objects/Calls/Model/NextPage.php | 85 +-- codegen/Crm/Objects/Calls/Model/Paging.php | 18 +- .../Crm/Objects/Calls/Model/PreviousPage.php | 23 +- .../Model/PublicAssociationsForObject.php | 90 +-- .../Objects/Calls/Model/PublicObjectId.php | 21 +- .../Calls/Model/PublicObjectSearchRequest.php | 191 ++--- .../Calls/Model/SimplePublicObject.php | 138 ++-- .../Model/SimplePublicObjectBatchInput.php | 91 +-- .../SimplePublicObjectBatchInputForCreate.php | 23 +- .../SimplePublicObjectBatchInputUpsert.php | 91 +-- .../Calls/Model/SimplePublicObjectId.php | 21 +- .../Calls/Model/SimplePublicObjectInput.php | 21 +- .../SimplePublicObjectInputForCreate.php | 21 +- .../SimplePublicObjectWithAssociations.php | 206 +++--- .../Calls/Model/SimplePublicUpsertObject.php | 196 ++--- .../Crm/Objects/Calls/Model/StandardError.php | 205 +++--- .../Calls/Model/ValueWithTimestamp.php | 147 ++-- .../Crm/Objects/Calls/ObjectSerializer.php | 26 +- .../Objects/Communications/Api/BasicApi.php | 544 +++++--------- .../Objects/Communications/Api/BatchApi.php | 637 ++++------------ .../Objects/Communications/Api/SearchApi.php | 171 +++-- .../Objects/Communications/ApiException.php | 6 +- .../Objects/Communications/Configuration.php | 65 +- .../Communications/FormDataProcessor.php | 246 +++++++ .../Objects/Communications/HeaderSelector.php | 6 +- .../Communications/Model/AssociatedId.php | 23 +- .../Communications/Model/AssociationSpec.php | 27 +- ...BatchInputSimplePublicObjectBatchInput.php | 18 +- ...tSimplePublicObjectBatchInputForCreate.php | 18 +- ...nputSimplePublicObjectBatchInputUpsert.php | 18 +- .../Model/BatchInputSimplePublicObjectId.php | 18 +- .../BatchReadInputSimplePublicObjectId.php | 107 +-- .../Model/BatchResponseSimplePublicObject.php | 193 +++-- ...chResponseSimplePublicObjectWithErrors.php | 697 ------------------ .../BatchResponseSimplePublicUpsertObject.php | 193 +++-- ...onseSimplePublicUpsertObjectWithErrors.php | 697 ------------------ .../Model/CollectionResponseAssociatedId.php | 18 +- ...nseSimplePublicObjectWithAssociations.php} | 32 +- ...onResponseWithTotalSimplePublicObject.php} | 119 +-- .../Objects/Communications/Model/Error.php | 160 ++-- .../Communications/Model/ErrorDetail.php | 136 ++-- .../Objects/Communications/Model/Filter.php | 167 ++--- .../Communications/Model/FilterGroup.php | 18 +- .../Communications/Model/ForwardPaging.php | 409 ---------- .../Communications/Model/ModelInterface.php | 6 +- .../Objects/Communications/Model/NextPage.php | 85 +-- .../Objects/Communications/Model/Paging.php | 18 +- .../Communications/Model/PreviousPage.php | 23 +- .../Model/PublicAssociationsForObject.php | 90 +-- .../Communications/Model/PublicObjectId.php | 21 +- .../Model/PublicObjectSearchRequest.php | 191 ++--- .../Model/SimplePublicObject.php | 138 ++-- .../Model/SimplePublicObjectBatchInput.php | 91 +-- .../SimplePublicObjectBatchInputForCreate.php | 23 +- .../SimplePublicObjectBatchInputUpsert.php | 91 +-- .../Model/SimplePublicObjectId.php | 21 +- .../Model/SimplePublicObjectInput.php | 21 +- .../SimplePublicObjectInputForCreate.php | 21 +- .../SimplePublicObjectWithAssociations.php | 206 +++--- .../Model/SimplePublicUpsertObject.php | 196 ++--- .../Communications/Model/StandardError.php | 205 +++--- .../Model/ValueWithTimestamp.php | 147 ++-- .../Communications/ObjectSerializer.php | 26 +- 90 files changed, 4496 insertions(+), 8230 deletions(-) create mode 100644 codegen/Crm/Objects/Calls/FormDataProcessor.php delete mode 100644 codegen/Crm/Objects/Calls/Model/BatchResponseSimplePublicObjectWithErrors.php delete mode 100644 codegen/Crm/Objects/Calls/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php rename codegen/Crm/Objects/Calls/Model/{CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php => CollectionResponseSimplePublicObjectWithAssociations.php} (82%) rename codegen/Crm/Objects/Calls/Model/{CollectionResponseWithTotalSimplePublicObjectForwardPaging.php => CollectionResponseWithTotalSimplePublicObject.php} (79%) delete mode 100644 codegen/Crm/Objects/Calls/Model/ForwardPaging.php create mode 100644 codegen/Crm/Objects/Communications/FormDataProcessor.php delete mode 100644 codegen/Crm/Objects/Communications/Model/BatchResponseSimplePublicObjectWithErrors.php delete mode 100644 codegen/Crm/Objects/Communications/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php rename codegen/Crm/Objects/Communications/Model/{CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php => CollectionResponseSimplePublicObjectWithAssociations.php} (83%) rename codegen/Crm/Objects/Communications/Model/{CollectionResponseWithTotalSimplePublicObjectForwardPaging.php => CollectionResponseWithTotalSimplePublicObject.php} (80%) delete mode 100644 codegen/Crm/Objects/Communications/Model/ForwardPaging.php diff --git a/codegen/Crm/Objects/Calls/Api/BasicApi.php b/codegen/Crm/Objects/Calls/Api/BasicApi.php index 2fddc3bd..33880f05 100644 --- a/codegen/Crm/Objects/Calls/Api/BasicApi.php +++ b/codegen/Crm/Objects/Calls/Api/BasicApi.php @@ -1,7 +1,7 @@ getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -201,8 +203,10 @@ public function archiveWithHttpInfo($call_id, string $contentType = self::conten $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -212,7 +216,7 @@ public function archiveWithHttpInfo($call_id, string $contentType = self::conten * * Archive * - * @param string $call_id The ID of the call. (required) + * @param string $call_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 @@ -233,7 +237,7 @@ function ($response) { * * Archive * - * @param string $call_id The ID of the call. (required) + * @param string $call_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 @@ -270,7 +274,7 @@ function ($exception) { /** * Create request for operation 'archive' * - * @param string $call_id The ID of the call. (required) + * @param string $call_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 @@ -285,7 +289,10 @@ public function archiveRequest($call_id, string $contentType = self::contentType 'Missing the required parameter $call_id when calling archive' ); } - + if (!preg_match("/.+/", $call_id)) { + throw new \InvalidArgumentException("invalid value for \"call_id\" when calling BasicApi.archive, must conform to the pattern /.+/."); + } + $resourcePath = '/crm/v3/objects/calls/{callId}'; $formParams = []; @@ -421,62 +428,22 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin switch($statusCode) { - case 201: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObject' !== '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\Objects\Calls\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\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\Objects\Calls\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Calls\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -490,44 +457,21 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin ); } - $returnType = '\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObject'; - 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\Objects\Calls\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -535,8 +479,10 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -714,7 +660,7 @@ public function createRequest($simple_public_object_input_for_create, string $co * * Read * - * @param string $call_id The ID of the call. (required) + * @param string $call_id call_id (required) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) @@ -737,7 +683,7 @@ public function getById($call_id, $properties = null, $properties_with_history = * * Read * - * @param string $call_id The ID of the call. (required) + * @param string $call_id (required) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) @@ -778,61 +724,21 @@ public function getByIdWithHttpInfo($call_id, $properties = null, $properties_wi switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObjectWithAssociations' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObjectWithAssociations' !== '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\Objects\Calls\Model\SimplePublicObjectWithAssociations', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\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\Objects\Calls\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Calls\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -846,34 +752,11 @@ public function getByIdWithHttpInfo($call_id, $properties = null, $properties_wi ); } - $returnType = '\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObjectWithAssociations'; - 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\Objects\Calls\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -883,7 +766,7 @@ public function getByIdWithHttpInfo($call_id, $properties = null, $properties_wi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -891,8 +774,10 @@ public function getByIdWithHttpInfo($call_id, $properties = null, $properties_wi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -902,7 +787,7 @@ public function getByIdWithHttpInfo($call_id, $properties = null, $properties_wi * * Read * - * @param string $call_id The ID of the call. (required) + * @param string $call_id (required) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) @@ -928,7 +813,7 @@ function ($response) { * * Read * - * @param string $call_id The ID of the call. (required) + * @param string $call_id (required) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) @@ -983,7 +868,7 @@ function ($exception) { /** * Create request for operation 'getById' * - * @param string $call_id The ID of the call. (required) + * @param string $call_id (required) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) @@ -1003,7 +888,10 @@ public function getByIdRequest($call_id, $properties = null, $properties_with_hi 'Missing the required parameter $call_id when calling getById' ); } - + if (!preg_match("/.+/", $call_id)) { + throw new \InvalidArgumentException("invalid value for \"call_id\" when calling BasicApi.getById, must conform to the pattern /.+/."); + } + @@ -1139,14 +1027,14 @@ public function getByIdRequest($call_id, $properties = null, $properties_with_hi * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of calls that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\Calls\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\Calls\Model\Error + * @return \HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\Calls\Model\Error */ public function getPage($limit = 10, $after = null, $properties = null, $properties_with_history = null, $associations = null, $archived = false, string $contentType = self::contentTypes['getPage'][0]) { @@ -1162,14 +1050,14 @@ public function getPage($limit = 10, $after = null, $properties = null, $propert * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of calls that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\Calls\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\Calls\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\Calls\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = null, $properties_with_history = null, $associations = null, $archived = false, string $contentType = self::contentTypes['getPage'][0]) { @@ -1200,61 +1088,21 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging' !== '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\Objects\Calls\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\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\Objects\Calls\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Calls\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1268,44 +1116,21 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu ); } - $returnType = '\HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; - 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\Objects\Calls\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', + '\HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseSimplePublicObjectWithAssociations', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1313,8 +1138,10 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1327,7 +1154,7 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of calls that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation @@ -1353,7 +1180,7 @@ function ($response) { * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of calls that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation @@ -1363,7 +1190,7 @@ function ($response) { */ public function getPageAsyncWithHttpInfo($limit = 10, $after = null, $properties = null, $properties_with_history = null, $associations = null, $archived = false, string $contentType = self::contentTypes['getPage'][0]) { - $returnType = '\HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseSimplePublicObjectWithAssociations'; $request = $this->getPageRequest($limit, $after, $properties, $properties_with_history, $associations, $archived, $contentType); return $this->client @@ -1408,7 +1235,7 @@ function ($exception) { * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of calls that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation @@ -1553,7 +1380,7 @@ public function getPageRequest($limit = 10, $after = null, $properties = null, $ * * Update * - * @param string $call_id The ID of the call. (required) + * @param string $call_id call_id (required) * @param \HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObjectInput $simple_public_object_input simple_public_object_input (required) * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation @@ -1573,7 +1400,7 @@ public function update($call_id, $simple_public_object_input, $id_property = nul * * Update * - * @param string $call_id The ID of the call. (required) + * @param string $call_id (required) * @param \HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObjectInput $simple_public_object_input (required) * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation @@ -1611,61 +1438,21 @@ public function updateWithHttpInfo($call_id, $simple_public_object_input, $id_pr switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObject' !== '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\Objects\Calls\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\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\Objects\Calls\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Calls\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1679,34 +1466,11 @@ public function updateWithHttpInfo($call_id, $simple_public_object_input, $id_pr ); } - $returnType = '\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObject'; - 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\Objects\Calls\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1716,7 +1480,7 @@ public function updateWithHttpInfo($call_id, $simple_public_object_input, $id_pr $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1724,8 +1488,10 @@ public function updateWithHttpInfo($call_id, $simple_public_object_input, $id_pr $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1735,7 +1501,7 @@ public function updateWithHttpInfo($call_id, $simple_public_object_input, $id_pr * * Update * - * @param string $call_id The ID of the call. (required) + * @param string $call_id (required) * @param \HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObjectInput $simple_public_object_input (required) * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation @@ -1758,7 +1524,7 @@ function ($response) { * * Update * - * @param string $call_id The ID of the call. (required) + * @param string $call_id (required) * @param \HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObjectInput $simple_public_object_input (required) * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation @@ -1810,7 +1576,7 @@ function ($exception) { /** * Create request for operation 'update' * - * @param string $call_id The ID of the call. (required) + * @param string $call_id (required) * @param \HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObjectInput $simple_public_object_input (required) * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation @@ -1827,7 +1593,10 @@ public function updateRequest($call_id, $simple_public_object_input, $id_propert 'Missing the required parameter $call_id when calling update' ); } - + if (!preg_match("/.+/", $call_id)) { + throw new \InvalidArgumentException("invalid value for \"call_id\" when calling BasicApi.update, must conform to the pattern /.+/."); + } + // verify the required parameter 'simple_public_object_input' is set if ($simple_public_object_input === null || (is_array($simple_public_object_input) && count($simple_public_object_input) === 0)) { throw new \InvalidArgumentException( @@ -1945,6 +1714,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/Objects/Calls/Api/BatchApi.php b/codegen/Crm/Objects/Calls/Api/BatchApi.php index 753640c3..35efecf9 100644 --- a/codegen/Crm/Objects/Calls/Api/BatchApi.php +++ b/codegen/Crm/Objects/Calls/Api/BatchApi.php @@ -1,7 +1,7 @@ getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -201,8 +203,10 @@ public function archiveWithHttpInfo($batch_input_simple_public_object_id, string $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -372,7 +376,7 @@ public function archiveRequest($batch_input_simple_public_object_id, string $con * * @throws \HubSpot\Client\Crm\Objects\Calls\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Calls\Model\Error + * @return \HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Calls\Model\Error */ public function create($batch_input_simple_public_object_batch_input_for_create, string $contentType = self::contentTypes['create'][0]) { @@ -390,7 +394,7 @@ public function create($batch_input_simple_public_object_batch_input_for_create, * * @throws \HubSpot\Client\Crm\Objects\Calls\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Calls\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Calls\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function createWithHttpInfo($batch_input_simple_public_object_batch_input_for_create, string $contentType = self::contentTypes['create'][0]) { @@ -420,89 +424,22 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input switch($statusCode) { - case 201: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject' !== '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\Objects\Calls\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObjectWithErrors' !== '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\Objects\Calls\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\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\Objects\Calls\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Calls\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -516,52 +453,21 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input ); } - $returnType = '\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject'; - 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\Objects\Calls\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObjectWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -569,8 +475,10 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -754,7 +662,7 @@ public function createRequest($batch_input_simple_public_object_batch_input_for_ * * @throws \HubSpot\Client\Crm\Objects\Calls\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Calls\Model\Error + * @return \HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Calls\Model\Error */ public function read($batch_read_input_simple_public_object_id, $archived = false, string $contentType = self::contentTypes['read'][0]) { @@ -773,7 +681,7 @@ public function read($batch_read_input_simple_public_object_id, $archived = fals * * @throws \HubSpot\Client\Crm\Objects\Calls\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Calls\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Calls\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $archived = false, string $contentType = self::contentTypes['read'][0]) { @@ -804,88 +712,21 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject' !== '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\Objects\Calls\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObjectWithErrors' !== '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\Objects\Calls\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\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\Objects\Calls\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Calls\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -899,34 +740,11 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc ); } - $returnType = '\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject'; - 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\Objects\Calls\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -936,15 +754,7 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObjectWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -952,8 +762,10 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1149,7 +961,7 @@ public function readRequest($batch_read_input_simple_public_object_id, $archived * * @throws \HubSpot\Client\Crm\Objects\Calls\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Calls\Model\Error + * @return \HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Calls\Model\Error */ public function update($batch_input_simple_public_object_batch_input, string $contentType = self::contentTypes['update'][0]) { @@ -1167,7 +979,7 @@ public function update($batch_input_simple_public_object_batch_input, string $co * * @throws \HubSpot\Client\Crm\Objects\Calls\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Calls\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Calls\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input, string $contentType = self::contentTypes['update'][0]) { @@ -1198,88 +1010,21 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject' !== '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\Objects\Calls\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObjectWithErrors' !== '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\Objects\Calls\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\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\Objects\Calls\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Calls\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1293,34 +1038,11 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input ); } - $returnType = '\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObject'; - 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\Objects\Calls\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1330,15 +1052,7 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicObjectWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1346,8 +1060,10 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1530,7 +1246,7 @@ public function updateRequest($batch_input_simple_public_object_batch_input, str * * @throws \HubSpot\Client\Crm\Objects\Calls\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\Calls\Model\Error + * @return \HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Calls\Model\Error */ public function upsert($batch_input_simple_public_object_batch_input_upsert, string $contentType = self::contentTypes['upsert'][0]) { @@ -1548,7 +1264,7 @@ public function upsert($batch_input_simple_public_object_batch_input_upsert, str * * @throws \HubSpot\Client\Crm\Objects\Calls\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\Calls\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Calls\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input_upsert, string $contentType = self::contentTypes['upsert'][0]) { @@ -1579,88 +1295,21 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicUpsertObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicUpsertObject' !== '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\Objects\Calls\Model\BatchResponseSimplePublicUpsertObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicUpsertObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicUpsertObjectWithErrors' !== '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\Objects\Calls\Model\BatchResponseSimplePublicUpsertObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicUpsertObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\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\Objects\Calls\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Calls\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1674,34 +1323,11 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input ); } - $returnType = '\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicUpsertObject'; - 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\Objects\Calls\Model\BatchResponseSimplePublicUpsertObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1711,15 +1337,7 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Calls\Model\BatchResponseSimplePublicUpsertObjectWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1727,8 +1345,10 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1917,6 +1537,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/Objects/Calls/Api/SearchApi.php b/codegen/Crm/Objects/Calls/Api/SearchApi.php index ebecf96f..1c973666 100644 --- a/codegen/Crm/Objects/Calls/Api/SearchApi.php +++ b/codegen/Crm/Objects/Calls/Api/SearchApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging' !== '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\Objects\Calls\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Calls\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Calls\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\Objects\Calls\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Calls\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -249,44 +212,21 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont ); } - $returnType = '\HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging'; - 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\Objects\Calls\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', + '\HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseWithTotalSimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -294,8 +234,10 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -334,7 +276,7 @@ function ($response) { */ public function doSearchAsyncWithHttpInfo($public_object_search_request, string $contentType = self::contentTypes['doSearch'][0]) { - $returnType = '\HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\Calls\Model\CollectionResponseWithTotalSimplePublicObject'; $request = $this->doSearchRequest($public_object_search_request, $contentType); return $this->client @@ -484,6 +426,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/Objects/Calls/ApiException.php b/codegen/Crm/Objects/Calls/ApiException.php index 826fd7b8..86545dfd 100644 --- a/codegen/Crm/Objects/Calls/ApiException.php +++ b/codegen/Crm/Objects/Calls/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/Objects/Calls/FormDataProcessor.php b/codegen/Crm/Objects/Calls/FormDataProcessor.php new file mode 100644 index 00000000..8b6aa750 --- /dev/null +++ b/codegen/Crm/Objects/Calls/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/Objects/Calls/HeaderSelector.php b/codegen/Crm/Objects/Calls/HeaderSelector.php index 84c2d23d..b3e1af6d 100644 --- a/codegen/Crm/Objects/Calls/HeaderSelector.php +++ b/codegen/Crm/Objects/Calls/HeaderSelector.php @@ -1,7 +1,7 @@ container[$offset]); } @@ -370,12 +371,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 +401,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/Objects/Calls/Model/AssociationSpec.php b/codegen/Crm/Objects/Calls/Model/AssociationSpec.php index c2997d06..75f679d5 100644 --- a/codegen/Crm/Objects/Calls/Model/AssociationSpec.php +++ b/codegen/Crm/Objects/Calls/Model/AssociationSpec.php @@ -2,7 +2,7 @@ /** * AssociationSpec * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * AssociationSpec Class Doc Comment * * @category Class + * @description Defines the type, direction, and details of the relationship between two CRM objects. * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -235,8 +236,8 @@ public function getModelName() } public const ASSOCIATION_CATEGORY_HUBSPOT_DEFINED = 'HUBSPOT_DEFINED'; - public const ASSOCIATION_CATEGORY_USER_DEFINED = 'USER_DEFINED'; public const ASSOCIATION_CATEGORY_INTEGRATOR_DEFINED = 'INTEGRATOR_DEFINED'; + public const ASSOCIATION_CATEGORY_USER_DEFINED = 'USER_DEFINED'; /** * Gets allowable values of the enum @@ -247,8 +248,8 @@ public function getAssociationCategoryAllowableValues() { return [ self::ASSOCIATION_CATEGORY_HUBSPOT_DEFINED, - self::ASSOCIATION_CATEGORY_USER_DEFINED, self::ASSOCIATION_CATEGORY_INTEGRATOR_DEFINED, + self::ASSOCIATION_CATEGORY_USER_DEFINED, ]; } @@ -341,7 +342,7 @@ public function getAssociationCategory() /** * Sets association_category * - * @param string $association_category association_category + * @param string $association_category The category of the association, such as \"HUBSPOT_DEFINED\". * * @return self */ @@ -378,7 +379,7 @@ public function getAssociationTypeId() /** * Sets association_type_id * - * @param int $association_type_id association_type_id + * @param int $association_type_id The ID representing the specific type of association. * * @return self */ @@ -394,11 +395,11 @@ public function setAssociationTypeId($association_type_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]); } @@ -406,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; } @@ -436,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/Objects/Calls/Model/BatchInputSimplePublicObjectBatchInput.php b/codegen/Crm/Objects/Calls/Model/BatchInputSimplePublicObjectBatchInput.php index 3786cb45..56de8d4c 100644 --- a/codegen/Crm/Objects/Calls/Model/BatchInputSimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/Calls/Model/BatchInputSimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -321,11 +321,11 @@ public function setInputs($inputs) /** * 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/Objects/Calls/Model/BatchInputSimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/Calls/Model/BatchInputSimplePublicObjectBatchInputForCreate.php index 9d5b1fd9..adfc6712 100644 --- a/codegen/Crm/Objects/Calls/Model/BatchInputSimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/Calls/Model/BatchInputSimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -321,11 +321,11 @@ public function setInputs($inputs) /** * 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/Objects/Calls/Model/BatchInputSimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/Calls/Model/BatchInputSimplePublicObjectBatchInputUpsert.php index 45dd5677..1201acc7 100644 --- a/codegen/Crm/Objects/Calls/Model/BatchInputSimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Objects/Calls/Model/BatchInputSimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -321,11 +321,11 @@ public function setInputs($inputs) /** * 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/Objects/Calls/Model/BatchInputSimplePublicObjectId.php b/codegen/Crm/Objects/Calls/Model/BatchInputSimplePublicObjectId.php index b9d9beb2..8d8fc904 100644 --- a/codegen/Crm/Objects/Calls/Model/BatchInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/Calls/Model/BatchInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -321,11 +321,11 @@ public function setInputs($inputs) /** * 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/Objects/Calls/Model/BatchReadInputSimplePublicObjectId.php b/codegen/Crm/Objects/Calls/Model/BatchReadInputSimplePublicObjectId.php index 9eb1b9df..82a3d40f 100644 --- a/codegen/Crm/Objects/Calls/Model/BatchReadInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/Calls/Model/BatchReadInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchReadInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * BatchReadInputSimplePublicObjectId Class Doc Comment * * @category Class + * @description Specifies the input for reading a batch of CRM objects, including arrays of object IDs, requested property names (with optional history), and an optional unique identifying property. * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,10 +58,10 @@ class BatchReadInputSimplePublicObjectId implements ModelInterface, ArrayAccess, * @var string[] */ protected static $openAPITypes = [ - 'properties_with_history' => 'string[]', 'id_property' => 'string', 'inputs' => '\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObjectId[]', - 'properties' => 'string[]' + 'properties' => 'string[]', + 'properties_with_history' => 'string[]' ]; /** @@ -71,10 +72,10 @@ class BatchReadInputSimplePublicObjectId implements ModelInterface, ArrayAccess, * @psalm-var array */ protected static $openAPIFormats = [ - 'properties_with_history' => null, 'id_property' => null, 'inputs' => null, - 'properties' => null + 'properties' => null, + 'properties_with_history' => null ]; /** @@ -83,10 +84,10 @@ class BatchReadInputSimplePublicObjectId implements ModelInterface, ArrayAccess, * @var boolean[] */ protected static array $openAPINullables = [ - 'properties_with_history' => false, 'id_property' => false, 'inputs' => false, - 'properties' => false + 'properties' => false, + 'properties_with_history' => false ]; /** @@ -175,10 +176,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'properties_with_history' => 'propertiesWithHistory', 'id_property' => 'idProperty', 'inputs' => 'inputs', - 'properties' => 'properties' + 'properties' => 'properties', + 'properties_with_history' => 'propertiesWithHistory' ]; /** @@ -187,10 +188,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'properties_with_history' => 'setPropertiesWithHistory', 'id_property' => 'setIdProperty', 'inputs' => 'setInputs', - 'properties' => 'setProperties' + 'properties' => 'setProperties', + 'properties_with_history' => 'setPropertiesWithHistory' ]; /** @@ -199,10 +200,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'properties_with_history' => 'getPropertiesWithHistory', 'id_property' => 'getIdProperty', 'inputs' => 'getInputs', - 'properties' => 'getProperties' + 'properties' => 'getProperties', + 'properties_with_history' => 'getPropertiesWithHistory' ]; /** @@ -262,10 +263,10 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('properties_with_history', $data ?? [], null); $this->setIfExists('id_property', $data ?? [], null); $this->setIfExists('inputs', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('properties_with_history', $data ?? [], null); } /** @@ -295,15 +296,15 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['properties_with_history'] === null) { - $invalidProperties[] = "'properties_with_history' can't be null"; - } if ($this->container['inputs'] === null) { $invalidProperties[] = "'inputs' can't be null"; } if ($this->container['properties'] === null) { $invalidProperties[] = "'properties' can't be null"; } + if ($this->container['properties_with_history'] === null) { + $invalidProperties[] = "'properties_with_history' can't be null"; + } return $invalidProperties; } @@ -319,33 +320,6 @@ public function valid() } - /** - * Gets properties_with_history - * - * @return string[] - */ - public function getPropertiesWithHistory() - { - return $this->container['properties_with_history']; - } - - /** - * Sets properties_with_history - * - * @param string[] $properties_with_history properties_with_history - * - * @return self - */ - public function setPropertiesWithHistory($properties_with_history) - { - if (is_null($properties_with_history)) { - throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); - } - $this->container['properties_with_history'] = $properties_with_history; - - return $this; - } - /** * Gets id_property * @@ -413,7 +387,7 @@ public function getProperties() /** * Sets properties * - * @param string[] $properties properties + * @param string[] $properties Key-value pairs for setting properties for the new object. * * @return self */ @@ -426,14 +400,41 @@ public function setProperties($properties) return $this; } + + /** + * Gets properties_with_history + * + * @return string[] + */ + public function getPropertiesWithHistory() + { + return $this->container['properties_with_history']; + } + + /** + * Sets properties_with_history + * + * @param string[] $properties_with_history Key-value pairs for setting properties for the new object and their histories. + * + * @return self + */ + public function setPropertiesWithHistory($properties_with_history) + { + if (is_null($properties_with_history)) { + throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + } + $this->container['properties_with_history'] = $properties_with_history; + + return $this; + } /** * 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]); } @@ -441,12 +442,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; } @@ -471,11 +472,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/Objects/Calls/Model/BatchResponseSimplePublicObject.php b/codegen/Crm/Objects/Calls/Model/BatchResponseSimplePublicObject.php index 36d989f5..ee168d5c 100644 --- a/codegen/Crm/Objects/Calls/Model/BatchResponseSimplePublicObject.php +++ b/codegen/Crm/Objects/Calls/Model/BatchResponseSimplePublicObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * BatchResponseSimplePublicObject Class Doc Comment * * @category Class + * @description A public object batch response object * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,10 +59,12 @@ class BatchResponseSimplePublicObject implements ModelInterface, ArrayAccess, \J */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', + 'errors' => '\HubSpot\Client\Crm\Objects\Calls\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObject[]', + 'started_at' => '\DateTime', 'status' => 'string' ]; @@ -74,10 +77,12 @@ class BatchResponseSimplePublicObject implements ModelInterface, ArrayAccess, \J */ protected static $openAPIFormats = [ 'completed_at' => 'date-time', - 'requested_at' => 'date-time', - 'started_at' => 'date-time', + 'errors' => null, 'links' => null, + 'num_errors' => 'int32', + 'requested_at' => 'date-time', 'results' => null, + 'started_at' => 'date-time', 'status' => null ]; @@ -88,10 +93,12 @@ class BatchResponseSimplePublicObject implements ModelInterface, ArrayAccess, \J */ protected static array $openAPINullables = [ 'completed_at' => false, - 'requested_at' => false, - 'started_at' => false, + 'errors' => false, 'links' => false, + 'num_errors' => false, + 'requested_at' => false, 'results' => false, + 'started_at' => false, 'status' => false ]; @@ -182,10 +189,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'completed_at' => 'completedAt', - 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', + 'errors' => 'errors', 'links' => 'links', + 'num_errors' => 'numErrors', + 'requested_at' => 'requestedAt', 'results' => 'results', + 'started_at' => 'startedAt', 'status' => 'status' ]; @@ -196,10 +205,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'completed_at' => 'setCompletedAt', - 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', + 'errors' => 'setErrors', 'links' => 'setLinks', + 'num_errors' => 'setNumErrors', + 'requested_at' => 'setRequestedAt', 'results' => 'setResults', + 'started_at' => 'setStartedAt', 'status' => 'setStatus' ]; @@ -210,10 +221,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'completed_at' => 'getCompletedAt', - 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', + 'errors' => 'getErrors', 'links' => 'getLinks', + 'num_errors' => 'getNumErrors', + 'requested_at' => 'getRequestedAt', 'results' => 'getResults', + 'started_at' => 'getStartedAt', 'status' => 'getStatus' ]; @@ -258,10 +271,10 @@ public function getModelName() return self::$openAPIModelName; } - public const STATUS_PENDING = 'PENDING'; - public const STATUS_PROCESSING = 'PROCESSING'; public const STATUS_CANCELED = 'CANCELED'; public const STATUS_COMPLETE = 'COMPLETE'; + public const STATUS_PENDING = 'PENDING'; + public const STATUS_PROCESSING = 'PROCESSING'; /** * Gets allowable values of the enum @@ -271,10 +284,10 @@ public function getModelName() public function getStatusAllowableValues() { return [ - self::STATUS_PENDING, - self::STATUS_PROCESSING, self::STATUS_CANCELED, self::STATUS_COMPLETE, + self::STATUS_PENDING, + self::STATUS_PROCESSING, ]; } @@ -294,10 +307,12 @@ public function getStatusAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('completed_at', $data ?? [], null); - $this->setIfExists('requested_at', $data ?? [], null); - $this->setIfExists('started_at', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('links', $data ?? [], null); + $this->setIfExists('num_errors', $data ?? [], null); + $this->setIfExists('requested_at', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('started_at', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); } @@ -331,12 +346,12 @@ public function listInvalidProperties() if ($this->container['completed_at'] === null) { $invalidProperties[] = "'completed_at' can't be null"; } - if ($this->container['started_at'] === null) { - $invalidProperties[] = "'started_at' can't be null"; - } if ($this->container['results'] === null) { $invalidProperties[] = "'results' can't be null"; } + if ($this->container['started_at'] === null) { + $invalidProperties[] = "'started_at' can't be null"; + } if ($this->container['status'] === null) { $invalidProperties[] = "'status' can't be null"; } @@ -377,7 +392,7 @@ public function getCompletedAt() /** * Sets completed_at * - * @param \DateTime $completed_at completed_at + * @param \DateTime $completed_at The timestamp when the batch processing was completed, in ISO 8601 format. * * @return self */ @@ -392,82 +407,109 @@ public function setCompletedAt($completed_at) } /** - * Gets requested_at + * Gets errors * - * @return \DateTime|null + * @return \HubSpot\Client\Crm\Objects\Calls\Model\StandardError[]|null */ - public function getRequestedAt() + public function getErrors() { - return $this->container['requested_at']; + return $this->container['errors']; } /** - * Sets requested_at + * Sets errors * - * @param \DateTime|null $requested_at requested_at + * @param \HubSpot\Client\Crm\Objects\Calls\Model\StandardError[]|null $errors errors * * @return self */ - public function setRequestedAt($requested_at) + public function setErrors($errors) { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['requested_at'] = $requested_at; + $this->container['errors'] = $errors; return $this; } /** - * Gets started_at + * Gets links * - * @return \DateTime + * @return array|null */ - public function getStartedAt() + public function getLinks() { - return $this->container['started_at']; + return $this->container['links']; } /** - * Sets started_at + * Sets links * - * @param \DateTime $started_at started_at + * @param array|null $links An object containing relevant links related to the batch request. * * @return self */ - public function setStartedAt($started_at) + public function setLinks($links) { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['started_at'] = $started_at; + $this->container['links'] = $links; return $this; } /** - * Gets links + * Gets num_errors * - * @return array|null + * @return int|null */ - public function getLinks() + public function getNumErrors() { - return $this->container['links']; + return $this->container['num_errors']; } /** - * Sets links + * Sets num_errors * - * @param array|null $links links + * @param int|null $num_errors The total number of errors that occurred during the batch operation. * * @return self */ - public function setLinks($links) + public function setNumErrors($num_errors) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($num_errors)) { + throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); } - $this->container['links'] = $links; + $this->container['num_errors'] = $num_errors; + + return $this; + } + + /** + * Gets requested_at + * + * @return \DateTime|null + */ + public function getRequestedAt() + { + return $this->container['requested_at']; + } + + /** + * Sets requested_at + * + * @param \DateTime|null $requested_at The timestamp when the batch request was initially made, in ISO 8601 format. + * + * @return self + */ + public function setRequestedAt($requested_at) + { + if (is_null($requested_at)) { + throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + } + $this->container['requested_at'] = $requested_at; return $this; } @@ -499,6 +541,33 @@ public function setResults($results) return $this; } + /** + * Gets started_at + * + * @return \DateTime + */ + public function getStartedAt() + { + return $this->container['started_at']; + } + + /** + * Sets started_at + * + * @param \DateTime $started_at The timestamp when the batch processing began, in ISO 8601 format. + * + * @return self + */ + public function setStartedAt($started_at) + { + if (is_null($started_at)) { + throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + } + $this->container['started_at'] = $started_at; + + return $this; + } + /** * Gets status * @@ -512,7 +581,7 @@ public function getStatus() /** * Sets status * - * @param string $status status + * @param string $status The status of the batch processing request: \"PENDING\", \"PROCESSING\", \"CANCELLED\", or \"COMPLETE\" * * @return self */ @@ -538,11 +607,11 @@ public function setStatus($status) /** * 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]); } @@ -550,12 +619,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; } @@ -580,11 +649,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/Objects/Calls/Model/BatchResponseSimplePublicObjectWithErrors.php b/codegen/Crm/Objects/Calls/Model/BatchResponseSimplePublicObjectWithErrors.php deleted file mode 100644 index de3f4b6b..00000000 --- a/codegen/Crm/Objects/Calls/Model/BatchResponseSimplePublicObjectWithErrors.php +++ /dev/null @@ -1,697 +0,0 @@ - - */ -class BatchResponseSimplePublicObjectWithErrors implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'BatchResponseSimplePublicObjectWithErrors'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'completed_at' => '\DateTime', - 'num_errors' => 'int', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', - 'links' => 'array', - 'results' => '\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\Calls\Model\StandardError[]', - 'status' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'completed_at' => 'date-time', - 'num_errors' => 'int32', - 'requested_at' => 'date-time', - 'started_at' => 'date-time', - 'links' => null, - 'results' => null, - 'errors' => null, - 'status' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'completed_at' => false, - 'num_errors' => false, - 'requested_at' => false, - 'started_at' => false, - 'links' => false, - 'results' => false, - 'errors' => false, - 'status' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'completed_at' => 'completedAt', - 'num_errors' => 'numErrors', - 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', - 'links' => 'links', - 'results' => 'results', - 'errors' => 'errors', - 'status' => 'status' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'completed_at' => 'setCompletedAt', - 'num_errors' => 'setNumErrors', - 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', - 'links' => 'setLinks', - 'results' => 'setResults', - 'errors' => 'setErrors', - 'status' => 'setStatus' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'completed_at' => 'getCompletedAt', - 'num_errors' => 'getNumErrors', - 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', - 'links' => 'getLinks', - 'results' => 'getResults', - 'errors' => 'getErrors', - 'status' => 'getStatus' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - public const STATUS_PENDING = 'PENDING'; - public const STATUS_PROCESSING = 'PROCESSING'; - public const STATUS_CANCELED = 'CANCELED'; - public const STATUS_COMPLETE = 'COMPLETE'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStatusAllowableValues() - { - return [ - self::STATUS_PENDING, - self::STATUS_PROCESSING, - self::STATUS_CANCELED, - self::STATUS_COMPLETE, - ]; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('completed_at', $data ?? [], null); - $this->setIfExists('num_errors', $data ?? [], null); - $this->setIfExists('requested_at', $data ?? [], null); - $this->setIfExists('started_at', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); - $this->setIfExists('results', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['completed_at'] === null) { - $invalidProperties[] = "'completed_at' can't be null"; - } - if ($this->container['started_at'] === null) { - $invalidProperties[] = "'started_at' can't be null"; - } - if ($this->container['results'] === null) { - $invalidProperties[] = "'results' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'status', must be one of '%s'", - $this->container['status'], - implode("', '", $allowedValues) - ); - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets completed_at - * - * @return \DateTime - */ - public function getCompletedAt() - { - return $this->container['completed_at']; - } - - /** - * Sets completed_at - * - * @param \DateTime $completed_at completed_at - * - * @return self - */ - public function setCompletedAt($completed_at) - { - if (is_null($completed_at)) { - throw new \InvalidArgumentException('non-nullable completed_at cannot be null'); - } - $this->container['completed_at'] = $completed_at; - - return $this; - } - - /** - * Gets num_errors - * - * @return int|null - */ - public function getNumErrors() - { - return $this->container['num_errors']; - } - - /** - * Sets num_errors - * - * @param int|null $num_errors num_errors - * - * @return self - */ - public function setNumErrors($num_errors) - { - if (is_null($num_errors)) { - throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); - } - $this->container['num_errors'] = $num_errors; - - return $this; - } - - /** - * Gets requested_at - * - * @return \DateTime|null - */ - public function getRequestedAt() - { - return $this->container['requested_at']; - } - - /** - * Sets requested_at - * - * @param \DateTime|null $requested_at requested_at - * - * @return self - */ - public function setRequestedAt($requested_at) - { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); - } - $this->container['requested_at'] = $requested_at; - - return $this; - } - - /** - * Gets started_at - * - * @return \DateTime - */ - public function getStartedAt() - { - return $this->container['started_at']; - } - - /** - * Sets started_at - * - * @param \DateTime $started_at started_at - * - * @return self - */ - public function setStartedAt($started_at) - { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); - } - $this->container['started_at'] = $started_at; - - return $this; - } - - /** - * Gets links - * - * @return array|null - */ - public function getLinks() - { - return $this->container['links']; - } - - /** - * Sets links - * - * @param array|null $links links - * - * @return self - */ - public function setLinks($links) - { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); - } - $this->container['links'] = $links; - - return $this; - } - - /** - * Gets results - * - * @return \HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObject[] $results results - * - * @return self - */ - public function setResults($results) - { - if (is_null($results)) { - throw new \InvalidArgumentException('non-nullable results cannot be null'); - } - $this->container['results'] = $results; - - return $this; - } - - /** - * Gets errors - * - * @return \HubSpot\Client\Crm\Objects\Calls\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\Calls\Model\StandardError[]|null $errors errors - * - * @return self - */ - public function setErrors($errors) - { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); - } - $this->container['errors'] = $errors; - - return $this; - } - - /** - * Gets status - * - * @return string - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", - $status, - implode("', '", $allowedValues) - ) - ); - } - $this->container['status'] = $status; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/codegen/Crm/Objects/Calls/Model/BatchResponseSimplePublicUpsertObject.php b/codegen/Crm/Objects/Calls/Model/BatchResponseSimplePublicUpsertObject.php index f8955a24..46f4f23e 100644 --- a/codegen/Crm/Objects/Calls/Model/BatchResponseSimplePublicUpsertObject.php +++ b/codegen/Crm/Objects/Calls/Model/BatchResponseSimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * BatchResponseSimplePublicUpsertObject Class Doc Comment * * @category Class + * @description Represents the result of a batch upsert operation, including the operation’s status, timestamps, and a list of successfully created or updated objects. * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,10 +59,12 @@ class BatchResponseSimplePublicUpsertObject implements ModelInterface, ArrayAcce */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', + 'errors' => '\HubSpot\Client\Crm\Objects\Calls\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicUpsertObject[]', + 'started_at' => '\DateTime', 'status' => 'string' ]; @@ -74,10 +77,12 @@ class BatchResponseSimplePublicUpsertObject implements ModelInterface, ArrayAcce */ protected static $openAPIFormats = [ 'completed_at' => 'date-time', - 'requested_at' => 'date-time', - 'started_at' => 'date-time', + 'errors' => null, 'links' => null, + 'num_errors' => 'int32', + 'requested_at' => 'date-time', 'results' => null, + 'started_at' => 'date-time', 'status' => null ]; @@ -88,10 +93,12 @@ class BatchResponseSimplePublicUpsertObject implements ModelInterface, ArrayAcce */ protected static array $openAPINullables = [ 'completed_at' => false, - 'requested_at' => false, - 'started_at' => false, + 'errors' => false, 'links' => false, + 'num_errors' => false, + 'requested_at' => false, 'results' => false, + 'started_at' => false, 'status' => false ]; @@ -182,10 +189,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'completed_at' => 'completedAt', - 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', + 'errors' => 'errors', 'links' => 'links', + 'num_errors' => 'numErrors', + 'requested_at' => 'requestedAt', 'results' => 'results', + 'started_at' => 'startedAt', 'status' => 'status' ]; @@ -196,10 +205,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'completed_at' => 'setCompletedAt', - 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', + 'errors' => 'setErrors', 'links' => 'setLinks', + 'num_errors' => 'setNumErrors', + 'requested_at' => 'setRequestedAt', 'results' => 'setResults', + 'started_at' => 'setStartedAt', 'status' => 'setStatus' ]; @@ -210,10 +221,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'completed_at' => 'getCompletedAt', - 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', + 'errors' => 'getErrors', 'links' => 'getLinks', + 'num_errors' => 'getNumErrors', + 'requested_at' => 'getRequestedAt', 'results' => 'getResults', + 'started_at' => 'getStartedAt', 'status' => 'getStatus' ]; @@ -258,10 +271,10 @@ public function getModelName() return self::$openAPIModelName; } - public const STATUS_PENDING = 'PENDING'; - public const STATUS_PROCESSING = 'PROCESSING'; public const STATUS_CANCELED = 'CANCELED'; public const STATUS_COMPLETE = 'COMPLETE'; + public const STATUS_PENDING = 'PENDING'; + public const STATUS_PROCESSING = 'PROCESSING'; /** * Gets allowable values of the enum @@ -271,10 +284,10 @@ public function getModelName() public function getStatusAllowableValues() { return [ - self::STATUS_PENDING, - self::STATUS_PROCESSING, self::STATUS_CANCELED, self::STATUS_COMPLETE, + self::STATUS_PENDING, + self::STATUS_PROCESSING, ]; } @@ -294,10 +307,12 @@ public function getStatusAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('completed_at', $data ?? [], null); - $this->setIfExists('requested_at', $data ?? [], null); - $this->setIfExists('started_at', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('links', $data ?? [], null); + $this->setIfExists('num_errors', $data ?? [], null); + $this->setIfExists('requested_at', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('started_at', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); } @@ -331,12 +346,12 @@ public function listInvalidProperties() if ($this->container['completed_at'] === null) { $invalidProperties[] = "'completed_at' can't be null"; } - if ($this->container['started_at'] === null) { - $invalidProperties[] = "'started_at' can't be null"; - } if ($this->container['results'] === null) { $invalidProperties[] = "'results' can't be null"; } + if ($this->container['started_at'] === null) { + $invalidProperties[] = "'started_at' can't be null"; + } if ($this->container['status'] === null) { $invalidProperties[] = "'status' can't be null"; } @@ -377,7 +392,7 @@ public function getCompletedAt() /** * Sets completed_at * - * @param \DateTime $completed_at completed_at + * @param \DateTime $completed_at The timestamp when the batch process was completed, in ISO 8601 format. * * @return self */ @@ -392,82 +407,109 @@ public function setCompletedAt($completed_at) } /** - * Gets requested_at + * Gets errors * - * @return \DateTime|null + * @return \HubSpot\Client\Crm\Objects\Calls\Model\StandardError[]|null */ - public function getRequestedAt() + public function getErrors() { - return $this->container['requested_at']; + return $this->container['errors']; } /** - * Sets requested_at + * Sets errors * - * @param \DateTime|null $requested_at requested_at + * @param \HubSpot\Client\Crm\Objects\Calls\Model\StandardError[]|null $errors errors * * @return self */ - public function setRequestedAt($requested_at) + public function setErrors($errors) { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['requested_at'] = $requested_at; + $this->container['errors'] = $errors; return $this; } /** - * Gets started_at + * Gets links * - * @return \DateTime + * @return array|null */ - public function getStartedAt() + public function getLinks() { - return $this->container['started_at']; + return $this->container['links']; } /** - * Sets started_at + * Sets links * - * @param \DateTime $started_at started_at + * @param array|null $links An object containing relevant links related to the batch request. * * @return self */ - public function setStartedAt($started_at) + public function setLinks($links) { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['started_at'] = $started_at; + $this->container['links'] = $links; return $this; } /** - * Gets links + * Gets num_errors * - * @return array|null + * @return int|null */ - public function getLinks() + public function getNumErrors() { - return $this->container['links']; + return $this->container['num_errors']; } /** - * Sets links + * Sets num_errors * - * @param array|null $links links + * @param int|null $num_errors The total number of errors that occurred during the operation. * * @return self */ - public function setLinks($links) + public function setNumErrors($num_errors) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($num_errors)) { + throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); } - $this->container['links'] = $links; + $this->container['num_errors'] = $num_errors; + + return $this; + } + + /** + * Gets requested_at + * + * @return \DateTime|null + */ + public function getRequestedAt() + { + return $this->container['requested_at']; + } + + /** + * Sets requested_at + * + * @param \DateTime|null $requested_at The timestamp when the batch process was initiated, in ISO 8601 format. + * + * @return self + */ + public function setRequestedAt($requested_at) + { + if (is_null($requested_at)) { + throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + } + $this->container['requested_at'] = $requested_at; return $this; } @@ -499,6 +541,33 @@ public function setResults($results) return $this; } + /** + * Gets started_at + * + * @return \DateTime + */ + public function getStartedAt() + { + return $this->container['started_at']; + } + + /** + * Sets started_at + * + * @param \DateTime $started_at The timestamp when the batch process began execution, in ISO 8601 format. + * + * @return self + */ + public function setStartedAt($started_at) + { + if (is_null($started_at)) { + throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + } + $this->container['started_at'] = $started_at; + + return $this; + } + /** * Gets status * @@ -512,7 +581,7 @@ public function getStatus() /** * Sets status * - * @param string $status status + * @param string $status The status of the batch processing request. Can be: \"PENDING\", \"PROCESSING\", \"CANCELED\", or \"COMPLETE\". * * @return self */ @@ -538,11 +607,11 @@ public function setStatus($status) /** * 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]); } @@ -550,12 +619,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; } @@ -580,11 +649,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/Objects/Calls/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php b/codegen/Crm/Objects/Calls/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php deleted file mode 100644 index 6e63a532..00000000 --- a/codegen/Crm/Objects/Calls/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php +++ /dev/null @@ -1,697 +0,0 @@ - - */ -class BatchResponseSimplePublicUpsertObjectWithErrors implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'BatchResponseSimplePublicUpsertObjectWithErrors'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'completed_at' => '\DateTime', - 'num_errors' => 'int', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', - 'links' => 'array', - 'results' => '\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicUpsertObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\Calls\Model\StandardError[]', - 'status' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'completed_at' => 'date-time', - 'num_errors' => 'int32', - 'requested_at' => 'date-time', - 'started_at' => 'date-time', - 'links' => null, - 'results' => null, - 'errors' => null, - 'status' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'completed_at' => false, - 'num_errors' => false, - 'requested_at' => false, - 'started_at' => false, - 'links' => false, - 'results' => false, - 'errors' => false, - 'status' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'completed_at' => 'completedAt', - 'num_errors' => 'numErrors', - 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', - 'links' => 'links', - 'results' => 'results', - 'errors' => 'errors', - 'status' => 'status' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'completed_at' => 'setCompletedAt', - 'num_errors' => 'setNumErrors', - 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', - 'links' => 'setLinks', - 'results' => 'setResults', - 'errors' => 'setErrors', - 'status' => 'setStatus' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'completed_at' => 'getCompletedAt', - 'num_errors' => 'getNumErrors', - 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', - 'links' => 'getLinks', - 'results' => 'getResults', - 'errors' => 'getErrors', - 'status' => 'getStatus' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - public const STATUS_PENDING = 'PENDING'; - public const STATUS_PROCESSING = 'PROCESSING'; - public const STATUS_CANCELED = 'CANCELED'; - public const STATUS_COMPLETE = 'COMPLETE'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStatusAllowableValues() - { - return [ - self::STATUS_PENDING, - self::STATUS_PROCESSING, - self::STATUS_CANCELED, - self::STATUS_COMPLETE, - ]; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('completed_at', $data ?? [], null); - $this->setIfExists('num_errors', $data ?? [], null); - $this->setIfExists('requested_at', $data ?? [], null); - $this->setIfExists('started_at', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); - $this->setIfExists('results', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['completed_at'] === null) { - $invalidProperties[] = "'completed_at' can't be null"; - } - if ($this->container['started_at'] === null) { - $invalidProperties[] = "'started_at' can't be null"; - } - if ($this->container['results'] === null) { - $invalidProperties[] = "'results' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'status', must be one of '%s'", - $this->container['status'], - implode("', '", $allowedValues) - ); - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets completed_at - * - * @return \DateTime - */ - public function getCompletedAt() - { - return $this->container['completed_at']; - } - - /** - * Sets completed_at - * - * @param \DateTime $completed_at completed_at - * - * @return self - */ - public function setCompletedAt($completed_at) - { - if (is_null($completed_at)) { - throw new \InvalidArgumentException('non-nullable completed_at cannot be null'); - } - $this->container['completed_at'] = $completed_at; - - return $this; - } - - /** - * Gets num_errors - * - * @return int|null - */ - public function getNumErrors() - { - return $this->container['num_errors']; - } - - /** - * Sets num_errors - * - * @param int|null $num_errors num_errors - * - * @return self - */ - public function setNumErrors($num_errors) - { - if (is_null($num_errors)) { - throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); - } - $this->container['num_errors'] = $num_errors; - - return $this; - } - - /** - * Gets requested_at - * - * @return \DateTime|null - */ - public function getRequestedAt() - { - return $this->container['requested_at']; - } - - /** - * Sets requested_at - * - * @param \DateTime|null $requested_at requested_at - * - * @return self - */ - public function setRequestedAt($requested_at) - { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); - } - $this->container['requested_at'] = $requested_at; - - return $this; - } - - /** - * Gets started_at - * - * @return \DateTime - */ - public function getStartedAt() - { - return $this->container['started_at']; - } - - /** - * Sets started_at - * - * @param \DateTime $started_at started_at - * - * @return self - */ - public function setStartedAt($started_at) - { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); - } - $this->container['started_at'] = $started_at; - - return $this; - } - - /** - * Gets links - * - * @return array|null - */ - public function getLinks() - { - return $this->container['links']; - } - - /** - * Sets links - * - * @param array|null $links links - * - * @return self - */ - public function setLinks($links) - { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); - } - $this->container['links'] = $links; - - return $this; - } - - /** - * Gets results - * - * @return \HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicUpsertObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicUpsertObject[] $results results - * - * @return self - */ - public function setResults($results) - { - if (is_null($results)) { - throw new \InvalidArgumentException('non-nullable results cannot be null'); - } - $this->container['results'] = $results; - - return $this; - } - - /** - * Gets errors - * - * @return \HubSpot\Client\Crm\Objects\Calls\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\Calls\Model\StandardError[]|null $errors errors - * - * @return self - */ - public function setErrors($errors) - { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); - } - $this->container['errors'] = $errors; - - return $this; - } - - /** - * Gets status - * - * @return string - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", - $status, - implode("', '", $allowedValues) - ) - ); - } - $this->container['status'] = $status; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/codegen/Crm/Objects/Calls/Model/CollectionResponseAssociatedId.php b/codegen/Crm/Objects/Calls/Model/CollectionResponseAssociatedId.php index e2632f95..12cee4e9 100644 --- a/codegen/Crm/Objects/Calls/Model/CollectionResponseAssociatedId.php +++ b/codegen/Crm/Objects/Calls/Model/CollectionResponseAssociatedId.php @@ -2,7 +2,7 @@ /** * CollectionResponseAssociatedId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -355,11 +355,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]); } @@ -367,12 +367,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; } @@ -397,11 +397,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/Objects/Calls/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php b/codegen/Crm/Objects/Calls/Model/CollectionResponseSimplePublicObjectWithAssociations.php similarity index 82% rename from codegen/Crm/Objects/Calls/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php rename to codegen/Crm/Objects/Calls/Model/CollectionResponseSimplePublicObjectWithAssociations.php index fb981b0f..8c3dd92e 100644 --- a/codegen/Crm/Objects/Calls/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php +++ b/codegen/Crm/Objects/Calls/Model/CollectionResponseSimplePublicObjectWithAssociations.php @@ -1,8 +1,8 @@ */ -class CollectionResponseSimplePublicObjectWithAssociationsForwardPaging implements ModelInterface, ArrayAccess, \JsonSerializable +class CollectionResponseSimplePublicObjectWithAssociations implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +49,7 @@ class CollectionResponseSimplePublicObjectWithAssociationsForwardPaging implemen * * @var string */ - protected static $openAPIModelName = 'CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; + protected static $openAPIModelName = 'CollectionResponseSimplePublicObjectWithAssociations'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,7 +57,7 @@ class CollectionResponseSimplePublicObjectWithAssociationsForwardPaging implemen * @var string[] */ protected static $openAPITypes = [ - 'paging' => '\HubSpot\Client\Crm\Objects\Calls\Model\ForwardPaging', + 'paging' => '\HubSpot\Client\Crm\Objects\Calls\Model\Paging', 'results' => '\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObjectWithAssociations[]' ]; @@ -302,7 +302,7 @@ public function valid() /** * Gets paging * - * @return \HubSpot\Client\Crm\Objects\Calls\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\Calls\Model\Paging|null */ public function getPaging() { @@ -312,7 +312,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\Calls\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\Calls\Model\Paging|null $paging paging * * @return self */ @@ -355,11 +355,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]); } @@ -367,12 +367,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; } @@ -397,11 +397,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/Objects/Calls/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php b/codegen/Crm/Objects/Calls/Model/CollectionResponseWithTotalSimplePublicObject.php similarity index 79% rename from codegen/Crm/Objects/Calls/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php rename to codegen/Crm/Objects/Calls/Model/CollectionResponseWithTotalSimplePublicObject.php index bb6d792b..d4666047 100644 --- a/codegen/Crm/Objects/Calls/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php +++ b/codegen/Crm/Objects/Calls/Model/CollectionResponseWithTotalSimplePublicObject.php @@ -1,8 +1,8 @@ */ -class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements ModelInterface, ArrayAccess, \JsonSerializable +class CollectionResponseWithTotalSimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +50,7 @@ class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements Mode * * @var string */ - protected static $openAPIModelName = 'CollectionResponseWithTotalSimplePublicObjectForwardPaging'; + protected static $openAPIModelName = 'CollectionResponseWithTotalSimplePublicObject'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,9 +58,9 @@ class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements Mode * @var string[] */ protected static $openAPITypes = [ - 'total' => 'int', - 'paging' => '\HubSpot\Client\Crm\Objects\Calls\Model\ForwardPaging', - 'results' => '\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObject[]' + 'paging' => '\HubSpot\Client\Crm\Objects\Calls\Model\Paging', + 'results' => '\HubSpot\Client\Crm\Objects\Calls\Model\SimplePublicObject[]', + 'total' => 'int' ]; /** @@ -70,9 +71,9 @@ class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements Mode * @psalm-var array */ protected static $openAPIFormats = [ - 'total' => 'int32', 'paging' => null, - 'results' => null + 'results' => null, + 'total' => 'int32' ]; /** @@ -81,9 +82,9 @@ class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements Mode * @var boolean[] */ protected static array $openAPINullables = [ - 'total' => false, 'paging' => false, - 'results' => false + 'results' => false, + 'total' => false ]; /** @@ -172,9 +173,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'total' => 'total', 'paging' => 'paging', - 'results' => 'results' + 'results' => 'results', + 'total' => 'total' ]; /** @@ -183,9 +184,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'total' => 'setTotal', 'paging' => 'setPaging', - 'results' => 'setResults' + 'results' => 'setResults', + 'total' => 'setTotal' ]; /** @@ -194,9 +195,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'total' => 'getTotal', 'paging' => 'getPaging', - 'results' => 'getResults' + 'results' => 'getResults', + 'total' => 'getTotal' ]; /** @@ -256,9 +257,9 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('total', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); } /** @@ -288,12 +289,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['total'] === null) { - $invalidProperties[] = "'total' can't be null"; - } if ($this->container['results'] === null) { $invalidProperties[] = "'results' can't be null"; } + if ($this->container['total'] === null) { + $invalidProperties[] = "'total' can't be null"; + } return $invalidProperties; } @@ -309,37 +310,10 @@ public function valid() } - /** - * Gets total - * - * @return int - */ - public function getTotal() - { - return $this->container['total']; - } - - /** - * Sets total - * - * @param int $total total - * - * @return self - */ - public function setTotal($total) - { - if (is_null($total)) { - throw new \InvalidArgumentException('non-nullable total cannot be null'); - } - $this->container['total'] = $total; - - return $this; - } - /** * Gets paging * - * @return \HubSpot\Client\Crm\Objects\Calls\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\Calls\Model\Paging|null */ public function getPaging() { @@ -349,7 +323,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\Calls\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\Calls\Model\Paging|null $paging paging * * @return self */ @@ -389,14 +363,41 @@ public function setResults($results) return $this; } + + /** + * Gets total + * + * @return int + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int $total The number of available results + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } /** * 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]); } @@ -404,12 +405,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; } @@ -434,11 +435,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/Objects/Calls/Model/Error.php b/codegen/Crm/Objects/Calls/Model/Error.php index bd937087..0dd61968 100644 --- a/codegen/Crm/Objects/Calls/Model/Error.php +++ b/codegen/Crm/Objects/Calls/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,13 +57,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'string', + 'category' => 'string', 'context' => 'array', 'correlation_id' => 'string', + 'errors' => '\HubSpot\Client\Crm\Objects\Calls\Model\ErrorDetail[]', 'links' => 'array', 'message' => 'string', - 'category' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\Calls\Model\ErrorDetail[]' + 'sub_category' => 'string' ]; /** @@ -74,13 +74,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, + 'category' => null, 'context' => null, 'correlation_id' => 'uuid', + 'errors' => null, 'links' => null, 'message' => null, - 'category' => null, - 'errors' => null + 'sub_category' => null ]; /** @@ -89,13 +89,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, + 'category' => false, 'context' => false, 'correlation_id' => false, + 'errors' => false, 'links' => false, 'message' => false, - 'category' => false, - 'errors' => false + 'sub_category' => false ]; /** @@ -184,13 +184,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', + 'category' => 'category', 'context' => 'context', 'correlation_id' => 'correlationId', + 'errors' => 'errors', 'links' => 'links', 'message' => 'message', - 'category' => 'category', - 'errors' => 'errors' + 'sub_category' => 'subCategory' ]; /** @@ -199,13 +199,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', + 'category' => 'setCategory', 'context' => 'setContext', 'correlation_id' => 'setCorrelationId', + 'errors' => 'setErrors', 'links' => 'setLinks', 'message' => 'setMessage', - 'category' => 'setCategory', - 'errors' => 'setErrors' + 'sub_category' => 'setSubCategory' ]; /** @@ -214,13 +214,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', + 'category' => 'getCategory', 'context' => 'getContext', 'correlation_id' => 'getCorrelationId', + 'errors' => 'getErrors', 'links' => 'getLinks', 'message' => 'getMessage', - 'category' => 'getCategory', - 'errors' => 'getErrors' + 'sub_category' => 'getSubCategory' ]; /** @@ -280,13 +280,13 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); $this->setIfExists('correlation_id', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('links', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); - $this->setIfExists('category', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -316,15 +316,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['category'] === null) { + $invalidProperties[] = "'category' can't be null"; + } if ($this->container['correlation_id'] === null) { $invalidProperties[] = "'correlation_id' can't be null"; } if ($this->container['message'] === null) { $invalidProperties[] = "'message' can't be null"; } - if ($this->container['category'] === null) { - $invalidProperties[] = "'category' can't be null"; - } return $invalidProperties; } @@ -341,28 +341,28 @@ public function valid() /** - * Gets sub_category + * Gets category * - * @return string|null + * @return string */ - public function getSubCategory() + public function getCategory() { - return $this->container['sub_category']; + return $this->container['category']; } /** - * Sets sub_category + * Sets category * - * @param string|null $sub_category A specific category that contains more specific detail about the error + * @param string $category The error category * * @return self */ - public function setSubCategory($sub_category) + public function setCategory($category) { - if (is_null($sub_category)) { - throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['sub_category'] = $sub_category; + $this->container['category'] = $category; return $this; } @@ -421,6 +421,33 @@ public function setCorrelationId($correlation_id) return $this; } + /** + * Gets errors + * + * @return \HubSpot\Client\Crm\Objects\Calls\Model\ErrorDetail[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Objects\Calls\Model\ErrorDetail[]|null $errors further information about the error + * + * @return self + */ + public function setErrors($errors) + { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; + + return $this; + } + /** * Gets links * @@ -476,66 +503,39 @@ public function setMessage($message) } /** - * Gets category - * - * @return string - */ - public function getCategory() - { - return $this->container['category']; - } - - /** - * Sets category - * - * @param string $category The error category - * - * @return self - */ - public function setCategory($category) - { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); - } - $this->container['category'] = $category; - - return $this; - } - - /** - * Gets errors + * Gets sub_category * - * @return \HubSpot\Client\Crm\Objects\Calls\Model\ErrorDetail[]|null + * @return string|null */ - public function getErrors() + public function getSubCategory() { - return $this->container['errors']; + return $this->container['sub_category']; } /** - * Sets errors + * Sets sub_category * - * @param \HubSpot\Client\Crm\Objects\Calls\Model\ErrorDetail[]|null $errors further information about the error + * @param string|null $sub_category A specific category that contains more specific detail about the error * * @return self */ - public function setErrors($errors) + public function setSubCategory($sub_category) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['errors'] = $errors; + $this->container['sub_category'] = $sub_category; return $this; } /** * 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/Objects/Calls/Model/ErrorDetail.php b/codegen/Crm/Objects/Calls/Model/ErrorDetail.php index 04aa185e..ab9cf2aa 100644 --- a/codegen/Crm/Objects/Calls/Model/ErrorDetail.php +++ b/codegen/Crm/Objects/Calls/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,11 +57,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'string', 'code' => 'string', - 'in' => 'string', 'context' => 'array', - 'message' => 'string' + 'in' => 'string', + 'message' => 'string', + 'sub_category' => 'string' ]; /** @@ -72,11 +72,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, 'code' => null, - 'in' => null, 'context' => null, - 'message' => null + 'in' => null, + 'message' => null, + 'sub_category' => null ]; /** @@ -85,11 +85,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, 'code' => false, - 'in' => false, 'context' => false, - 'message' => false + 'in' => false, + 'message' => false, + 'sub_category' => false ]; /** @@ -178,11 +178,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', 'code' => 'code', - 'in' => 'in', 'context' => 'context', - 'message' => 'message' + 'in' => 'in', + 'message' => 'message', + 'sub_category' => 'subCategory' ]; /** @@ -191,11 +191,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', 'code' => 'setCode', - 'in' => 'setIn', 'context' => 'setContext', - 'message' => 'setMessage' + 'in' => 'setIn', + 'message' => 'setMessage', + 'sub_category' => 'setSubCategory' ]; /** @@ -204,11 +204,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', 'code' => 'getCode', - 'in' => 'getIn', 'context' => 'getContext', - 'message' => 'getMessage' + 'in' => 'getIn', + 'message' => 'getMessage', + 'sub_category' => 'getSubCategory' ]; /** @@ -268,11 +268,11 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('in', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); + $this->setIfExists('in', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -321,55 +321,55 @@ public function valid() /** - * Gets sub_category + * Gets code * * @return string|null */ - public function getSubCategory() + public function getCode() { - return $this->container['sub_category']; + return $this->container['code']; } /** - * Sets sub_category + * Sets code * - * @param string|null $sub_category A specific category that contains more specific detail about the error + * @param string|null $code The status code associated with the error detail * * @return self */ - public function setSubCategory($sub_category) + public function setCode($code) { - if (is_null($sub_category)) { - throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); } - $this->container['sub_category'] = $sub_category; + $this->container['code'] = $code; return $this; } /** - * Gets code + * Gets context * - * @return string|null + * @return array|null */ - public function getCode() + public function getContext() { - return $this->container['code']; + return $this->container['context']; } /** - * Sets code + * Sets context * - * @param string|null $code The status code associated with the error detail + * @param array|null $context Context about the error condition * * @return self */ - public function setCode($code) + public function setContext($context) { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); + if (is_null($context)) { + throw new \InvalidArgumentException('non-nullable context cannot be null'); } - $this->container['code'] = $code; + $this->container['context'] = $context; return $this; } @@ -402,66 +402,66 @@ public function setIn($in) } /** - * Gets context + * Gets message * - * @return array|null + * @return string */ - public function getContext() + public function getMessage() { - return $this->container['context']; + return $this->container['message']; } /** - * Sets context + * Sets message * - * @param array|null $context Context about the error condition + * @param string $message A human readable message describing the error along with remediation steps where appropriate * * @return self */ - public function setContext($context) + public function setMessage($message) { - if (is_null($context)) { - throw new \InvalidArgumentException('non-nullable context cannot be null'); + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - $this->container['context'] = $context; + $this->container['message'] = $message; return $this; } /** - * Gets message + * Gets sub_category * - * @return string + * @return string|null */ - public function getMessage() + public function getSubCategory() { - return $this->container['message']; + return $this->container['sub_category']; } /** - * Sets message + * Sets sub_category * - * @param string $message A human readable message describing the error along with remediation steps where appropriate + * @param string|null $sub_category A specific category that contains more specific detail about the error * * @return self */ - public function setMessage($message) + public function setSubCategory($sub_category) { - if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['message'] = $message; + $this->container['sub_category'] = $sub_category; return $this; } /** * 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/Objects/Calls/Model/Filter.php b/codegen/Crm/Objects/Calls/Model/Filter.php index 3fef2cf0..4b53034f 100644 --- a/codegen/Crm/Objects/Calls/Model/Filter.php +++ b/codegen/Crm/Objects/Calls/Model/Filter.php @@ -2,7 +2,7 @@ /** * Filter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * Filter Class Doc Comment * * @category Class + * @description Defines a single condition for searching CRM objects, specifying the property to filter on, the operator to use (such as equals, greater than, or contains), and the value(s) to compare against. * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,10 +59,10 @@ class Filter implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'high_value' => 'string', + 'operator' => 'string', 'property_name' => 'string', - 'values' => 'string[]', 'value' => 'string', - 'operator' => 'string' + 'values' => 'string[]' ]; /** @@ -73,10 +74,10 @@ class Filter implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'high_value' => null, + 'operator' => null, 'property_name' => null, - 'values' => null, 'value' => null, - 'operator' => null + 'values' => null ]; /** @@ -86,10 +87,10 @@ class Filter implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'high_value' => false, + 'operator' => false, 'property_name' => false, - 'values' => false, 'value' => false, - 'operator' => false + 'values' => false ]; /** @@ -179,10 +180,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'high_value' => 'highValue', + 'operator' => 'operator', 'property_name' => 'propertyName', - 'values' => 'values', 'value' => 'value', - 'operator' => 'operator' + 'values' => 'values' ]; /** @@ -192,10 +193,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'high_value' => 'setHighValue', + 'operator' => 'setOperator', 'property_name' => 'setPropertyName', - 'values' => 'setValues', 'value' => 'setValue', - 'operator' => 'setOperator' + 'values' => 'setValues' ]; /** @@ -205,10 +206,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'high_value' => 'getHighValue', + 'operator' => 'getOperator', 'property_name' => 'getPropertyName', - 'values' => 'getValues', 'value' => 'getValue', - 'operator' => 'getOperator' + 'values' => 'getValues' ]; /** @@ -252,19 +253,19 @@ public function getModelName() return self::$openAPIModelName; } + public const OPERATOR_BETWEEN = 'BETWEEN'; + public const OPERATOR_CONTAINS_TOKEN = 'CONTAINS_TOKEN'; public const OPERATOR_EQ = 'EQ'; - public const OPERATOR_NEQ = 'NEQ'; - public const OPERATOR_LT = 'LT'; - public const OPERATOR_LTE = 'LTE'; public const OPERATOR_GT = 'GT'; public const OPERATOR_GTE = 'GTE'; - public const OPERATOR_BETWEEN = 'BETWEEN'; - public const OPERATOR_IN = 'IN'; - public const OPERATOR_NOT_IN = 'NOT_IN'; public const OPERATOR_HAS_PROPERTY = 'HAS_PROPERTY'; - public const OPERATOR_NOT_HAS_PROPERTY = 'NOT_HAS_PROPERTY'; - public const OPERATOR_CONTAINS_TOKEN = 'CONTAINS_TOKEN'; + public const OPERATOR_IN = 'IN'; + public const OPERATOR_LT = 'LT'; + public const OPERATOR_LTE = 'LTE'; + public const OPERATOR_NEQ = 'NEQ'; public const OPERATOR_NOT_CONTAINS_TOKEN = 'NOT_CONTAINS_TOKEN'; + public const OPERATOR_NOT_HAS_PROPERTY = 'NOT_HAS_PROPERTY'; + public const OPERATOR_NOT_IN = 'NOT_IN'; /** * Gets allowable values of the enum @@ -274,19 +275,19 @@ public function getModelName() public function getOperatorAllowableValues() { return [ + self::OPERATOR_BETWEEN, + self::OPERATOR_CONTAINS_TOKEN, self::OPERATOR_EQ, - self::OPERATOR_NEQ, - self::OPERATOR_LT, - self::OPERATOR_LTE, self::OPERATOR_GT, self::OPERATOR_GTE, - self::OPERATOR_BETWEEN, - self::OPERATOR_IN, - self::OPERATOR_NOT_IN, self::OPERATOR_HAS_PROPERTY, - self::OPERATOR_NOT_HAS_PROPERTY, - self::OPERATOR_CONTAINS_TOKEN, + self::OPERATOR_IN, + self::OPERATOR_LT, + self::OPERATOR_LTE, + self::OPERATOR_NEQ, self::OPERATOR_NOT_CONTAINS_TOKEN, + self::OPERATOR_NOT_HAS_PROPERTY, + self::OPERATOR_NOT_IN, ]; } @@ -306,10 +307,10 @@ public function getOperatorAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('high_value', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); $this->setIfExists('property_name', $data ?? [], null); - $this->setIfExists('values', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); - $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); } /** @@ -339,9 +340,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['property_name'] === null) { - $invalidProperties[] = "'property_name' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } @@ -354,6 +352,9 @@ public function listInvalidProperties() ); } + if ($this->container['property_name'] === null) { + $invalidProperties[] = "'property_name' can't be null"; + } return $invalidProperties; } @@ -382,7 +383,7 @@ public function getHighValue() /** * Sets high_value * - * @param string|null $high_value high_value + * @param string|null $high_value The upper boundary value when using ranged-based filters. * * @return self */ @@ -397,55 +398,65 @@ public function setHighValue($high_value) } /** - * Gets property_name + * Gets operator * * @return string */ - public function getPropertyName() + public function getOperator() { - return $this->container['property_name']; + return $this->container['operator']; } /** - * Sets property_name + * Sets operator * - * @param string $property_name property_name + * @param string $operator null * * @return self */ - public function setPropertyName($property_name) + public function setOperator($operator) { - if (is_null($property_name)) { - throw new \InvalidArgumentException('non-nullable property_name cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['property_name'] = $property_name; + $allowedValues = $this->getOperatorAllowableValues(); + if (!in_array($operator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'operator', must be one of '%s'", + $operator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['operator'] = $operator; return $this; } /** - * Gets values + * Gets property_name * - * @return string[]|null + * @return string */ - public function getValues() + public function getPropertyName() { - return $this->container['values']; + return $this->container['property_name']; } /** - * Sets values + * Sets property_name * - * @param string[]|null $values values + * @param string $property_name The name of the property to apply the filter to. * * @return self */ - public function setValues($values) + public function setPropertyName($property_name) { - if (is_null($values)) { - throw new \InvalidArgumentException('non-nullable values cannot be null'); + if (is_null($property_name)) { + throw new \InvalidArgumentException('non-nullable property_name cannot be null'); } - $this->container['values'] = $values; + $this->container['property_name'] = $property_name; return $this; } @@ -463,7 +474,7 @@ public function getValue() /** * Sets value * - * @param string|null $value value + * @param string|null $value The value to match against the property. * * @return self */ @@ -478,49 +489,39 @@ public function setValue($value) } /** - * Gets operator + * Gets values * - * @return string + * @return string[]|null */ - public function getOperator() + public function getValues() { - return $this->container['operator']; + return $this->container['values']; } /** - * Sets operator + * Sets values * - * @param string $operator null + * @param string[]|null $values The values to match against the property. * * @return self */ - public function setOperator($operator) + public function setValues($values) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); - } - $allowedValues = $this->getOperatorAllowableValues(); - if (!in_array($operator, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'operator', must be one of '%s'", - $operator, - implode("', '", $allowedValues) - ) - ); + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); } - $this->container['operator'] = $operator; + $this->container['values'] = $values; return $this; } /** * 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]); } @@ -528,12 +529,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; } @@ -558,11 +559,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/Objects/Calls/Model/FilterGroup.php b/codegen/Crm/Objects/Calls/Model/FilterGroup.php index cd9cae9d..5d829565 100644 --- a/codegen/Crm/Objects/Calls/Model/FilterGroup.php +++ b/codegen/Crm/Objects/Calls/Model/FilterGroup.php @@ -2,7 +2,7 @@ /** * FilterGroup * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -321,11 +321,11 @@ public function setFilters($filters) /** * 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/Objects/Calls/Model/ForwardPaging.php b/codegen/Crm/Objects/Calls/Model/ForwardPaging.php deleted file mode 100644 index c869aa8d..00000000 --- a/codegen/Crm/Objects/Calls/Model/ForwardPaging.php +++ /dev/null @@ -1,409 +0,0 @@ - - */ -class ForwardPaging implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'ForwardPaging'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'next' => '\HubSpot\Client\Crm\Objects\Calls\Model\NextPage' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'next' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'next' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'next' => 'next' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'next' => 'setNext' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'next' => 'getNext' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('next', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets next - * - * @return \HubSpot\Client\Crm\Objects\Calls\Model\NextPage|null - */ - public function getNext() - { - return $this->container['next']; - } - - /** - * Sets next - * - * @param \HubSpot\Client\Crm\Objects\Calls\Model\NextPage|null $next next - * - * @return self - */ - public function setNext($next) - { - if (is_null($next)) { - throw new \InvalidArgumentException('non-nullable next cannot be null'); - } - $this->container['next'] = $next; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/codegen/Crm/Objects/Calls/Model/ModelInterface.php b/codegen/Crm/Objects/Calls/Model/ModelInterface.php index 7e6eecef..480832b9 100644 --- a/codegen/Crm/Objects/Calls/Model/ModelInterface.php +++ b/codegen/Crm/Objects/Calls/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls\Model @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/Calls/Model/NextPage.php b/codegen/Crm/Objects/Calls/Model/NextPage.php index 94f3a666..d8ce9612 100644 --- a/codegen/Crm/Objects/Calls/Model/NextPage.php +++ b/codegen/Crm/Objects/Calls/Model/NextPage.php @@ -2,7 +2,7 @@ /** * NextPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * NextPage Class Doc Comment * * @category Class + * @description Specifies the paging information needed to retrieve the next set of results in a paginated API response * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,8 +58,8 @@ class NextPage implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'link' => 'string', - 'after' => 'string' + 'after' => 'string', + 'link' => 'string' ]; /** @@ -69,8 +70,8 @@ class NextPage implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'link' => null, - 'after' => null + 'after' => null, + 'link' => null ]; /** @@ -79,8 +80,8 @@ class NextPage implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'link' => false, - 'after' => false + 'after' => false, + 'link' => false ]; /** @@ -169,8 +170,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'link' => 'link', - 'after' => 'after' + 'after' => 'after', + 'link' => 'link' ]; /** @@ -179,8 +180,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'link' => 'setLink', - 'after' => 'setAfter' + 'after' => 'setAfter', + 'link' => 'setLink' ]; /** @@ -189,8 +190,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'link' => 'getLink', - 'after' => 'getAfter' + 'after' => 'getAfter', + 'link' => 'getLink' ]; /** @@ -250,8 +251,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('link', $data ?? [], null); $this->setIfExists('after', $data ?? [], null); + $this->setIfExists('link', $data ?? [], null); } /** @@ -300,66 +301,66 @@ public function valid() /** - * Gets link + * Gets after * - * @return string|null + * @return string */ - public function getLink() + public function getAfter() { - return $this->container['link']; + return $this->container['after']; } /** - * Sets link + * Sets after * - * @param string|null $link link + * @param string $after A paging cursor token for retrieving subsequent pages. * * @return self */ - public function setLink($link) + public function setAfter($after) { - if (is_null($link)) { - throw new \InvalidArgumentException('non-nullable link cannot be null'); + if (is_null($after)) { + throw new \InvalidArgumentException('non-nullable after cannot be null'); } - $this->container['link'] = $link; + $this->container['after'] = $after; return $this; } /** - * Gets after + * Gets link * - * @return string + * @return string|null */ - public function getAfter() + public function getLink() { - return $this->container['after']; + return $this->container['link']; } /** - * Sets after + * Sets link * - * @param string $after after + * @param string|null $link A URL that can be used to retrieve the next page results. * * @return self */ - public function setAfter($after) + public function setLink($link) { - if (is_null($after)) { - throw new \InvalidArgumentException('non-nullable after cannot be null'); + if (is_null($link)) { + throw new \InvalidArgumentException('non-nullable link cannot be null'); } - $this->container['after'] = $after; + $this->container['link'] = $link; return $this; } /** * 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]); } @@ -367,12 +368,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; } @@ -397,11 +398,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/Objects/Calls/Model/Paging.php b/codegen/Crm/Objects/Calls/Model/Paging.php index 67cc4ab7..ea868c4c 100644 --- a/codegen/Crm/Objects/Calls/Model/Paging.php +++ b/codegen/Crm/Objects/Calls/Model/Paging.php @@ -2,7 +2,7 @@ /** * Paging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -352,11 +352,11 @@ public function setPrev($prev) /** * 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]); } @@ -364,12 +364,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; } @@ -394,11 +394,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/Objects/Calls/Model/PreviousPage.php b/codegen/Crm/Objects/Calls/Model/PreviousPage.php index ba12ddc8..07652b63 100644 --- a/codegen/Crm/Objects/Calls/Model/PreviousPage.php +++ b/codegen/Crm/Objects/Calls/Model/PreviousPage.php @@ -2,7 +2,7 @@ /** * PreviousPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * PreviousPage Class Doc Comment * * @category Class + * @description specifies the paging information needed to retrieve the previous set of results in a paginated API response * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -312,7 +313,7 @@ public function getBefore() /** * Sets before * - * @param string $before before + * @param string $before A paging cursor token for retrieving previous pages. * * @return self */ @@ -339,7 +340,7 @@ public function getLink() /** * Sets link * - * @param string|null $link link + * @param string|null $link A URL that can be used to retrieve the previous pages' results. * * @return self */ @@ -355,11 +356,11 @@ public function setLink($link) /** * 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]); } @@ -367,12 +368,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; } @@ -397,11 +398,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/Objects/Calls/Model/PublicAssociationsForObject.php b/codegen/Crm/Objects/Calls/Model/PublicAssociationsForObject.php index 768b8646..d6571404 100644 --- a/codegen/Crm/Objects/Calls/Model/PublicAssociationsForObject.php +++ b/codegen/Crm/Objects/Calls/Model/PublicAssociationsForObject.php @@ -2,7 +2,7 @@ /** * PublicAssociationsForObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,8 +57,8 @@ class PublicAssociationsForObject implements ModelInterface, ArrayAccess, \JsonS * @var string[] */ protected static $openAPITypes = [ - 'types' => '\HubSpot\Client\Crm\Objects\Calls\Model\AssociationSpec[]', - 'to' => '\HubSpot\Client\Crm\Objects\Calls\Model\PublicObjectId' + 'to' => '\HubSpot\Client\Crm\Objects\Calls\Model\PublicObjectId', + 'types' => '\HubSpot\Client\Crm\Objects\Calls\Model\AssociationSpec[]' ]; /** @@ -69,8 +69,8 @@ class PublicAssociationsForObject implements ModelInterface, ArrayAccess, \JsonS * @psalm-var array */ protected static $openAPIFormats = [ - 'types' => null, - 'to' => null + 'to' => null, + 'types' => null ]; /** @@ -79,8 +79,8 @@ class PublicAssociationsForObject implements ModelInterface, ArrayAccess, \JsonS * @var boolean[] */ protected static array $openAPINullables = [ - 'types' => false, - 'to' => false + 'to' => false, + 'types' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'types' => 'types', - 'to' => 'to' + 'to' => 'to', + 'types' => 'types' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'types' => 'setTypes', - 'to' => 'setTo' + 'to' => 'setTo', + 'types' => 'setTypes' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'types' => 'getTypes', - 'to' => 'getTo' + 'to' => 'getTo', + 'types' => 'getTypes' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('types', $data ?? [], null); $this->setIfExists('to', $data ?? [], null); + $this->setIfExists('types', $data ?? [], null); } /** @@ -281,12 +281,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['types'] === null) { - $invalidProperties[] = "'types' can't be null"; - } if ($this->container['to'] === null) { $invalidProperties[] = "'to' can't be null"; } + if ($this->container['types'] === null) { + $invalidProperties[] = "'types' can't be null"; + } return $invalidProperties; } @@ -303,66 +303,66 @@ public function valid() /** - * Gets types + * Gets to * - * @return \HubSpot\Client\Crm\Objects\Calls\Model\AssociationSpec[] + * @return \HubSpot\Client\Crm\Objects\Calls\Model\PublicObjectId */ - public function getTypes() + public function getTo() { - return $this->container['types']; + return $this->container['to']; } /** - * Sets types + * Sets to * - * @param \HubSpot\Client\Crm\Objects\Calls\Model\AssociationSpec[] $types types + * @param \HubSpot\Client\Crm\Objects\Calls\Model\PublicObjectId $to to * * @return self */ - public function setTypes($types) + public function setTo($to) { - if (is_null($types)) { - throw new \InvalidArgumentException('non-nullable types cannot be null'); + if (is_null($to)) { + throw new \InvalidArgumentException('non-nullable to cannot be null'); } - $this->container['types'] = $types; + $this->container['to'] = $to; return $this; } /** - * Gets to + * Gets types * - * @return \HubSpot\Client\Crm\Objects\Calls\Model\PublicObjectId + * @return \HubSpot\Client\Crm\Objects\Calls\Model\AssociationSpec[] */ - public function getTo() + public function getTypes() { - return $this->container['to']; + return $this->container['types']; } /** - * Sets to + * Sets types * - * @param \HubSpot\Client\Crm\Objects\Calls\Model\PublicObjectId $to to + * @param \HubSpot\Client\Crm\Objects\Calls\Model\AssociationSpec[] $types types * * @return self */ - public function setTo($to) + public function setTypes($types) { - if (is_null($to)) { - throw new \InvalidArgumentException('non-nullable to cannot be null'); + if (is_null($types)) { + throw new \InvalidArgumentException('non-nullable types cannot be null'); } - $this->container['to'] = $to; + $this->container['types'] = $types; return $this; } /** * 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/Objects/Calls/Model/PublicObjectId.php b/codegen/Crm/Objects/Calls/Model/PublicObjectId.php index 5142ec28..d3d9d6b1 100644 --- a/codegen/Crm/Objects/Calls/Model/PublicObjectId.php +++ b/codegen/Crm/Objects/Calls/Model/PublicObjectId.php @@ -2,7 +2,7 @@ /** * PublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * PublicObjectId Class Doc Comment * * @category Class + * @description Contains the Id of a Public Object * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -305,7 +306,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -321,11 +322,11 @@ public function setId($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]); } @@ -333,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; } @@ -363,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/Objects/Calls/Model/PublicObjectSearchRequest.php b/codegen/Crm/Objects/Calls/Model/PublicObjectSearchRequest.php index 6dde2743..9ee52972 100644 --- a/codegen/Crm/Objects/Calls/Model/PublicObjectSearchRequest.php +++ b/codegen/Crm/Objects/Calls/Model/PublicObjectSearchRequest.php @@ -2,7 +2,7 @@ /** * PublicObjectSearchRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * PublicObjectSearchRequest Class Doc Comment * * @category Class + * @description Describes a search request * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,12 +58,12 @@ class PublicObjectSearchRequest implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ - 'query' => 'string', - 'limit' => 'int', 'after' => 'string', - 'sorts' => 'string[]', + 'filter_groups' => '\HubSpot\Client\Crm\Objects\Calls\Model\FilterGroup[]', + 'limit' => 'int', 'properties' => 'string[]', - 'filter_groups' => '\HubSpot\Client\Crm\Objects\Calls\Model\FilterGroup[]' + 'query' => 'string', + 'sorts' => 'string[]' ]; /** @@ -73,12 +74,12 @@ class PublicObjectSearchRequest implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ - 'query' => null, - 'limit' => 'int32', 'after' => null, - 'sorts' => null, + 'filter_groups' => null, + 'limit' => 'int32', 'properties' => null, - 'filter_groups' => null + 'query' => null, + 'sorts' => null ]; /** @@ -87,12 +88,12 @@ class PublicObjectSearchRequest implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static array $openAPINullables = [ - 'query' => false, - 'limit' => false, 'after' => false, - 'sorts' => false, + 'filter_groups' => false, + 'limit' => false, 'properties' => false, - 'filter_groups' => false + 'query' => false, + 'sorts' => false ]; /** @@ -181,12 +182,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'query' => 'query', - 'limit' => 'limit', 'after' => 'after', - 'sorts' => 'sorts', + 'filter_groups' => 'filterGroups', + 'limit' => 'limit', 'properties' => 'properties', - 'filter_groups' => 'filterGroups' + 'query' => 'query', + 'sorts' => 'sorts' ]; /** @@ -195,12 +196,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'query' => 'setQuery', - 'limit' => 'setLimit', 'after' => 'setAfter', - 'sorts' => 'setSorts', + 'filter_groups' => 'setFilterGroups', + 'limit' => 'setLimit', 'properties' => 'setProperties', - 'filter_groups' => 'setFilterGroups' + 'query' => 'setQuery', + 'sorts' => 'setSorts' ]; /** @@ -209,12 +210,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'query' => 'getQuery', - 'limit' => 'getLimit', 'after' => 'getAfter', - 'sorts' => 'getSorts', + 'filter_groups' => 'getFilterGroups', + 'limit' => 'getLimit', 'properties' => 'getProperties', - 'filter_groups' => 'getFilterGroups' + 'query' => 'getQuery', + 'sorts' => 'getSorts' ]; /** @@ -274,12 +275,12 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('query', $data ?? [], null); - $this->setIfExists('limit', $data ?? [], null); $this->setIfExists('after', $data ?? [], null); - $this->setIfExists('sorts', $data ?? [], null); - $this->setIfExists('properties', $data ?? [], null); $this->setIfExists('filter_groups', $data ?? [], null); + $this->setIfExists('limit', $data ?? [], null); + $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('query', $data ?? [], null); + $this->setIfExists('sorts', $data ?? [], null); } /** @@ -325,174 +326,174 @@ public function valid() /** - * Gets query + * Gets after * * @return string|null */ - public function getQuery() + public function getAfter() { - return $this->container['query']; + return $this->container['after']; } /** - * Sets query + * Sets after * - * @param string|null $query query + * @param string|null $after A paging cursor token for retrieving subsequent pages. * * @return self */ - public function setQuery($query) + public function setAfter($after) { - if (is_null($query)) { - throw new \InvalidArgumentException('non-nullable query cannot be null'); + if (is_null($after)) { + throw new \InvalidArgumentException('non-nullable after cannot be null'); } - $this->container['query'] = $query; + $this->container['after'] = $after; return $this; } /** - * Gets limit + * Gets filter_groups * - * @return int|null + * @return \HubSpot\Client\Crm\Objects\Calls\Model\FilterGroup[]|null */ - public function getLimit() + public function getFilterGroups() { - return $this->container['limit']; + return $this->container['filter_groups']; } /** - * Sets limit + * Sets filter_groups * - * @param int|null $limit limit + * @param \HubSpot\Client\Crm\Objects\Calls\Model\FilterGroup[]|null $filter_groups Up to 6 groups of filters defining additional query criteria. * * @return self */ - public function setLimit($limit) + public function setFilterGroups($filter_groups) { - if (is_null($limit)) { - throw new \InvalidArgumentException('non-nullable limit cannot be null'); + if (is_null($filter_groups)) { + throw new \InvalidArgumentException('non-nullable filter_groups cannot be null'); } - $this->container['limit'] = $limit; + $this->container['filter_groups'] = $filter_groups; return $this; } /** - * Gets after + * Gets limit * - * @return string|null + * @return int|null */ - public function getAfter() + public function getLimit() { - return $this->container['after']; + return $this->container['limit']; } /** - * Sets after + * Sets limit * - * @param string|null $after after + * @param int|null $limit The maximum results to return, up to 200 objects. * * @return self */ - public function setAfter($after) + public function setLimit($limit) { - if (is_null($after)) { - throw new \InvalidArgumentException('non-nullable after cannot be null'); + if (is_null($limit)) { + throw new \InvalidArgumentException('non-nullable limit cannot be null'); } - $this->container['after'] = $after; + $this->container['limit'] = $limit; return $this; } /** - * Gets sorts + * Gets properties * * @return string[]|null */ - public function getSorts() + public function getProperties() { - return $this->container['sorts']; + return $this->container['properties']; } /** - * Sets sorts + * Sets properties * - * @param string[]|null $sorts sorts + * @param string[]|null $properties A list of property names to include in the response. * * @return self */ - public function setSorts($sorts) + public function setProperties($properties) { - if (is_null($sorts)) { - throw new \InvalidArgumentException('non-nullable sorts cannot be null'); + if (is_null($properties)) { + throw new \InvalidArgumentException('non-nullable properties cannot be null'); } - $this->container['sorts'] = $sorts; + $this->container['properties'] = $properties; return $this; } /** - * Gets properties + * Gets query * - * @return string[]|null + * @return string|null */ - public function getProperties() + public function getQuery() { - return $this->container['properties']; + return $this->container['query']; } /** - * Sets properties + * Sets query * - * @param string[]|null $properties properties + * @param string|null $query The search query string, up to 3000 characters. * * @return self */ - public function setProperties($properties) + public function setQuery($query) { - if (is_null($properties)) { - throw new \InvalidArgumentException('non-nullable properties cannot be null'); + if (is_null($query)) { + throw new \InvalidArgumentException('non-nullable query cannot be null'); } - $this->container['properties'] = $properties; + $this->container['query'] = $query; return $this; } /** - * Gets filter_groups + * Gets sorts * - * @return \HubSpot\Client\Crm\Objects\Calls\Model\FilterGroup[]|null + * @return string[]|null */ - public function getFilterGroups() + public function getSorts() { - return $this->container['filter_groups']; + return $this->container['sorts']; } /** - * Sets filter_groups + * Sets sorts * - * @param \HubSpot\Client\Crm\Objects\Calls\Model\FilterGroup[]|null $filter_groups filter_groups + * @param string[]|null $sorts Specifies sorting order based on object properties. * * @return self */ - public function setFilterGroups($filter_groups) + public function setSorts($sorts) { - if (is_null($filter_groups)) { - throw new \InvalidArgumentException('non-nullable filter_groups cannot be null'); + if (is_null($sorts)) { + throw new \InvalidArgumentException('non-nullable sorts cannot be null'); } - $this->container['filter_groups'] = $filter_groups; + $this->container['sorts'] = $sorts; return $this; } /** * 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]); } @@ -500,12 +501,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; } @@ -530,11 +531,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/Objects/Calls/Model/SimplePublicObject.php b/codegen/Crm/Objects/Calls/Model/SimplePublicObject.php index 36e81782..7e60ea00 100644 --- a/codegen/Crm/Objects/Calls/Model/SimplePublicObject.php +++ b/codegen/Crm/Objects/Calls/Model/SimplePublicObject.php @@ -2,7 +2,7 @@ /** * SimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObject Class Doc Comment * * @category Class + * @description A simple public object. * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,13 +58,13 @@ class SimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'created_at' => '\DateTime', 'archived' => 'bool', 'archived_at' => '\DateTime', - 'properties_with_history' => 'array', + 'created_at' => '\DateTime', 'id' => 'string', 'object_write_trace_id' => 'string', 'properties' => 'array', + 'properties_with_history' => 'array', 'updated_at' => '\DateTime' ]; @@ -75,13 +76,13 @@ class SimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ - 'created_at' => 'date-time', 'archived' => null, 'archived_at' => 'date-time', - 'properties_with_history' => null, + 'created_at' => 'date-time', 'id' => null, 'object_write_trace_id' => null, 'properties' => null, + 'properties_with_history' => null, 'updated_at' => 'date-time' ]; @@ -91,13 +92,13 @@ class SimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializab * @var boolean[] */ protected static array $openAPINullables = [ - 'created_at' => false, 'archived' => false, 'archived_at' => false, - 'properties_with_history' => false, + 'created_at' => false, 'id' => false, 'object_write_trace_id' => false, 'properties' => false, + 'properties_with_history' => false, 'updated_at' => false ]; @@ -187,13 +188,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'created_at' => 'createdAt', 'archived' => 'archived', 'archived_at' => 'archivedAt', - 'properties_with_history' => 'propertiesWithHistory', + 'created_at' => 'createdAt', 'id' => 'id', 'object_write_trace_id' => 'objectWriteTraceId', 'properties' => 'properties', + 'properties_with_history' => 'propertiesWithHistory', 'updated_at' => 'updatedAt' ]; @@ -203,13 +204,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'created_at' => 'setCreatedAt', 'archived' => 'setArchived', 'archived_at' => 'setArchivedAt', - 'properties_with_history' => 'setPropertiesWithHistory', + 'created_at' => 'setCreatedAt', 'id' => 'setId', 'object_write_trace_id' => 'setObjectWriteTraceId', 'properties' => 'setProperties', + 'properties_with_history' => 'setPropertiesWithHistory', 'updated_at' => 'setUpdatedAt' ]; @@ -219,13 +220,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'created_at' => 'getCreatedAt', 'archived' => 'getArchived', 'archived_at' => 'getArchivedAt', - 'properties_with_history' => 'getPropertiesWithHistory', + 'created_at' => 'getCreatedAt', 'id' => 'getId', 'object_write_trace_id' => 'getObjectWriteTraceId', 'properties' => 'getProperties', + 'properties_with_history' => 'getPropertiesWithHistory', 'updated_at' => 'getUpdatedAt' ]; @@ -286,13 +287,13 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('archived', $data ?? [], null); $this->setIfExists('archived_at', $data ?? [], null); - $this->setIfExists('properties_with_history', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('properties_with_history', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); } @@ -323,6 +324,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['archived'] === null) { + $invalidProperties[] = "'archived' can't be null"; + } if ($this->container['created_at'] === null) { $invalidProperties[] = "'created_at' can't be null"; } @@ -350,37 +354,10 @@ public function valid() } - /** - * Gets created_at - * - * @return \DateTime - */ - public function getCreatedAt() - { - return $this->container['created_at']; - } - - /** - * Sets created_at - * - * @param \DateTime $created_at created_at - * - * @return self - */ - public function setCreatedAt($created_at) - { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); - } - $this->container['created_at'] = $created_at; - - return $this; - } - /** * Gets archived * - * @return bool|null + * @return bool */ public function getArchived() { @@ -390,7 +367,7 @@ public function getArchived() /** * Sets archived * - * @param bool|null $archived archived + * @param bool $archived Whether the object is archived. * * @return self */ @@ -417,7 +394,7 @@ public function getArchivedAt() /** * Sets archived_at * - * @param \DateTime|null $archived_at archived_at + * @param \DateTime|null $archived_at The timestamp when the object was archived, in ISO 8601 format. * * @return self */ @@ -432,28 +409,28 @@ public function setArchivedAt($archived_at) } /** - * Gets properties_with_history + * Gets created_at * - * @return array|null + * @return \DateTime */ - public function getPropertiesWithHistory() + public function getCreatedAt() { - return $this->container['properties_with_history']; + return $this->container['created_at']; } /** - * Sets properties_with_history + * Sets created_at * - * @param array|null $properties_with_history properties_with_history + * @param \DateTime $created_at The timestamp when the object was created, in ISO 8601 format. * * @return self */ - public function setPropertiesWithHistory($properties_with_history) + public function setCreatedAt($created_at) { - if (is_null($properties_with_history)) { - throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['properties_with_history'] = $properties_with_history; + $this->container['created_at'] = $created_at; return $this; } @@ -471,7 +448,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -498,7 +475,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id An identifier used for tracing the write request for the object. * * @return self */ @@ -525,7 +502,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key-value pairs representing the properties of the object. * * @return self */ @@ -539,6 +516,33 @@ public function setProperties($properties) return $this; } + /** + * Gets properties_with_history + * + * @return array|null + */ + public function getPropertiesWithHistory() + { + return $this->container['properties_with_history']; + } + + /** + * Sets properties_with_history + * + * @param array|null $properties_with_history Key-value pairs representing the properties of the object along with their history. + * + * @return self + */ + public function setPropertiesWithHistory($properties_with_history) + { + if (is_null($properties_with_history)) { + throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + } + $this->container['properties_with_history'] = $properties_with_history; + + return $this; + } + /** * Gets updated_at * @@ -552,7 +556,7 @@ public function getUpdatedAt() /** * Sets updated_at * - * @param \DateTime $updated_at updated_at + * @param \DateTime $updated_at The timestamp when the object was last updated, in ISO 8601 format. * * @return self */ @@ -568,11 +572,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]); } @@ -580,12 +584,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; } @@ -610,11 +614,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/Objects/Calls/Model/SimplePublicObjectBatchInput.php b/codegen/Crm/Objects/Calls/Model/SimplePublicObjectBatchInput.php index ff63afb5..0d2db5e5 100644 --- a/codegen/Crm/Objects/Calls/Model/SimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/Calls/Model/SimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectBatchInput Class Doc Comment * * @category Class + * @description Contains an array of CRM object records to be processed in a batch operation, each defined by their ID and properties. * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,9 +58,9 @@ class SimplePublicObjectBatchInput implements ModelInterface, ArrayAccess, \Json * @var string[] */ protected static $openAPITypes = [ + 'id' => 'string', 'id_property' => 'string', 'object_write_trace_id' => 'string', - 'id' => 'string', 'properties' => 'array' ]; @@ -71,9 +72,9 @@ class SimplePublicObjectBatchInput implements ModelInterface, ArrayAccess, \Json * @psalm-var array */ protected static $openAPIFormats = [ + 'id' => null, 'id_property' => null, 'object_write_trace_id' => null, - 'id' => null, 'properties' => null ]; @@ -83,9 +84,9 @@ class SimplePublicObjectBatchInput implements ModelInterface, ArrayAccess, \Json * @var boolean[] */ protected static array $openAPINullables = [ + 'id' => false, 'id_property' => false, 'object_write_trace_id' => false, - 'id' => false, 'properties' => false ]; @@ -175,9 +176,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'id' => 'id', 'id_property' => 'idProperty', 'object_write_trace_id' => 'objectWriteTraceId', - 'id' => 'id', 'properties' => 'properties' ]; @@ -187,9 +188,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'id' => 'setId', 'id_property' => 'setIdProperty', 'object_write_trace_id' => 'setObjectWriteTraceId', - 'id' => 'setId', 'properties' => 'setProperties' ]; @@ -199,9 +200,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'id' => 'getId', 'id_property' => 'getIdProperty', 'object_write_trace_id' => 'getObjectWriteTraceId', - 'id' => 'getId', 'properties' => 'getProperties' ]; @@ -262,9 +263,9 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('id', $data ?? [], null); $this->setIfExists('id_property', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); - $this->setIfExists('id', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); } @@ -316,6 +317,33 @@ public function valid() } + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The id to be updated. This can be the object id, or the unique property value of the idProperty property + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** * Gets id_property * @@ -356,7 +384,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id A unique identifier for tracing the request. * * @return self */ @@ -370,33 +398,6 @@ public function setObjectWriteTraceId($object_write_trace_id) return $this; } - /** - * Gets id - * - * @return string - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param string $id The id to be updated. This can be the object id, or the unique property value of the idProperty property - * - * @return self - */ - public function setId($id) - { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); - } - $this->container['id'] = $id; - - return $this; - } - /** * Gets properties * @@ -410,7 +411,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key-value pairs representing the properties of the object. * * @return self */ @@ -426,11 +427,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]); } @@ -438,12 +439,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; } @@ -468,11 +469,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/Objects/Calls/Model/SimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/Calls/Model/SimplePublicObjectBatchInputForCreate.php index 259608e7..6e1c3ce6 100644 --- a/codegen/Crm/Objects/Calls/Model/SimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/Calls/Model/SimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectBatchInputForCreate Class Doc Comment * * @category Class + * @description An input object that contains a collection of objects to be created together in a batch. * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -346,7 +347,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id An identifier used for tracing the creation or update request of the object. * * @return self */ @@ -373,7 +374,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key value pairs representing the properties of the object. * * @return self */ @@ -389,11 +390,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]); } @@ -401,12 +402,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 +432,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/Objects/Calls/Model/SimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/Calls/Model/SimplePublicObjectBatchInputUpsert.php index 1efd0217..6f0d30bc 100644 --- a/codegen/Crm/Objects/Calls/Model/SimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Objects/Calls/Model/SimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectBatchInputUpsert Class Doc Comment * * @category Class + * @description Represents an object used in batch upsert operations, containing an object’s unique identifier, its properties, and optionally the unique property name and a write trace ID. * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,9 +58,9 @@ class SimplePublicObjectBatchInputUpsert implements ModelInterface, ArrayAccess, * @var string[] */ protected static $openAPITypes = [ + 'id' => 'string', 'id_property' => 'string', 'object_write_trace_id' => 'string', - 'id' => 'string', 'properties' => 'array' ]; @@ -71,9 +72,9 @@ class SimplePublicObjectBatchInputUpsert implements ModelInterface, ArrayAccess, * @psalm-var array */ protected static $openAPIFormats = [ + 'id' => null, 'id_property' => null, 'object_write_trace_id' => null, - 'id' => null, 'properties' => null ]; @@ -83,9 +84,9 @@ class SimplePublicObjectBatchInputUpsert implements ModelInterface, ArrayAccess, * @var boolean[] */ protected static array $openAPINullables = [ + 'id' => false, 'id_property' => false, 'object_write_trace_id' => false, - 'id' => false, 'properties' => false ]; @@ -175,9 +176,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'id' => 'id', 'id_property' => 'idProperty', 'object_write_trace_id' => 'objectWriteTraceId', - 'id' => 'id', 'properties' => 'properties' ]; @@ -187,9 +188,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'id' => 'setId', 'id_property' => 'setIdProperty', 'object_write_trace_id' => 'setObjectWriteTraceId', - 'id' => 'setId', 'properties' => 'setProperties' ]; @@ -199,9 +200,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'id' => 'getId', 'id_property' => 'getIdProperty', 'object_write_trace_id' => 'getObjectWriteTraceId', - 'id' => 'getId', 'properties' => 'getProperties' ]; @@ -262,9 +263,9 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('id', $data ?? [], null); $this->setIfExists('id_property', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); - $this->setIfExists('id', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); } @@ -316,6 +317,33 @@ public function valid() } + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique ID of the object. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** * Gets id_property * @@ -356,7 +384,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id An identifier for tracing the creation request. * * @return self */ @@ -370,33 +398,6 @@ public function setObjectWriteTraceId($object_write_trace_id) return $this; } - /** - * Gets id - * - * @return string - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param string $id id - * - * @return self - */ - public function setId($id) - { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); - } - $this->container['id'] = $id; - - return $this; - } - /** * Gets properties * @@ -410,7 +411,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key value pairs representing the properties of the object. * * @return self */ @@ -426,11 +427,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]); } @@ -438,12 +439,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; } @@ -468,11 +469,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/Objects/Calls/Model/SimplePublicObjectId.php b/codegen/Crm/Objects/Calls/Model/SimplePublicObjectId.php index 86b71747..447e0dc4 100644 --- a/codegen/Crm/Objects/Calls/Model/SimplePublicObjectId.php +++ b/codegen/Crm/Objects/Calls/Model/SimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectId Class Doc Comment * * @category Class + * @description Contains the Id of a Public Object * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -305,7 +306,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -321,11 +322,11 @@ public function setId($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]); } @@ -333,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; } @@ -363,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/Objects/Calls/Model/SimplePublicObjectInput.php b/codegen/Crm/Objects/Calls/Model/SimplePublicObjectInput.php index 884c0549..68fa997d 100644 --- a/codegen/Crm/Objects/Calls/Model/SimplePublicObjectInput.php +++ b/codegen/Crm/Objects/Calls/Model/SimplePublicObjectInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectInput Class Doc Comment * * @category Class + * @description Represents the input required to create or update a CRM object, containing an object with property names and their corresponding values. * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -305,7 +306,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key value pairs representing the properties of the object. * * @return self */ @@ -321,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]); } @@ -333,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; } @@ -363,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/Objects/Calls/Model/SimplePublicObjectInputForCreate.php b/codegen/Crm/Objects/Calls/Model/SimplePublicObjectInputForCreate.php index 864416d6..ecef366a 100644 --- a/codegen/Crm/Objects/Calls/Model/SimplePublicObjectInputForCreate.php +++ b/codegen/Crm/Objects/Calls/Model/SimplePublicObjectInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectInputForCreate Class Doc Comment * * @category Class + * @description Is the input object used to create a new CRM object, containing the properties to be set and optional associations to link the new record with other CRM objects. * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -339,7 +340,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key-value pairs for setting properties for the new object. * * @return self */ @@ -355,11 +356,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]); } @@ -367,12 +368,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; } @@ -397,11 +398,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/Objects/Calls/Model/SimplePublicObjectWithAssociations.php b/codegen/Crm/Objects/Calls/Model/SimplePublicObjectWithAssociations.php index 7c0bf7fc..2af5501e 100644 --- a/codegen/Crm/Objects/Calls/Model/SimplePublicObjectWithAssociations.php +++ b/codegen/Crm/Objects/Calls/Model/SimplePublicObjectWithAssociations.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectWithAssociations * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectWithAssociations Class Doc Comment * * @category Class + * @description Represents a CRM object along with its properties, timestamps, and a set of associated object IDs grouped by association type. * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,14 +58,14 @@ class SimplePublicObjectWithAssociations implements ModelInterface, ArrayAccess, * @var string[] */ protected static $openAPITypes = [ - 'associations' => 'array', - 'created_at' => '\DateTime', 'archived' => 'bool', 'archived_at' => '\DateTime', - 'properties_with_history' => 'array', + 'associations' => 'array', + 'created_at' => '\DateTime', 'id' => 'string', 'object_write_trace_id' => 'string', 'properties' => 'array', + 'properties_with_history' => 'array', 'updated_at' => '\DateTime' ]; @@ -76,14 +77,14 @@ class SimplePublicObjectWithAssociations implements ModelInterface, ArrayAccess, * @psalm-var array */ protected static $openAPIFormats = [ - 'associations' => null, - 'created_at' => 'date-time', 'archived' => null, 'archived_at' => 'date-time', - 'properties_with_history' => null, + 'associations' => null, + 'created_at' => 'date-time', 'id' => null, 'object_write_trace_id' => null, 'properties' => null, + 'properties_with_history' => null, 'updated_at' => 'date-time' ]; @@ -93,14 +94,14 @@ class SimplePublicObjectWithAssociations implements ModelInterface, ArrayAccess, * @var boolean[] */ protected static array $openAPINullables = [ - 'associations' => false, - 'created_at' => false, 'archived' => false, 'archived_at' => false, - 'properties_with_history' => false, + 'associations' => false, + 'created_at' => false, 'id' => false, 'object_write_trace_id' => false, 'properties' => false, + 'properties_with_history' => false, 'updated_at' => false ]; @@ -190,14 +191,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'associations' => 'associations', - 'created_at' => 'createdAt', 'archived' => 'archived', 'archived_at' => 'archivedAt', - 'properties_with_history' => 'propertiesWithHistory', + 'associations' => 'associations', + 'created_at' => 'createdAt', 'id' => 'id', 'object_write_trace_id' => 'objectWriteTraceId', 'properties' => 'properties', + 'properties_with_history' => 'propertiesWithHistory', 'updated_at' => 'updatedAt' ]; @@ -207,14 +208,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'associations' => 'setAssociations', - 'created_at' => 'setCreatedAt', 'archived' => 'setArchived', 'archived_at' => 'setArchivedAt', - 'properties_with_history' => 'setPropertiesWithHistory', + 'associations' => 'setAssociations', + 'created_at' => 'setCreatedAt', 'id' => 'setId', 'object_write_trace_id' => 'setObjectWriteTraceId', 'properties' => 'setProperties', + 'properties_with_history' => 'setPropertiesWithHistory', 'updated_at' => 'setUpdatedAt' ]; @@ -224,14 +225,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'associations' => 'getAssociations', - 'created_at' => 'getCreatedAt', 'archived' => 'getArchived', 'archived_at' => 'getArchivedAt', - 'properties_with_history' => 'getPropertiesWithHistory', + 'associations' => 'getAssociations', + 'created_at' => 'getCreatedAt', 'id' => 'getId', 'object_write_trace_id' => 'getObjectWriteTraceId', 'properties' => 'getProperties', + 'properties_with_history' => 'getPropertiesWithHistory', 'updated_at' => 'getUpdatedAt' ]; @@ -292,14 +293,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('associations', $data ?? [], null); - $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('archived', $data ?? [], null); $this->setIfExists('archived_at', $data ?? [], null); - $this->setIfExists('properties_with_history', $data ?? [], null); + $this->setIfExists('associations', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('properties_with_history', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); } @@ -330,6 +331,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['archived'] === null) { + $invalidProperties[] = "'archived' can't be null"; + } if ($this->container['created_at'] === null) { $invalidProperties[] = "'created_at' can't be null"; } @@ -357,64 +361,10 @@ public function valid() } - /** - * Gets associations - * - * @return array|null - */ - public function getAssociations() - { - return $this->container['associations']; - } - - /** - * Sets associations - * - * @param array|null $associations associations - * - * @return self - */ - public function setAssociations($associations) - { - if (is_null($associations)) { - throw new \InvalidArgumentException('non-nullable associations cannot be null'); - } - $this->container['associations'] = $associations; - - return $this; - } - - /** - * Gets created_at - * - * @return \DateTime - */ - public function getCreatedAt() - { - return $this->container['created_at']; - } - - /** - * Sets created_at - * - * @param \DateTime $created_at created_at - * - * @return self - */ - public function setCreatedAt($created_at) - { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); - } - $this->container['created_at'] = $created_at; - - return $this; - } - /** * Gets archived * - * @return bool|null + * @return bool */ public function getArchived() { @@ -424,7 +374,7 @@ public function getArchived() /** * Sets archived * - * @param bool|null $archived archived + * @param bool $archived Whether the object is archived. * * @return self */ @@ -451,7 +401,7 @@ public function getArchivedAt() /** * Sets archived_at * - * @param \DateTime|null $archived_at archived_at + * @param \DateTime|null $archived_at The timestamp when the object was archived, in ISO 8601 format. * * @return self */ @@ -466,28 +416,55 @@ public function setArchivedAt($archived_at) } /** - * Gets properties_with_history + * Gets associations * - * @return array|null + * @return array|null */ - public function getPropertiesWithHistory() + public function getAssociations() { - return $this->container['properties_with_history']; + return $this->container['associations']; } /** - * Sets properties_with_history + * Sets associations * - * @param array|null $properties_with_history properties_with_history + * @param array|null $associations A list defining relationships with other objects. * * @return self */ - public function setPropertiesWithHistory($properties_with_history) + public function setAssociations($associations) { - if (is_null($properties_with_history)) { - throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + if (is_null($associations)) { + throw new \InvalidArgumentException('non-nullable associations cannot be null'); } - $this->container['properties_with_history'] = $properties_with_history; + $this->container['associations'] = $associations; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime $created_at The timestamp when the object was created, in ISO 8601 format. + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; return $this; } @@ -505,7 +482,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -532,7 +509,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id An identifier used for tracing the creation or update request of the object. * * @return self */ @@ -559,7 +536,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key value pairs representing the properties of the object. * * @return self */ @@ -573,6 +550,33 @@ public function setProperties($properties) return $this; } + /** + * Gets properties_with_history + * + * @return array|null + */ + public function getPropertiesWithHistory() + { + return $this->container['properties_with_history']; + } + + /** + * Sets properties_with_history + * + * @param array|null $properties_with_history Key-value pairs representing the properties of the object along with their history. + * + * @return self + */ + public function setPropertiesWithHistory($properties_with_history) + { + if (is_null($properties_with_history)) { + throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + } + $this->container['properties_with_history'] = $properties_with_history; + + return $this; + } + /** * Gets updated_at * @@ -586,7 +590,7 @@ public function getUpdatedAt() /** * Sets updated_at * - * @param \DateTime $updated_at updated_at + * @param \DateTime $updated_at The timestamp when the object was last updated, in ISO 8601 format. * * @return self */ @@ -602,11 +606,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]); } @@ -614,12 +618,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; } @@ -644,11 +648,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/Objects/Calls/Model/SimplePublicUpsertObject.php b/codegen/Crm/Objects/Calls/Model/SimplePublicUpsertObject.php index 4560e420..b6dee01b 100644 --- a/codegen/Crm/Objects/Calls/Model/SimplePublicUpsertObject.php +++ b/codegen/Crm/Objects/Calls/Model/SimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * SimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicUpsertObject Class Doc Comment * * @category Class + * @description Represents a CRM object that has either been created or updated (upserted) * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,14 +58,14 @@ class SimplePublicUpsertObject implements ModelInterface, ArrayAccess, \JsonSeri * @var string[] */ protected static $openAPITypes = [ - 'created_at' => '\DateTime', 'archived' => 'bool', 'archived_at' => '\DateTime', - 'new' => 'bool', - 'properties_with_history' => 'array', + 'created_at' => '\DateTime', 'id' => 'string', + 'new' => 'bool', 'object_write_trace_id' => 'string', 'properties' => 'array', + 'properties_with_history' => 'array', 'updated_at' => '\DateTime' ]; @@ -76,14 +77,14 @@ class SimplePublicUpsertObject implements ModelInterface, ArrayAccess, \JsonSeri * @psalm-var array */ protected static $openAPIFormats = [ - 'created_at' => 'date-time', 'archived' => null, 'archived_at' => 'date-time', - 'new' => null, - 'properties_with_history' => null, + 'created_at' => 'date-time', 'id' => null, + 'new' => null, 'object_write_trace_id' => null, 'properties' => null, + 'properties_with_history' => null, 'updated_at' => 'date-time' ]; @@ -93,14 +94,14 @@ class SimplePublicUpsertObject implements ModelInterface, ArrayAccess, \JsonSeri * @var boolean[] */ protected static array $openAPINullables = [ - 'created_at' => false, 'archived' => false, 'archived_at' => false, - 'new' => false, - 'properties_with_history' => false, + 'created_at' => false, 'id' => false, + 'new' => false, 'object_write_trace_id' => false, 'properties' => false, + 'properties_with_history' => false, 'updated_at' => false ]; @@ -190,14 +191,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'created_at' => 'createdAt', 'archived' => 'archived', 'archived_at' => 'archivedAt', - 'new' => 'new', - 'properties_with_history' => 'propertiesWithHistory', + 'created_at' => 'createdAt', 'id' => 'id', + 'new' => 'new', 'object_write_trace_id' => 'objectWriteTraceId', 'properties' => 'properties', + 'properties_with_history' => 'propertiesWithHistory', 'updated_at' => 'updatedAt' ]; @@ -207,14 +208,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'created_at' => 'setCreatedAt', 'archived' => 'setArchived', 'archived_at' => 'setArchivedAt', - 'new' => 'setNew', - 'properties_with_history' => 'setPropertiesWithHistory', + 'created_at' => 'setCreatedAt', 'id' => 'setId', + 'new' => 'setNew', 'object_write_trace_id' => 'setObjectWriteTraceId', 'properties' => 'setProperties', + 'properties_with_history' => 'setPropertiesWithHistory', 'updated_at' => 'setUpdatedAt' ]; @@ -224,14 +225,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'created_at' => 'getCreatedAt', 'archived' => 'getArchived', 'archived_at' => 'getArchivedAt', - 'new' => 'getNew', - 'properties_with_history' => 'getPropertiesWithHistory', + 'created_at' => 'getCreatedAt', 'id' => 'getId', + 'new' => 'getNew', 'object_write_trace_id' => 'getObjectWriteTraceId', 'properties' => 'getProperties', + 'properties_with_history' => 'getPropertiesWithHistory', 'updated_at' => 'getUpdatedAt' ]; @@ -292,14 +293,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('archived', $data ?? [], null); $this->setIfExists('archived_at', $data ?? [], null); - $this->setIfExists('new', $data ?? [], null); - $this->setIfExists('properties_with_history', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('new', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('properties_with_history', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); } @@ -330,15 +331,18 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['archived'] === null) { + $invalidProperties[] = "'archived' can't be null"; + } if ($this->container['created_at'] === null) { $invalidProperties[] = "'created_at' can't be null"; } - if ($this->container['new'] === null) { - $invalidProperties[] = "'new' can't be null"; - } if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } + if ($this->container['new'] === null) { + $invalidProperties[] = "'new' can't be null"; + } if ($this->container['properties'] === null) { $invalidProperties[] = "'properties' can't be null"; } @@ -360,37 +364,10 @@ public function valid() } - /** - * Gets created_at - * - * @return \DateTime - */ - public function getCreatedAt() - { - return $this->container['created_at']; - } - - /** - * Sets created_at - * - * @param \DateTime $created_at created_at - * - * @return self - */ - public function setCreatedAt($created_at) - { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); - } - $this->container['created_at'] = $created_at; - - return $this; - } - /** * Gets archived * - * @return bool|null + * @return bool */ public function getArchived() { @@ -400,7 +377,7 @@ public function getArchived() /** * Sets archived * - * @param bool|null $archived archived + * @param bool $archived Whether the object is archived. * * @return self */ @@ -427,7 +404,7 @@ public function getArchivedAt() /** * Sets archived_at * - * @param \DateTime|null $archived_at archived_at + * @param \DateTime|null $archived_at The timestamp when the object was archived, in ISO 8601 format. * * @return self */ @@ -442,82 +419,82 @@ public function setArchivedAt($archived_at) } /** - * Gets new + * Gets created_at * - * @return bool + * @return \DateTime */ - public function getNew() + public function getCreatedAt() { - return $this->container['new']; + return $this->container['created_at']; } /** - * Sets new + * Sets created_at * - * @param bool $new new + * @param \DateTime $created_at The timestamp when the object was created, in ISO 8601 format. * * @return self */ - public function setNew($new) + public function setCreatedAt($created_at) { - if (is_null($new)) { - throw new \InvalidArgumentException('non-nullable new cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['new'] = $new; + $this->container['created_at'] = $created_at; return $this; } /** - * Gets properties_with_history + * Gets id * - * @return array|null + * @return string */ - public function getPropertiesWithHistory() + public function getId() { - return $this->container['properties_with_history']; + return $this->container['id']; } /** - * Sets properties_with_history + * Sets id * - * @param array|null $properties_with_history properties_with_history + * @param string $id The unique ID of the object. * * @return self */ - public function setPropertiesWithHistory($properties_with_history) + public function setId($id) { - if (is_null($properties_with_history)) { - throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['properties_with_history'] = $properties_with_history; + $this->container['id'] = $id; return $this; } /** - * Gets id + * Gets new * - * @return string + * @return bool */ - public function getId() + public function getNew() { - return $this->container['id']; + return $this->container['new']; } /** - * Sets id + * Sets new * - * @param string $id id + * @param bool $new Whether the property is new. * * @return self */ - public function setId($id) + public function setNew($new) { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + if (is_null($new)) { + throw new \InvalidArgumentException('non-nullable new cannot be null'); } - $this->container['id'] = $id; + $this->container['new'] = $new; return $this; } @@ -535,7 +512,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id An identifier used for tracing the write request for the object. * * @return self */ @@ -562,7 +539,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key value pairs representing the properties of the object. * * @return self */ @@ -576,6 +553,33 @@ public function setProperties($properties) return $this; } + /** + * Gets properties_with_history + * + * @return array|null + */ + public function getPropertiesWithHistory() + { + return $this->container['properties_with_history']; + } + + /** + * Sets properties_with_history + * + * @param array|null $properties_with_history Key-value pairs representing the properties of the object along with their history. + * + * @return self + */ + public function setPropertiesWithHistory($properties_with_history) + { + if (is_null($properties_with_history)) { + throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + } + $this->container['properties_with_history'] = $properties_with_history; + + return $this; + } + /** * Gets updated_at * @@ -589,7 +593,7 @@ public function getUpdatedAt() /** * Sets updated_at * - * @param \DateTime $updated_at updated_at + * @param \DateTime $updated_at The timestamp when the object was last updated, in ISO 8601 format. * * @return self */ @@ -605,11 +609,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]); } @@ -617,12 +621,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; } @@ -647,11 +651,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/Objects/Calls/Model/StandardError.php b/codegen/Crm/Objects/Calls/Model/StandardError.php index 9436b319..c4e5dde3 100644 --- a/codegen/Crm/Objects/Calls/Model/StandardError.php +++ b/codegen/Crm/Objects/Calls/Model/StandardError.php @@ -2,7 +2,7 @@ /** * StandardError * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * StandardError Class Doc Comment * * @category Class + * @description Ye olde error * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,14 +58,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'object', + 'category' => 'string', 'context' => 'array', - 'links' => 'array', + 'errors' => '\HubSpot\Client\Crm\Objects\Calls\Model\ErrorDetail[]', 'id' => 'string', - 'category' => 'string', + 'links' => 'array', 'message' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\Calls\Model\ErrorDetail[]', - 'status' => 'string' + 'status' => 'string', + 'sub_category' => 'object' ]; /** @@ -75,14 +76,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, + 'category' => null, 'context' => null, - 'links' => null, + 'errors' => null, 'id' => null, - 'category' => null, + 'links' => null, 'message' => null, - 'errors' => null, - 'status' => null + 'status' => null, + 'sub_category' => null ]; /** @@ -91,14 +92,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, + 'category' => false, 'context' => false, - 'links' => false, + 'errors' => false, 'id' => false, - 'category' => false, + 'links' => false, 'message' => false, - 'errors' => false, - 'status' => false + 'status' => false, + 'sub_category' => false ]; /** @@ -187,14 +188,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', + 'category' => 'category', 'context' => 'context', - 'links' => 'links', + 'errors' => 'errors', 'id' => 'id', - 'category' => 'category', + 'links' => 'links', 'message' => 'message', - 'errors' => 'errors', - 'status' => 'status' + 'status' => 'status', + 'sub_category' => 'subCategory' ]; /** @@ -203,14 +204,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', + 'category' => 'setCategory', 'context' => 'setContext', - 'links' => 'setLinks', + 'errors' => 'setErrors', 'id' => 'setId', - 'category' => 'setCategory', + 'links' => 'setLinks', 'message' => 'setMessage', - 'errors' => 'setErrors', - 'status' => 'setStatus' + 'status' => 'setStatus', + 'sub_category' => 'setSubCategory' ]; /** @@ -219,14 +220,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', + 'category' => 'getCategory', 'context' => 'getContext', - 'links' => 'getLinks', + 'errors' => 'getErrors', 'id' => 'getId', - 'category' => 'getCategory', + 'links' => 'getLinks', 'message' => 'getMessage', - 'errors' => 'getErrors', - 'status' => 'getStatus' + 'status' => 'getStatus', + 'sub_category' => 'getSubCategory' ]; /** @@ -286,14 +287,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('links', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -323,21 +324,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['category'] === null) { + $invalidProperties[] = "'category' can't be null"; + } if ($this->container['context'] === null) { $invalidProperties[] = "'context' can't be null"; } + if ($this->container['errors'] === null) { + $invalidProperties[] = "'errors' can't be null"; + } if ($this->container['links'] === null) { $invalidProperties[] = "'links' can't be null"; } - if ($this->container['category'] === null) { - $invalidProperties[] = "'category' can't be null"; - } if ($this->container['message'] === null) { $invalidProperties[] = "'message' can't be null"; } - if ($this->container['errors'] === null) { - $invalidProperties[] = "'errors' can't be null"; - } if ($this->container['status'] === null) { $invalidProperties[] = "'status' can't be null"; } @@ -357,28 +358,28 @@ public function valid() /** - * Gets sub_category + * Gets category * - * @return object|null + * @return string */ - public function getSubCategory() + public function getCategory() { - return $this->container['sub_category']; + return $this->container['category']; } /** - * Sets sub_category + * Sets category * - * @param object|null $sub_category sub_category + * @param string $category The main category of the error. * * @return self */ - public function setSubCategory($sub_category) + public function setCategory($category) { - if (is_null($sub_category)) { - throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['sub_category'] = $sub_category; + $this->container['category'] = $category; return $this; } @@ -396,7 +397,7 @@ public function getContext() /** * Sets context * - * @param array $context context + * @param array $context Additional context-specific information related to the error. * * @return self */ @@ -411,28 +412,28 @@ public function setContext($context) } /** - * Gets links + * Gets errors * - * @return array + * @return \HubSpot\Client\Crm\Objects\Calls\Model\ErrorDetail[] */ - public function getLinks() + public function getErrors() { - return $this->container['links']; + return $this->container['errors']; } /** - * Sets links + * Sets errors * - * @param array $links links + * @param \HubSpot\Client\Crm\Objects\Calls\Model\ErrorDetail[] $errors The detailed error objects. * * @return self */ - public function setLinks($links) + public function setErrors($errors) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['links'] = $links; + $this->container['errors'] = $errors; return $this; } @@ -450,7 +451,7 @@ public function getId() /** * Sets id * - * @param string|null $id id + * @param string|null $id A unique ID for the error instance. * * @return self */ @@ -465,28 +466,28 @@ public function setId($id) } /** - * Gets category + * Gets links * - * @return string + * @return array */ - public function getCategory() + public function getLinks() { - return $this->container['category']; + return $this->container['links']; } /** - * Sets category + * Sets links * - * @param string $category category + * @param array $links URLs linking to documentation or resources associated with the error. * * @return self */ - public function setCategory($category) + public function setLinks($links) { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['category'] = $category; + $this->container['links'] = $links; return $this; } @@ -504,7 +505,7 @@ public function getMessage() /** * Sets message * - * @param string $message message + * @param string $message A human-readable string describing the error and possible remediation steps. * * @return self */ @@ -519,66 +520,66 @@ public function setMessage($message) } /** - * Gets errors + * Gets status * - * @return \HubSpot\Client\Crm\Objects\Calls\Model\ErrorDetail[] + * @return string */ - public function getErrors() + public function getStatus() { - return $this->container['errors']; + return $this->container['status']; } /** - * Sets errors + * Sets status * - * @param \HubSpot\Client\Crm\Objects\Calls\Model\ErrorDetail[] $errors errors + * @param string $status The HTTP status code associated with the error. * * @return self */ - public function setErrors($errors) + public function setStatus($status) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); } - $this->container['errors'] = $errors; + $this->container['status'] = $status; return $this; } /** - * Gets status + * Gets sub_category * - * @return string + * @return object|null */ - public function getStatus() + public function getSubCategory() { - return $this->container['status']; + return $this->container['sub_category']; } /** - * Sets status + * Sets sub_category * - * @param string $status status + * @param object|null $sub_category A more specific error category within each main category. * * @return self */ - public function setStatus($status) + public function setSubCategory($sub_category) { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['status'] = $status; + $this->container['sub_category'] = $sub_category; return $this; } /** * 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 +587,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 +617,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/Objects/Calls/Model/ValueWithTimestamp.php b/codegen/Crm/Objects/Calls/Model/ValueWithTimestamp.php index 23d2de40..975f6a67 100644 --- a/codegen/Crm/Objects/Calls/Model/ValueWithTimestamp.php +++ b/codegen/Crm/Objects/Calls/Model/ValueWithTimestamp.php @@ -2,7 +2,7 @@ /** * ValueWithTimestamp * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * ValueWithTimestamp Class Doc Comment * * @category Class + * @description Property model that includes timestamp. * @package HubSpot\Client\Crm\Objects\Calls * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,11 +59,11 @@ class ValueWithTimestamp implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPITypes = [ 'source_id' => 'string', - 'source_type' => 'string', 'source_label' => 'string', + 'source_type' => 'string', + 'timestamp' => '\DateTime', 'updated_by_user_id' => 'int', - 'value' => 'string', - 'timestamp' => '\DateTime' + 'value' => 'string' ]; /** @@ -74,11 +75,11 @@ class ValueWithTimestamp implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPIFormats = [ 'source_id' => null, - 'source_type' => null, 'source_label' => null, + 'source_type' => null, + 'timestamp' => 'date-time', 'updated_by_user_id' => 'int32', - 'value' => null, - 'timestamp' => 'date-time' + 'value' => null ]; /** @@ -88,11 +89,11 @@ class ValueWithTimestamp implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static array $openAPINullables = [ 'source_id' => false, - 'source_type' => false, 'source_label' => false, + 'source_type' => false, + 'timestamp' => false, 'updated_by_user_id' => false, - 'value' => false, - 'timestamp' => false + 'value' => false ]; /** @@ -182,11 +183,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'source_id' => 'sourceId', - 'source_type' => 'sourceType', 'source_label' => 'sourceLabel', + 'source_type' => 'sourceType', + 'timestamp' => 'timestamp', 'updated_by_user_id' => 'updatedByUserId', - 'value' => 'value', - 'timestamp' => 'timestamp' + 'value' => 'value' ]; /** @@ -196,11 +197,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'source_id' => 'setSourceId', - 'source_type' => 'setSourceType', 'source_label' => 'setSourceLabel', + 'source_type' => 'setSourceType', + 'timestamp' => 'setTimestamp', 'updated_by_user_id' => 'setUpdatedByUserId', - 'value' => 'setValue', - 'timestamp' => 'setTimestamp' + 'value' => 'setValue' ]; /** @@ -210,11 +211,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'source_id' => 'getSourceId', - 'source_type' => 'getSourceType', 'source_label' => 'getSourceLabel', + 'source_type' => 'getSourceType', + 'timestamp' => 'getTimestamp', 'updated_by_user_id' => 'getUpdatedByUserId', - 'value' => 'getValue', - 'timestamp' => 'getTimestamp' + 'value' => 'getValue' ]; /** @@ -275,11 +276,11 @@ public function getModelName() public function __construct(?array $data = null) { $this->setIfExists('source_id', $data ?? [], null); - $this->setIfExists('source_type', $data ?? [], null); $this->setIfExists('source_label', $data ?? [], null); + $this->setIfExists('source_type', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); $this->setIfExists('updated_by_user_id', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); - $this->setIfExists('timestamp', $data ?? [], null); } /** @@ -312,12 +313,12 @@ public function listInvalidProperties() if ($this->container['source_type'] === null) { $invalidProperties[] = "'source_type' can't be null"; } - if ($this->container['value'] === null) { - $invalidProperties[] = "'value' can't be null"; - } if ($this->container['timestamp'] === null) { $invalidProperties[] = "'timestamp' can't be null"; } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } return $invalidProperties; } @@ -346,7 +347,7 @@ public function getSourceId() /** * Sets source_id * - * @param string|null $source_id source_id + * @param string|null $source_id The unique ID of the property. * * @return self */ @@ -360,6 +361,33 @@ public function setSourceId($source_id) return $this; } + /** + * Gets source_label + * + * @return string|null + */ + public function getSourceLabel() + { + return $this->container['source_label']; + } + + /** + * Sets source_label + * + * @param string|null $source_label A human-readable label. + * + * @return self + */ + public function setSourceLabel($source_label) + { + if (is_null($source_label)) { + throw new \InvalidArgumentException('non-nullable source_label cannot be null'); + } + $this->container['source_label'] = $source_label; + + return $this; + } + /** * Gets source_type * @@ -373,7 +401,7 @@ public function getSourceType() /** * Sets source_type * - * @param string $source_type source_type + * @param string $source_type The property type. * * @return self */ @@ -388,28 +416,28 @@ public function setSourceType($source_type) } /** - * Gets source_label + * Gets timestamp * - * @return string|null + * @return \DateTime */ - public function getSourceLabel() + public function getTimestamp() { - return $this->container['source_label']; + return $this->container['timestamp']; } /** - * Sets source_label + * Sets timestamp * - * @param string|null $source_label source_label + * @param \DateTime $timestamp The timestamp when the property was updated, in ISO 8601 format. * * @return self */ - public function setSourceLabel($source_label) + public function setTimestamp($timestamp) { - if (is_null($source_label)) { - throw new \InvalidArgumentException('non-nullable source_label cannot be null'); + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); } - $this->container['source_label'] = $source_label; + $this->container['timestamp'] = $timestamp; return $this; } @@ -427,7 +455,7 @@ public function getUpdatedByUserId() /** * Sets updated_by_user_id * - * @param int|null $updated_by_user_id updated_by_user_id + * @param int|null $updated_by_user_id The ID of the user who last updated the property. * * @return self */ @@ -454,7 +482,7 @@ public function getValue() /** * Sets value * - * @param string $value value + * @param string $value The property value. * * @return self */ @@ -467,41 +495,14 @@ public function setValue($value) return $this; } - - /** - * Gets timestamp - * - * @return \DateTime - */ - public function getTimestamp() - { - return $this->container['timestamp']; - } - - /** - * Sets timestamp - * - * @param \DateTime $timestamp timestamp - * - * @return self - */ - public function setTimestamp($timestamp) - { - if (is_null($timestamp)) { - throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); - } - $this->container['timestamp'] = $timestamp; - - return $this; - } /** * 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]); } @@ -509,12 +510,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; } @@ -539,11 +540,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/Objects/Calls/ObjectSerializer.php b/codegen/Crm/Objects/Calls/ObjectSerializer.php index 17a8f104..c063777e 100644 --- a/codegen/Crm/Objects/Calls/ObjectSerializer.php +++ b/codegen/Crm/Objects/Calls/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Calls @@ -13,11 +13,11 @@ /** * Calls * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.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/Objects/Communications/Api/BasicApi.php b/codegen/Crm/Objects/Communications/Api/BasicApi.php index b2103436..77170cd5 100644 --- a/codegen/Crm/Objects/Communications/Api/BasicApi.php +++ b/codegen/Crm/Objects/Communications/Api/BasicApi.php @@ -1,7 +1,7 @@ getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -201,8 +203,10 @@ public function archiveWithHttpInfo($communication_id, string $contentType = sel $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -212,7 +216,7 @@ public function archiveWithHttpInfo($communication_id, string $contentType = sel * * Archive * - * @param string $communication_id The ID of the message to update. (required) + * @param string $communication_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 @@ -233,7 +237,7 @@ function ($response) { * * Archive * - * @param string $communication_id The ID of the message to update. (required) + * @param string $communication_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 @@ -270,7 +274,7 @@ function ($exception) { /** * Create request for operation 'archive' * - * @param string $communication_id The ID of the message to update. (required) + * @param string $communication_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 @@ -285,7 +289,10 @@ public function archiveRequest($communication_id, string $contentType = self::co 'Missing the required parameter $communication_id when calling archive' ); } - + if (!preg_match("/.+/", $communication_id)) { + throw new \InvalidArgumentException("invalid value for \"communication_id\" when calling BasicApi.archive, must conform to the pattern /.+/."); + } + $resourcePath = '/crm/v3/objects/communications/{communicationId}'; $formParams = []; @@ -421,62 +428,22 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin switch($statusCode) { - case 201: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObject' !== '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\Objects\Communications\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\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\Objects\Communications\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Communications\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -490,44 +457,21 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin ); } - $returnType = '\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObject'; - 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\Objects\Communications\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -535,8 +479,10 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -714,7 +660,7 @@ public function createRequest($simple_public_object_input_for_create, string $co * * Read * - * @param string $communication_id The ID of the message to retrieve. (required) + * @param string $communication_id communication_id (required) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) @@ -737,7 +683,7 @@ public function getById($communication_id, $properties = null, $properties_with_ * * Read * - * @param string $communication_id The ID of the message to retrieve. (required) + * @param string $communication_id (required) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) @@ -778,61 +724,21 @@ public function getByIdWithHttpInfo($communication_id, $properties = null, $prop switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObjectWithAssociations' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObjectWithAssociations' !== '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\Objects\Communications\Model\SimplePublicObjectWithAssociations', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\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\Objects\Communications\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Communications\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -846,34 +752,11 @@ public function getByIdWithHttpInfo($communication_id, $properties = null, $prop ); } - $returnType = '\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObjectWithAssociations'; - 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\Objects\Communications\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -883,7 +766,7 @@ public function getByIdWithHttpInfo($communication_id, $properties = null, $prop $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -891,8 +774,10 @@ public function getByIdWithHttpInfo($communication_id, $properties = null, $prop $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -902,7 +787,7 @@ public function getByIdWithHttpInfo($communication_id, $properties = null, $prop * * Read * - * @param string $communication_id The ID of the message to retrieve. (required) + * @param string $communication_id (required) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) @@ -928,7 +813,7 @@ function ($response) { * * Read * - * @param string $communication_id The ID of the message to retrieve. (required) + * @param string $communication_id (required) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) @@ -983,7 +868,7 @@ function ($exception) { /** * Create request for operation 'getById' * - * @param string $communication_id The ID of the message to retrieve. (required) + * @param string $communication_id (required) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) @@ -1003,7 +888,10 @@ public function getByIdRequest($communication_id, $properties = null, $propertie 'Missing the required parameter $communication_id when calling getById' ); } - + if (!preg_match("/.+/", $communication_id)) { + throw new \InvalidArgumentException("invalid value for \"communication_id\" when calling BasicApi.getById, must conform to the pattern /.+/."); + } + @@ -1139,14 +1027,14 @@ public function getByIdRequest($communication_id, $properties = null, $propertie * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of communications that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\Communications\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\Communications\Model\Error + * @return \HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\Communications\Model\Error */ public function getPage($limit = 10, $after = null, $properties = null, $properties_with_history = null, $associations = null, $archived = false, string $contentType = self::contentTypes['getPage'][0]) { @@ -1162,14 +1050,14 @@ public function getPage($limit = 10, $after = null, $properties = null, $propert * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of communications that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\Communications\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\Communications\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\Communications\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = null, $properties_with_history = null, $associations = null, $archived = false, string $contentType = self::contentTypes['getPage'][0]) { @@ -1200,61 +1088,21 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging' !== '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\Objects\Communications\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\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\Objects\Communications\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Communications\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1268,44 +1116,21 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu ); } - $returnType = '\HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; - 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\Objects\Communications\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', + '\HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseSimplePublicObjectWithAssociations', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1313,8 +1138,10 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1327,7 +1154,7 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of communications that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation @@ -1353,7 +1180,7 @@ function ($response) { * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of communications that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation @@ -1363,7 +1190,7 @@ function ($response) { */ public function getPageAsyncWithHttpInfo($limit = 10, $after = null, $properties = null, $properties_with_history = null, $associations = null, $archived = false, string $contentType = self::contentTypes['getPage'][0]) { - $returnType = '\HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseSimplePublicObjectWithAssociations'; $request = $this->getPageRequest($limit, $after, $properties, $properties_with_history, $associations, $archived, $contentType); return $this->client @@ -1408,7 +1235,7 @@ function ($exception) { * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of communications that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation @@ -1553,7 +1380,7 @@ public function getPageRequest($limit = 10, $after = null, $properties = null, $ * * Update * - * @param string $communication_id The ID of the communication to update. (required) + * @param string $communication_id communication_id (required) * @param \HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObjectInput $simple_public_object_input simple_public_object_input (required) * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation @@ -1573,7 +1400,7 @@ public function update($communication_id, $simple_public_object_input, $id_prope * * Update * - * @param string $communication_id The ID of the communication to update. (required) + * @param string $communication_id (required) * @param \HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObjectInput $simple_public_object_input (required) * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation @@ -1611,61 +1438,21 @@ public function updateWithHttpInfo($communication_id, $simple_public_object_inpu switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObject' !== '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\Objects\Communications\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\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\Objects\Communications\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Communications\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1679,34 +1466,11 @@ public function updateWithHttpInfo($communication_id, $simple_public_object_inpu ); } - $returnType = '\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObject'; - 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\Objects\Communications\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1716,7 +1480,7 @@ public function updateWithHttpInfo($communication_id, $simple_public_object_inpu $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1724,8 +1488,10 @@ public function updateWithHttpInfo($communication_id, $simple_public_object_inpu $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1735,7 +1501,7 @@ public function updateWithHttpInfo($communication_id, $simple_public_object_inpu * * Update * - * @param string $communication_id The ID of the communication to update. (required) + * @param string $communication_id (required) * @param \HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObjectInput $simple_public_object_input (required) * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation @@ -1758,7 +1524,7 @@ function ($response) { * * Update * - * @param string $communication_id The ID of the communication to update. (required) + * @param string $communication_id (required) * @param \HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObjectInput $simple_public_object_input (required) * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation @@ -1810,7 +1576,7 @@ function ($exception) { /** * Create request for operation 'update' * - * @param string $communication_id The ID of the communication to update. (required) + * @param string $communication_id (required) * @param \HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObjectInput $simple_public_object_input (required) * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation @@ -1827,7 +1593,10 @@ public function updateRequest($communication_id, $simple_public_object_input, $i 'Missing the required parameter $communication_id when calling update' ); } - + if (!preg_match("/.+/", $communication_id)) { + throw new \InvalidArgumentException("invalid value for \"communication_id\" when calling BasicApi.update, must conform to the pattern /.+/."); + } + // verify the required parameter 'simple_public_object_input' is set if ($simple_public_object_input === null || (is_array($simple_public_object_input) && count($simple_public_object_input) === 0)) { throw new \InvalidArgumentException( @@ -1945,6 +1714,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/Objects/Communications/Api/BatchApi.php b/codegen/Crm/Objects/Communications/Api/BatchApi.php index c7ae3e8e..415f0ec7 100644 --- a/codegen/Crm/Objects/Communications/Api/BatchApi.php +++ b/codegen/Crm/Objects/Communications/Api/BatchApi.php @@ -1,7 +1,7 @@ getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -201,8 +203,10 @@ public function archiveWithHttpInfo($batch_input_simple_public_object_id, string $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -372,7 +376,7 @@ public function archiveRequest($batch_input_simple_public_object_id, string $con * * @throws \HubSpot\Client\Crm\Objects\Communications\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Communications\Model\Error + * @return \HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Communications\Model\Error */ public function create($batch_input_simple_public_object_batch_input_for_create, string $contentType = self::contentTypes['create'][0]) { @@ -390,7 +394,7 @@ public function create($batch_input_simple_public_object_batch_input_for_create, * * @throws \HubSpot\Client\Crm\Objects\Communications\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Communications\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Communications\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function createWithHttpInfo($batch_input_simple_public_object_batch_input_for_create, string $contentType = self::contentTypes['create'][0]) { @@ -420,89 +424,22 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input switch($statusCode) { - case 201: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject' !== '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\Objects\Communications\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObjectWithErrors' !== '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\Objects\Communications\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\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\Objects\Communications\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Communications\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -516,52 +453,21 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input ); } - $returnType = '\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject'; - 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\Objects\Communications\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObjectWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -569,8 +475,10 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -754,7 +662,7 @@ public function createRequest($batch_input_simple_public_object_batch_input_for_ * * @throws \HubSpot\Client\Crm\Objects\Communications\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Communications\Model\Error + * @return \HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Communications\Model\Error */ public function read($batch_read_input_simple_public_object_id, $archived = false, string $contentType = self::contentTypes['read'][0]) { @@ -773,7 +681,7 @@ public function read($batch_read_input_simple_public_object_id, $archived = fals * * @throws \HubSpot\Client\Crm\Objects\Communications\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Communications\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Communications\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $archived = false, string $contentType = self::contentTypes['read'][0]) { @@ -804,88 +712,21 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject' !== '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\Objects\Communications\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObjectWithErrors' !== '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\Objects\Communications\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\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\Objects\Communications\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Communications\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -899,34 +740,11 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc ); } - $returnType = '\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject'; - 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\Objects\Communications\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -936,15 +754,7 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObjectWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -952,8 +762,10 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1149,7 +961,7 @@ public function readRequest($batch_read_input_simple_public_object_id, $archived * * @throws \HubSpot\Client\Crm\Objects\Communications\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Communications\Model\Error + * @return \HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Communications\Model\Error */ public function update($batch_input_simple_public_object_batch_input, string $contentType = self::contentTypes['update'][0]) { @@ -1167,7 +979,7 @@ public function update($batch_input_simple_public_object_batch_input, string $co * * @throws \HubSpot\Client\Crm\Objects\Communications\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Communications\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Communications\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input, string $contentType = self::contentTypes['update'][0]) { @@ -1198,88 +1010,21 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject' !== '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\Objects\Communications\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObjectWithErrors' !== '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\Objects\Communications\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\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\Objects\Communications\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Communications\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1293,34 +1038,11 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input ); } - $returnType = '\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObject'; - 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\Objects\Communications\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1330,15 +1052,7 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicObjectWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1346,8 +1060,10 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1530,7 +1246,7 @@ public function updateRequest($batch_input_simple_public_object_batch_input, str * * @throws \HubSpot\Client\Crm\Objects\Communications\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\Communications\Model\Error + * @return \HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Communications\Model\Error */ public function upsert($batch_input_simple_public_object_batch_input_upsert, string $contentType = self::contentTypes['upsert'][0]) { @@ -1548,7 +1264,7 @@ public function upsert($batch_input_simple_public_object_batch_input_upsert, str * * @throws \HubSpot\Client\Crm\Objects\Communications\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\Communications\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Communications\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input_upsert, string $contentType = self::contentTypes['upsert'][0]) { @@ -1579,88 +1295,21 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicUpsertObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicUpsertObject' !== '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\Objects\Communications\Model\BatchResponseSimplePublicUpsertObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicUpsertObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicUpsertObjectWithErrors' !== '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\Objects\Communications\Model\BatchResponseSimplePublicUpsertObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicUpsertObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\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\Objects\Communications\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Communications\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1674,34 +1323,11 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input ); } - $returnType = '\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicUpsertObject'; - 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\Objects\Communications\Model\BatchResponseSimplePublicUpsertObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1711,15 +1337,7 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Communications\Model\BatchResponseSimplePublicUpsertObjectWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1727,8 +1345,10 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1917,6 +1537,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/Objects/Communications/Api/SearchApi.php b/codegen/Crm/Objects/Communications/Api/SearchApi.php index 5c4a2fe3..841a915b 100644 --- a/codegen/Crm/Objects/Communications/Api/SearchApi.php +++ b/codegen/Crm/Objects/Communications/Api/SearchApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging' !== '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\Objects\Communications\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Communications\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Communications\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\Objects\Communications\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Communications\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -249,44 +212,21 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont ); } - $returnType = '\HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging'; - 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\Objects\Communications\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', + '\HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseWithTotalSimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -294,8 +234,10 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -334,7 +276,7 @@ function ($response) { */ public function doSearchAsyncWithHttpInfo($public_object_search_request, string $contentType = self::contentTypes['doSearch'][0]) { - $returnType = '\HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\Communications\Model\CollectionResponseWithTotalSimplePublicObject'; $request = $this->doSearchRequest($public_object_search_request, $contentType); return $this->client @@ -484,6 +426,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/Objects/Communications/ApiException.php b/codegen/Crm/Objects/Communications/ApiException.php index 29f9154e..1052958d 100644 --- a/codegen/Crm/Objects/Communications/ApiException.php +++ b/codegen/Crm/Objects/Communications/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/Objects/Communications/FormDataProcessor.php b/codegen/Crm/Objects/Communications/FormDataProcessor.php new file mode 100644 index 00000000..27ac0479 --- /dev/null +++ b/codegen/Crm/Objects/Communications/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/Objects/Communications/HeaderSelector.php b/codegen/Crm/Objects/Communications/HeaderSelector.php index 0c3e95ab..25133150 100644 --- a/codegen/Crm/Objects/Communications/HeaderSelector.php +++ b/codegen/Crm/Objects/Communications/HeaderSelector.php @@ -1,7 +1,7 @@ container[$offset]); } @@ -370,12 +371,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 +401,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/Objects/Communications/Model/AssociationSpec.php b/codegen/Crm/Objects/Communications/Model/AssociationSpec.php index 4ca62cda..07394fa8 100644 --- a/codegen/Crm/Objects/Communications/Model/AssociationSpec.php +++ b/codegen/Crm/Objects/Communications/Model/AssociationSpec.php @@ -2,7 +2,7 @@ /** * AssociationSpec * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * AssociationSpec Class Doc Comment * * @category Class + * @description Defines the type, direction, and details of the relationship between two CRM objects. * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -235,8 +236,8 @@ public function getModelName() } public const ASSOCIATION_CATEGORY_HUBSPOT_DEFINED = 'HUBSPOT_DEFINED'; - public const ASSOCIATION_CATEGORY_USER_DEFINED = 'USER_DEFINED'; public const ASSOCIATION_CATEGORY_INTEGRATOR_DEFINED = 'INTEGRATOR_DEFINED'; + public const ASSOCIATION_CATEGORY_USER_DEFINED = 'USER_DEFINED'; /** * Gets allowable values of the enum @@ -247,8 +248,8 @@ public function getAssociationCategoryAllowableValues() { return [ self::ASSOCIATION_CATEGORY_HUBSPOT_DEFINED, - self::ASSOCIATION_CATEGORY_USER_DEFINED, self::ASSOCIATION_CATEGORY_INTEGRATOR_DEFINED, + self::ASSOCIATION_CATEGORY_USER_DEFINED, ]; } @@ -341,7 +342,7 @@ public function getAssociationCategory() /** * Sets association_category * - * @param string $association_category association_category + * @param string $association_category The category of the association, such as \"HUBSPOT_DEFINED\". * * @return self */ @@ -378,7 +379,7 @@ public function getAssociationTypeId() /** * Sets association_type_id * - * @param int $association_type_id association_type_id + * @param int $association_type_id The ID representing the specific type of association. * * @return self */ @@ -394,11 +395,11 @@ public function setAssociationTypeId($association_type_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]); } @@ -406,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; } @@ -436,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/Objects/Communications/Model/BatchInputSimplePublicObjectBatchInput.php b/codegen/Crm/Objects/Communications/Model/BatchInputSimplePublicObjectBatchInput.php index e1f3795a..4e92724a 100644 --- a/codegen/Crm/Objects/Communications/Model/BatchInputSimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/Communications/Model/BatchInputSimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -321,11 +321,11 @@ public function setInputs($inputs) /** * 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/Objects/Communications/Model/BatchInputSimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/Communications/Model/BatchInputSimplePublicObjectBatchInputForCreate.php index bcb18d9f..45e34751 100644 --- a/codegen/Crm/Objects/Communications/Model/BatchInputSimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/Communications/Model/BatchInputSimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -321,11 +321,11 @@ public function setInputs($inputs) /** * 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/Objects/Communications/Model/BatchInputSimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/Communications/Model/BatchInputSimplePublicObjectBatchInputUpsert.php index 8c440e88..540ff729 100644 --- a/codegen/Crm/Objects/Communications/Model/BatchInputSimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Objects/Communications/Model/BatchInputSimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -321,11 +321,11 @@ public function setInputs($inputs) /** * 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/Objects/Communications/Model/BatchInputSimplePublicObjectId.php b/codegen/Crm/Objects/Communications/Model/BatchInputSimplePublicObjectId.php index b2c840d9..9f78c4f9 100644 --- a/codegen/Crm/Objects/Communications/Model/BatchInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/Communications/Model/BatchInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -321,11 +321,11 @@ public function setInputs($inputs) /** * 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/Objects/Communications/Model/BatchReadInputSimplePublicObjectId.php b/codegen/Crm/Objects/Communications/Model/BatchReadInputSimplePublicObjectId.php index 50f8596b..b3453164 100644 --- a/codegen/Crm/Objects/Communications/Model/BatchReadInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/Communications/Model/BatchReadInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchReadInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * BatchReadInputSimplePublicObjectId Class Doc Comment * * @category Class + * @description Specifies the input for reading a batch of CRM objects, including arrays of object IDs, requested property names (with optional history), and an optional unique identifying property. * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,10 +58,10 @@ class BatchReadInputSimplePublicObjectId implements ModelInterface, ArrayAccess, * @var string[] */ protected static $openAPITypes = [ - 'properties_with_history' => 'string[]', 'id_property' => 'string', 'inputs' => '\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObjectId[]', - 'properties' => 'string[]' + 'properties' => 'string[]', + 'properties_with_history' => 'string[]' ]; /** @@ -71,10 +72,10 @@ class BatchReadInputSimplePublicObjectId implements ModelInterface, ArrayAccess, * @psalm-var array */ protected static $openAPIFormats = [ - 'properties_with_history' => null, 'id_property' => null, 'inputs' => null, - 'properties' => null + 'properties' => null, + 'properties_with_history' => null ]; /** @@ -83,10 +84,10 @@ class BatchReadInputSimplePublicObjectId implements ModelInterface, ArrayAccess, * @var boolean[] */ protected static array $openAPINullables = [ - 'properties_with_history' => false, 'id_property' => false, 'inputs' => false, - 'properties' => false + 'properties' => false, + 'properties_with_history' => false ]; /** @@ -175,10 +176,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'properties_with_history' => 'propertiesWithHistory', 'id_property' => 'idProperty', 'inputs' => 'inputs', - 'properties' => 'properties' + 'properties' => 'properties', + 'properties_with_history' => 'propertiesWithHistory' ]; /** @@ -187,10 +188,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'properties_with_history' => 'setPropertiesWithHistory', 'id_property' => 'setIdProperty', 'inputs' => 'setInputs', - 'properties' => 'setProperties' + 'properties' => 'setProperties', + 'properties_with_history' => 'setPropertiesWithHistory' ]; /** @@ -199,10 +200,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'properties_with_history' => 'getPropertiesWithHistory', 'id_property' => 'getIdProperty', 'inputs' => 'getInputs', - 'properties' => 'getProperties' + 'properties' => 'getProperties', + 'properties_with_history' => 'getPropertiesWithHistory' ]; /** @@ -262,10 +263,10 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('properties_with_history', $data ?? [], null); $this->setIfExists('id_property', $data ?? [], null); $this->setIfExists('inputs', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('properties_with_history', $data ?? [], null); } /** @@ -295,15 +296,15 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['properties_with_history'] === null) { - $invalidProperties[] = "'properties_with_history' can't be null"; - } if ($this->container['inputs'] === null) { $invalidProperties[] = "'inputs' can't be null"; } if ($this->container['properties'] === null) { $invalidProperties[] = "'properties' can't be null"; } + if ($this->container['properties_with_history'] === null) { + $invalidProperties[] = "'properties_with_history' can't be null"; + } return $invalidProperties; } @@ -319,33 +320,6 @@ public function valid() } - /** - * Gets properties_with_history - * - * @return string[] - */ - public function getPropertiesWithHistory() - { - return $this->container['properties_with_history']; - } - - /** - * Sets properties_with_history - * - * @param string[] $properties_with_history properties_with_history - * - * @return self - */ - public function setPropertiesWithHistory($properties_with_history) - { - if (is_null($properties_with_history)) { - throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); - } - $this->container['properties_with_history'] = $properties_with_history; - - return $this; - } - /** * Gets id_property * @@ -413,7 +387,7 @@ public function getProperties() /** * Sets properties * - * @param string[] $properties properties + * @param string[] $properties Key-value pairs for setting properties for the new object. * * @return self */ @@ -426,14 +400,41 @@ public function setProperties($properties) return $this; } + + /** + * Gets properties_with_history + * + * @return string[] + */ + public function getPropertiesWithHistory() + { + return $this->container['properties_with_history']; + } + + /** + * Sets properties_with_history + * + * @param string[] $properties_with_history Key-value pairs for setting properties for the new object and their histories. + * + * @return self + */ + public function setPropertiesWithHistory($properties_with_history) + { + if (is_null($properties_with_history)) { + throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + } + $this->container['properties_with_history'] = $properties_with_history; + + return $this; + } /** * 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]); } @@ -441,12 +442,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; } @@ -471,11 +472,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/Objects/Communications/Model/BatchResponseSimplePublicObject.php b/codegen/Crm/Objects/Communications/Model/BatchResponseSimplePublicObject.php index 6832b7e8..e4122676 100644 --- a/codegen/Crm/Objects/Communications/Model/BatchResponseSimplePublicObject.php +++ b/codegen/Crm/Objects/Communications/Model/BatchResponseSimplePublicObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * BatchResponseSimplePublicObject Class Doc Comment * * @category Class + * @description A public object batch response object * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,10 +59,12 @@ class BatchResponseSimplePublicObject implements ModelInterface, ArrayAccess, \J */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', + 'errors' => '\HubSpot\Client\Crm\Objects\Communications\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObject[]', + 'started_at' => '\DateTime', 'status' => 'string' ]; @@ -74,10 +77,12 @@ class BatchResponseSimplePublicObject implements ModelInterface, ArrayAccess, \J */ protected static $openAPIFormats = [ 'completed_at' => 'date-time', - 'requested_at' => 'date-time', - 'started_at' => 'date-time', + 'errors' => null, 'links' => null, + 'num_errors' => 'int32', + 'requested_at' => 'date-time', 'results' => null, + 'started_at' => 'date-time', 'status' => null ]; @@ -88,10 +93,12 @@ class BatchResponseSimplePublicObject implements ModelInterface, ArrayAccess, \J */ protected static array $openAPINullables = [ 'completed_at' => false, - 'requested_at' => false, - 'started_at' => false, + 'errors' => false, 'links' => false, + 'num_errors' => false, + 'requested_at' => false, 'results' => false, + 'started_at' => false, 'status' => false ]; @@ -182,10 +189,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'completed_at' => 'completedAt', - 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', + 'errors' => 'errors', 'links' => 'links', + 'num_errors' => 'numErrors', + 'requested_at' => 'requestedAt', 'results' => 'results', + 'started_at' => 'startedAt', 'status' => 'status' ]; @@ -196,10 +205,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'completed_at' => 'setCompletedAt', - 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', + 'errors' => 'setErrors', 'links' => 'setLinks', + 'num_errors' => 'setNumErrors', + 'requested_at' => 'setRequestedAt', 'results' => 'setResults', + 'started_at' => 'setStartedAt', 'status' => 'setStatus' ]; @@ -210,10 +221,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'completed_at' => 'getCompletedAt', - 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', + 'errors' => 'getErrors', 'links' => 'getLinks', + 'num_errors' => 'getNumErrors', + 'requested_at' => 'getRequestedAt', 'results' => 'getResults', + 'started_at' => 'getStartedAt', 'status' => 'getStatus' ]; @@ -258,10 +271,10 @@ public function getModelName() return self::$openAPIModelName; } - public const STATUS_PENDING = 'PENDING'; - public const STATUS_PROCESSING = 'PROCESSING'; public const STATUS_CANCELED = 'CANCELED'; public const STATUS_COMPLETE = 'COMPLETE'; + public const STATUS_PENDING = 'PENDING'; + public const STATUS_PROCESSING = 'PROCESSING'; /** * Gets allowable values of the enum @@ -271,10 +284,10 @@ public function getModelName() public function getStatusAllowableValues() { return [ - self::STATUS_PENDING, - self::STATUS_PROCESSING, self::STATUS_CANCELED, self::STATUS_COMPLETE, + self::STATUS_PENDING, + self::STATUS_PROCESSING, ]; } @@ -294,10 +307,12 @@ public function getStatusAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('completed_at', $data ?? [], null); - $this->setIfExists('requested_at', $data ?? [], null); - $this->setIfExists('started_at', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('links', $data ?? [], null); + $this->setIfExists('num_errors', $data ?? [], null); + $this->setIfExists('requested_at', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('started_at', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); } @@ -331,12 +346,12 @@ public function listInvalidProperties() if ($this->container['completed_at'] === null) { $invalidProperties[] = "'completed_at' can't be null"; } - if ($this->container['started_at'] === null) { - $invalidProperties[] = "'started_at' can't be null"; - } if ($this->container['results'] === null) { $invalidProperties[] = "'results' can't be null"; } + if ($this->container['started_at'] === null) { + $invalidProperties[] = "'started_at' can't be null"; + } if ($this->container['status'] === null) { $invalidProperties[] = "'status' can't be null"; } @@ -377,7 +392,7 @@ public function getCompletedAt() /** * Sets completed_at * - * @param \DateTime $completed_at completed_at + * @param \DateTime $completed_at The timestamp when the batch processing was completed, in ISO 8601 format. * * @return self */ @@ -392,82 +407,109 @@ public function setCompletedAt($completed_at) } /** - * Gets requested_at + * Gets errors * - * @return \DateTime|null + * @return \HubSpot\Client\Crm\Objects\Communications\Model\StandardError[]|null */ - public function getRequestedAt() + public function getErrors() { - return $this->container['requested_at']; + return $this->container['errors']; } /** - * Sets requested_at + * Sets errors * - * @param \DateTime|null $requested_at requested_at + * @param \HubSpot\Client\Crm\Objects\Communications\Model\StandardError[]|null $errors errors * * @return self */ - public function setRequestedAt($requested_at) + public function setErrors($errors) { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['requested_at'] = $requested_at; + $this->container['errors'] = $errors; return $this; } /** - * Gets started_at + * Gets links * - * @return \DateTime + * @return array|null */ - public function getStartedAt() + public function getLinks() { - return $this->container['started_at']; + return $this->container['links']; } /** - * Sets started_at + * Sets links * - * @param \DateTime $started_at started_at + * @param array|null $links An object containing relevant links related to the batch request. * * @return self */ - public function setStartedAt($started_at) + public function setLinks($links) { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['started_at'] = $started_at; + $this->container['links'] = $links; return $this; } /** - * Gets links + * Gets num_errors * - * @return array|null + * @return int|null */ - public function getLinks() + public function getNumErrors() { - return $this->container['links']; + return $this->container['num_errors']; } /** - * Sets links + * Sets num_errors * - * @param array|null $links links + * @param int|null $num_errors The total number of errors that occurred during the batch operation. * * @return self */ - public function setLinks($links) + public function setNumErrors($num_errors) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($num_errors)) { + throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); } - $this->container['links'] = $links; + $this->container['num_errors'] = $num_errors; + + return $this; + } + + /** + * Gets requested_at + * + * @return \DateTime|null + */ + public function getRequestedAt() + { + return $this->container['requested_at']; + } + + /** + * Sets requested_at + * + * @param \DateTime|null $requested_at The timestamp when the batch request was initially made, in ISO 8601 format. + * + * @return self + */ + public function setRequestedAt($requested_at) + { + if (is_null($requested_at)) { + throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + } + $this->container['requested_at'] = $requested_at; return $this; } @@ -499,6 +541,33 @@ public function setResults($results) return $this; } + /** + * Gets started_at + * + * @return \DateTime + */ + public function getStartedAt() + { + return $this->container['started_at']; + } + + /** + * Sets started_at + * + * @param \DateTime $started_at The timestamp when the batch processing began, in ISO 8601 format. + * + * @return self + */ + public function setStartedAt($started_at) + { + if (is_null($started_at)) { + throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + } + $this->container['started_at'] = $started_at; + + return $this; + } + /** * Gets status * @@ -512,7 +581,7 @@ public function getStatus() /** * Sets status * - * @param string $status status + * @param string $status The status of the batch processing request: \"PENDING\", \"PROCESSING\", \"CANCELLED\", or \"COMPLETE\" * * @return self */ @@ -538,11 +607,11 @@ public function setStatus($status) /** * 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]); } @@ -550,12 +619,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; } @@ -580,11 +649,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/Objects/Communications/Model/BatchResponseSimplePublicObjectWithErrors.php b/codegen/Crm/Objects/Communications/Model/BatchResponseSimplePublicObjectWithErrors.php deleted file mode 100644 index 7aa83afb..00000000 --- a/codegen/Crm/Objects/Communications/Model/BatchResponseSimplePublicObjectWithErrors.php +++ /dev/null @@ -1,697 +0,0 @@ - - */ -class BatchResponseSimplePublicObjectWithErrors implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'BatchResponseSimplePublicObjectWithErrors'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'completed_at' => '\DateTime', - 'num_errors' => 'int', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', - 'links' => 'array', - 'results' => '\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\Communications\Model\StandardError[]', - 'status' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'completed_at' => 'date-time', - 'num_errors' => 'int32', - 'requested_at' => 'date-time', - 'started_at' => 'date-time', - 'links' => null, - 'results' => null, - 'errors' => null, - 'status' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'completed_at' => false, - 'num_errors' => false, - 'requested_at' => false, - 'started_at' => false, - 'links' => false, - 'results' => false, - 'errors' => false, - 'status' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'completed_at' => 'completedAt', - 'num_errors' => 'numErrors', - 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', - 'links' => 'links', - 'results' => 'results', - 'errors' => 'errors', - 'status' => 'status' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'completed_at' => 'setCompletedAt', - 'num_errors' => 'setNumErrors', - 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', - 'links' => 'setLinks', - 'results' => 'setResults', - 'errors' => 'setErrors', - 'status' => 'setStatus' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'completed_at' => 'getCompletedAt', - 'num_errors' => 'getNumErrors', - 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', - 'links' => 'getLinks', - 'results' => 'getResults', - 'errors' => 'getErrors', - 'status' => 'getStatus' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - public const STATUS_PENDING = 'PENDING'; - public const STATUS_PROCESSING = 'PROCESSING'; - public const STATUS_CANCELED = 'CANCELED'; - public const STATUS_COMPLETE = 'COMPLETE'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStatusAllowableValues() - { - return [ - self::STATUS_PENDING, - self::STATUS_PROCESSING, - self::STATUS_CANCELED, - self::STATUS_COMPLETE, - ]; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('completed_at', $data ?? [], null); - $this->setIfExists('num_errors', $data ?? [], null); - $this->setIfExists('requested_at', $data ?? [], null); - $this->setIfExists('started_at', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); - $this->setIfExists('results', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['completed_at'] === null) { - $invalidProperties[] = "'completed_at' can't be null"; - } - if ($this->container['started_at'] === null) { - $invalidProperties[] = "'started_at' can't be null"; - } - if ($this->container['results'] === null) { - $invalidProperties[] = "'results' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'status', must be one of '%s'", - $this->container['status'], - implode("', '", $allowedValues) - ); - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets completed_at - * - * @return \DateTime - */ - public function getCompletedAt() - { - return $this->container['completed_at']; - } - - /** - * Sets completed_at - * - * @param \DateTime $completed_at completed_at - * - * @return self - */ - public function setCompletedAt($completed_at) - { - if (is_null($completed_at)) { - throw new \InvalidArgumentException('non-nullable completed_at cannot be null'); - } - $this->container['completed_at'] = $completed_at; - - return $this; - } - - /** - * Gets num_errors - * - * @return int|null - */ - public function getNumErrors() - { - return $this->container['num_errors']; - } - - /** - * Sets num_errors - * - * @param int|null $num_errors num_errors - * - * @return self - */ - public function setNumErrors($num_errors) - { - if (is_null($num_errors)) { - throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); - } - $this->container['num_errors'] = $num_errors; - - return $this; - } - - /** - * Gets requested_at - * - * @return \DateTime|null - */ - public function getRequestedAt() - { - return $this->container['requested_at']; - } - - /** - * Sets requested_at - * - * @param \DateTime|null $requested_at requested_at - * - * @return self - */ - public function setRequestedAt($requested_at) - { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); - } - $this->container['requested_at'] = $requested_at; - - return $this; - } - - /** - * Gets started_at - * - * @return \DateTime - */ - public function getStartedAt() - { - return $this->container['started_at']; - } - - /** - * Sets started_at - * - * @param \DateTime $started_at started_at - * - * @return self - */ - public function setStartedAt($started_at) - { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); - } - $this->container['started_at'] = $started_at; - - return $this; - } - - /** - * Gets links - * - * @return array|null - */ - public function getLinks() - { - return $this->container['links']; - } - - /** - * Sets links - * - * @param array|null $links links - * - * @return self - */ - public function setLinks($links) - { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); - } - $this->container['links'] = $links; - - return $this; - } - - /** - * Gets results - * - * @return \HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObject[] $results results - * - * @return self - */ - public function setResults($results) - { - if (is_null($results)) { - throw new \InvalidArgumentException('non-nullable results cannot be null'); - } - $this->container['results'] = $results; - - return $this; - } - - /** - * Gets errors - * - * @return \HubSpot\Client\Crm\Objects\Communications\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\Communications\Model\StandardError[]|null $errors errors - * - * @return self - */ - public function setErrors($errors) - { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); - } - $this->container['errors'] = $errors; - - return $this; - } - - /** - * Gets status - * - * @return string - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", - $status, - implode("', '", $allowedValues) - ) - ); - } - $this->container['status'] = $status; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/codegen/Crm/Objects/Communications/Model/BatchResponseSimplePublicUpsertObject.php b/codegen/Crm/Objects/Communications/Model/BatchResponseSimplePublicUpsertObject.php index 1f0e1569..793ae86b 100644 --- a/codegen/Crm/Objects/Communications/Model/BatchResponseSimplePublicUpsertObject.php +++ b/codegen/Crm/Objects/Communications/Model/BatchResponseSimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * BatchResponseSimplePublicUpsertObject Class Doc Comment * * @category Class + * @description Represents the result of a batch upsert operation, including the operation’s status, timestamps, and a list of successfully created or updated objects. * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,10 +59,12 @@ class BatchResponseSimplePublicUpsertObject implements ModelInterface, ArrayAcce */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', + 'errors' => '\HubSpot\Client\Crm\Objects\Communications\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicUpsertObject[]', + 'started_at' => '\DateTime', 'status' => 'string' ]; @@ -74,10 +77,12 @@ class BatchResponseSimplePublicUpsertObject implements ModelInterface, ArrayAcce */ protected static $openAPIFormats = [ 'completed_at' => 'date-time', - 'requested_at' => 'date-time', - 'started_at' => 'date-time', + 'errors' => null, 'links' => null, + 'num_errors' => 'int32', + 'requested_at' => 'date-time', 'results' => null, + 'started_at' => 'date-time', 'status' => null ]; @@ -88,10 +93,12 @@ class BatchResponseSimplePublicUpsertObject implements ModelInterface, ArrayAcce */ protected static array $openAPINullables = [ 'completed_at' => false, - 'requested_at' => false, - 'started_at' => false, + 'errors' => false, 'links' => false, + 'num_errors' => false, + 'requested_at' => false, 'results' => false, + 'started_at' => false, 'status' => false ]; @@ -182,10 +189,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'completed_at' => 'completedAt', - 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', + 'errors' => 'errors', 'links' => 'links', + 'num_errors' => 'numErrors', + 'requested_at' => 'requestedAt', 'results' => 'results', + 'started_at' => 'startedAt', 'status' => 'status' ]; @@ -196,10 +205,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'completed_at' => 'setCompletedAt', - 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', + 'errors' => 'setErrors', 'links' => 'setLinks', + 'num_errors' => 'setNumErrors', + 'requested_at' => 'setRequestedAt', 'results' => 'setResults', + 'started_at' => 'setStartedAt', 'status' => 'setStatus' ]; @@ -210,10 +221,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'completed_at' => 'getCompletedAt', - 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', + 'errors' => 'getErrors', 'links' => 'getLinks', + 'num_errors' => 'getNumErrors', + 'requested_at' => 'getRequestedAt', 'results' => 'getResults', + 'started_at' => 'getStartedAt', 'status' => 'getStatus' ]; @@ -258,10 +271,10 @@ public function getModelName() return self::$openAPIModelName; } - public const STATUS_PENDING = 'PENDING'; - public const STATUS_PROCESSING = 'PROCESSING'; public const STATUS_CANCELED = 'CANCELED'; public const STATUS_COMPLETE = 'COMPLETE'; + public const STATUS_PENDING = 'PENDING'; + public const STATUS_PROCESSING = 'PROCESSING'; /** * Gets allowable values of the enum @@ -271,10 +284,10 @@ public function getModelName() public function getStatusAllowableValues() { return [ - self::STATUS_PENDING, - self::STATUS_PROCESSING, self::STATUS_CANCELED, self::STATUS_COMPLETE, + self::STATUS_PENDING, + self::STATUS_PROCESSING, ]; } @@ -294,10 +307,12 @@ public function getStatusAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('completed_at', $data ?? [], null); - $this->setIfExists('requested_at', $data ?? [], null); - $this->setIfExists('started_at', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('links', $data ?? [], null); + $this->setIfExists('num_errors', $data ?? [], null); + $this->setIfExists('requested_at', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('started_at', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); } @@ -331,12 +346,12 @@ public function listInvalidProperties() if ($this->container['completed_at'] === null) { $invalidProperties[] = "'completed_at' can't be null"; } - if ($this->container['started_at'] === null) { - $invalidProperties[] = "'started_at' can't be null"; - } if ($this->container['results'] === null) { $invalidProperties[] = "'results' can't be null"; } + if ($this->container['started_at'] === null) { + $invalidProperties[] = "'started_at' can't be null"; + } if ($this->container['status'] === null) { $invalidProperties[] = "'status' can't be null"; } @@ -377,7 +392,7 @@ public function getCompletedAt() /** * Sets completed_at * - * @param \DateTime $completed_at completed_at + * @param \DateTime $completed_at The timestamp when the batch process was completed, in ISO 8601 format. * * @return self */ @@ -392,82 +407,109 @@ public function setCompletedAt($completed_at) } /** - * Gets requested_at + * Gets errors * - * @return \DateTime|null + * @return \HubSpot\Client\Crm\Objects\Communications\Model\StandardError[]|null */ - public function getRequestedAt() + public function getErrors() { - return $this->container['requested_at']; + return $this->container['errors']; } /** - * Sets requested_at + * Sets errors * - * @param \DateTime|null $requested_at requested_at + * @param \HubSpot\Client\Crm\Objects\Communications\Model\StandardError[]|null $errors errors * * @return self */ - public function setRequestedAt($requested_at) + public function setErrors($errors) { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['requested_at'] = $requested_at; + $this->container['errors'] = $errors; return $this; } /** - * Gets started_at + * Gets links * - * @return \DateTime + * @return array|null */ - public function getStartedAt() + public function getLinks() { - return $this->container['started_at']; + return $this->container['links']; } /** - * Sets started_at + * Sets links * - * @param \DateTime $started_at started_at + * @param array|null $links An object containing relevant links related to the batch request. * * @return self */ - public function setStartedAt($started_at) + public function setLinks($links) { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['started_at'] = $started_at; + $this->container['links'] = $links; return $this; } /** - * Gets links + * Gets num_errors * - * @return array|null + * @return int|null */ - public function getLinks() + public function getNumErrors() { - return $this->container['links']; + return $this->container['num_errors']; } /** - * Sets links + * Sets num_errors * - * @param array|null $links links + * @param int|null $num_errors The total number of errors that occurred during the operation. * * @return self */ - public function setLinks($links) + public function setNumErrors($num_errors) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($num_errors)) { + throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); } - $this->container['links'] = $links; + $this->container['num_errors'] = $num_errors; + + return $this; + } + + /** + * Gets requested_at + * + * @return \DateTime|null + */ + public function getRequestedAt() + { + return $this->container['requested_at']; + } + + /** + * Sets requested_at + * + * @param \DateTime|null $requested_at The timestamp when the batch process was initiated, in ISO 8601 format. + * + * @return self + */ + public function setRequestedAt($requested_at) + { + if (is_null($requested_at)) { + throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + } + $this->container['requested_at'] = $requested_at; return $this; } @@ -499,6 +541,33 @@ public function setResults($results) return $this; } + /** + * Gets started_at + * + * @return \DateTime + */ + public function getStartedAt() + { + return $this->container['started_at']; + } + + /** + * Sets started_at + * + * @param \DateTime $started_at The timestamp when the batch process began execution, in ISO 8601 format. + * + * @return self + */ + public function setStartedAt($started_at) + { + if (is_null($started_at)) { + throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + } + $this->container['started_at'] = $started_at; + + return $this; + } + /** * Gets status * @@ -512,7 +581,7 @@ public function getStatus() /** * Sets status * - * @param string $status status + * @param string $status The status of the batch processing request. Can be: \"PENDING\", \"PROCESSING\", \"CANCELED\", or \"COMPLETE\". * * @return self */ @@ -538,11 +607,11 @@ public function setStatus($status) /** * 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]); } @@ -550,12 +619,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; } @@ -580,11 +649,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/Objects/Communications/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php b/codegen/Crm/Objects/Communications/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php deleted file mode 100644 index 5c4c7f28..00000000 --- a/codegen/Crm/Objects/Communications/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php +++ /dev/null @@ -1,697 +0,0 @@ - - */ -class BatchResponseSimplePublicUpsertObjectWithErrors implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'BatchResponseSimplePublicUpsertObjectWithErrors'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'completed_at' => '\DateTime', - 'num_errors' => 'int', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', - 'links' => 'array', - 'results' => '\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicUpsertObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\Communications\Model\StandardError[]', - 'status' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'completed_at' => 'date-time', - 'num_errors' => 'int32', - 'requested_at' => 'date-time', - 'started_at' => 'date-time', - 'links' => null, - 'results' => null, - 'errors' => null, - 'status' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'completed_at' => false, - 'num_errors' => false, - 'requested_at' => false, - 'started_at' => false, - 'links' => false, - 'results' => false, - 'errors' => false, - 'status' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'completed_at' => 'completedAt', - 'num_errors' => 'numErrors', - 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', - 'links' => 'links', - 'results' => 'results', - 'errors' => 'errors', - 'status' => 'status' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'completed_at' => 'setCompletedAt', - 'num_errors' => 'setNumErrors', - 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', - 'links' => 'setLinks', - 'results' => 'setResults', - 'errors' => 'setErrors', - 'status' => 'setStatus' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'completed_at' => 'getCompletedAt', - 'num_errors' => 'getNumErrors', - 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', - 'links' => 'getLinks', - 'results' => 'getResults', - 'errors' => 'getErrors', - 'status' => 'getStatus' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - public const STATUS_PENDING = 'PENDING'; - public const STATUS_PROCESSING = 'PROCESSING'; - public const STATUS_CANCELED = 'CANCELED'; - public const STATUS_COMPLETE = 'COMPLETE'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStatusAllowableValues() - { - return [ - self::STATUS_PENDING, - self::STATUS_PROCESSING, - self::STATUS_CANCELED, - self::STATUS_COMPLETE, - ]; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('completed_at', $data ?? [], null); - $this->setIfExists('num_errors', $data ?? [], null); - $this->setIfExists('requested_at', $data ?? [], null); - $this->setIfExists('started_at', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); - $this->setIfExists('results', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['completed_at'] === null) { - $invalidProperties[] = "'completed_at' can't be null"; - } - if ($this->container['started_at'] === null) { - $invalidProperties[] = "'started_at' can't be null"; - } - if ($this->container['results'] === null) { - $invalidProperties[] = "'results' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'status', must be one of '%s'", - $this->container['status'], - implode("', '", $allowedValues) - ); - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets completed_at - * - * @return \DateTime - */ - public function getCompletedAt() - { - return $this->container['completed_at']; - } - - /** - * Sets completed_at - * - * @param \DateTime $completed_at completed_at - * - * @return self - */ - public function setCompletedAt($completed_at) - { - if (is_null($completed_at)) { - throw new \InvalidArgumentException('non-nullable completed_at cannot be null'); - } - $this->container['completed_at'] = $completed_at; - - return $this; - } - - /** - * Gets num_errors - * - * @return int|null - */ - public function getNumErrors() - { - return $this->container['num_errors']; - } - - /** - * Sets num_errors - * - * @param int|null $num_errors num_errors - * - * @return self - */ - public function setNumErrors($num_errors) - { - if (is_null($num_errors)) { - throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); - } - $this->container['num_errors'] = $num_errors; - - return $this; - } - - /** - * Gets requested_at - * - * @return \DateTime|null - */ - public function getRequestedAt() - { - return $this->container['requested_at']; - } - - /** - * Sets requested_at - * - * @param \DateTime|null $requested_at requested_at - * - * @return self - */ - public function setRequestedAt($requested_at) - { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); - } - $this->container['requested_at'] = $requested_at; - - return $this; - } - - /** - * Gets started_at - * - * @return \DateTime - */ - public function getStartedAt() - { - return $this->container['started_at']; - } - - /** - * Sets started_at - * - * @param \DateTime $started_at started_at - * - * @return self - */ - public function setStartedAt($started_at) - { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); - } - $this->container['started_at'] = $started_at; - - return $this; - } - - /** - * Gets links - * - * @return array|null - */ - public function getLinks() - { - return $this->container['links']; - } - - /** - * Sets links - * - * @param array|null $links links - * - * @return self - */ - public function setLinks($links) - { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); - } - $this->container['links'] = $links; - - return $this; - } - - /** - * Gets results - * - * @return \HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicUpsertObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicUpsertObject[] $results results - * - * @return self - */ - public function setResults($results) - { - if (is_null($results)) { - throw new \InvalidArgumentException('non-nullable results cannot be null'); - } - $this->container['results'] = $results; - - return $this; - } - - /** - * Gets errors - * - * @return \HubSpot\Client\Crm\Objects\Communications\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\Communications\Model\StandardError[]|null $errors errors - * - * @return self - */ - public function setErrors($errors) - { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); - } - $this->container['errors'] = $errors; - - return $this; - } - - /** - * Gets status - * - * @return string - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", - $status, - implode("', '", $allowedValues) - ) - ); - } - $this->container['status'] = $status; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/codegen/Crm/Objects/Communications/Model/CollectionResponseAssociatedId.php b/codegen/Crm/Objects/Communications/Model/CollectionResponseAssociatedId.php index 622e6719..a5bc07eb 100644 --- a/codegen/Crm/Objects/Communications/Model/CollectionResponseAssociatedId.php +++ b/codegen/Crm/Objects/Communications/Model/CollectionResponseAssociatedId.php @@ -2,7 +2,7 @@ /** * CollectionResponseAssociatedId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -355,11 +355,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]); } @@ -367,12 +367,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; } @@ -397,11 +397,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/Objects/Communications/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php b/codegen/Crm/Objects/Communications/Model/CollectionResponseSimplePublicObjectWithAssociations.php similarity index 83% rename from codegen/Crm/Objects/Communications/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php rename to codegen/Crm/Objects/Communications/Model/CollectionResponseSimplePublicObjectWithAssociations.php index 335d0c38..0db86d56 100644 --- a/codegen/Crm/Objects/Communications/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php +++ b/codegen/Crm/Objects/Communications/Model/CollectionResponseSimplePublicObjectWithAssociations.php @@ -1,8 +1,8 @@ */ -class CollectionResponseSimplePublicObjectWithAssociationsForwardPaging implements ModelInterface, ArrayAccess, \JsonSerializable +class CollectionResponseSimplePublicObjectWithAssociations implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +49,7 @@ class CollectionResponseSimplePublicObjectWithAssociationsForwardPaging implemen * * @var string */ - protected static $openAPIModelName = 'CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; + protected static $openAPIModelName = 'CollectionResponseSimplePublicObjectWithAssociations'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,7 +57,7 @@ class CollectionResponseSimplePublicObjectWithAssociationsForwardPaging implemen * @var string[] */ protected static $openAPITypes = [ - 'paging' => '\HubSpot\Client\Crm\Objects\Communications\Model\ForwardPaging', + 'paging' => '\HubSpot\Client\Crm\Objects\Communications\Model\Paging', 'results' => '\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObjectWithAssociations[]' ]; @@ -302,7 +302,7 @@ public function valid() /** * Gets paging * - * @return \HubSpot\Client\Crm\Objects\Communications\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\Communications\Model\Paging|null */ public function getPaging() { @@ -312,7 +312,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\Communications\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\Communications\Model\Paging|null $paging paging * * @return self */ @@ -355,11 +355,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]); } @@ -367,12 +367,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; } @@ -397,11 +397,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/Objects/Communications/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php b/codegen/Crm/Objects/Communications/Model/CollectionResponseWithTotalSimplePublicObject.php similarity index 80% rename from codegen/Crm/Objects/Communications/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php rename to codegen/Crm/Objects/Communications/Model/CollectionResponseWithTotalSimplePublicObject.php index f0f7f21e..c92e7a73 100644 --- a/codegen/Crm/Objects/Communications/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php +++ b/codegen/Crm/Objects/Communications/Model/CollectionResponseWithTotalSimplePublicObject.php @@ -1,8 +1,8 @@ */ -class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements ModelInterface, ArrayAccess, \JsonSerializable +class CollectionResponseWithTotalSimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +50,7 @@ class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements Mode * * @var string */ - protected static $openAPIModelName = 'CollectionResponseWithTotalSimplePublicObjectForwardPaging'; + protected static $openAPIModelName = 'CollectionResponseWithTotalSimplePublicObject'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,9 +58,9 @@ class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements Mode * @var string[] */ protected static $openAPITypes = [ - 'total' => 'int', - 'paging' => '\HubSpot\Client\Crm\Objects\Communications\Model\ForwardPaging', - 'results' => '\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObject[]' + 'paging' => '\HubSpot\Client\Crm\Objects\Communications\Model\Paging', + 'results' => '\HubSpot\Client\Crm\Objects\Communications\Model\SimplePublicObject[]', + 'total' => 'int' ]; /** @@ -70,9 +71,9 @@ class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements Mode * @psalm-var array */ protected static $openAPIFormats = [ - 'total' => 'int32', 'paging' => null, - 'results' => null + 'results' => null, + 'total' => 'int32' ]; /** @@ -81,9 +82,9 @@ class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements Mode * @var boolean[] */ protected static array $openAPINullables = [ - 'total' => false, 'paging' => false, - 'results' => false + 'results' => false, + 'total' => false ]; /** @@ -172,9 +173,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'total' => 'total', 'paging' => 'paging', - 'results' => 'results' + 'results' => 'results', + 'total' => 'total' ]; /** @@ -183,9 +184,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'total' => 'setTotal', 'paging' => 'setPaging', - 'results' => 'setResults' + 'results' => 'setResults', + 'total' => 'setTotal' ]; /** @@ -194,9 +195,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'total' => 'getTotal', 'paging' => 'getPaging', - 'results' => 'getResults' + 'results' => 'getResults', + 'total' => 'getTotal' ]; /** @@ -256,9 +257,9 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('total', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); } /** @@ -288,12 +289,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['total'] === null) { - $invalidProperties[] = "'total' can't be null"; - } if ($this->container['results'] === null) { $invalidProperties[] = "'results' can't be null"; } + if ($this->container['total'] === null) { + $invalidProperties[] = "'total' can't be null"; + } return $invalidProperties; } @@ -309,37 +310,10 @@ public function valid() } - /** - * Gets total - * - * @return int - */ - public function getTotal() - { - return $this->container['total']; - } - - /** - * Sets total - * - * @param int $total total - * - * @return self - */ - public function setTotal($total) - { - if (is_null($total)) { - throw new \InvalidArgumentException('non-nullable total cannot be null'); - } - $this->container['total'] = $total; - - return $this; - } - /** * Gets paging * - * @return \HubSpot\Client\Crm\Objects\Communications\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\Communications\Model\Paging|null */ public function getPaging() { @@ -349,7 +323,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\Communications\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\Communications\Model\Paging|null $paging paging * * @return self */ @@ -389,14 +363,41 @@ public function setResults($results) return $this; } + + /** + * Gets total + * + * @return int + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int $total The number of available results + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } /** * 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]); } @@ -404,12 +405,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; } @@ -434,11 +435,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/Objects/Communications/Model/Error.php b/codegen/Crm/Objects/Communications/Model/Error.php index 73ed75db..ee1343fd 100644 --- a/codegen/Crm/Objects/Communications/Model/Error.php +++ b/codegen/Crm/Objects/Communications/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,13 +57,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'string', + 'category' => 'string', 'context' => 'array', 'correlation_id' => 'string', + 'errors' => '\HubSpot\Client\Crm\Objects\Communications\Model\ErrorDetail[]', 'links' => 'array', 'message' => 'string', - 'category' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\Communications\Model\ErrorDetail[]' + 'sub_category' => 'string' ]; /** @@ -74,13 +74,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, + 'category' => null, 'context' => null, 'correlation_id' => 'uuid', + 'errors' => null, 'links' => null, 'message' => null, - 'category' => null, - 'errors' => null + 'sub_category' => null ]; /** @@ -89,13 +89,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, + 'category' => false, 'context' => false, 'correlation_id' => false, + 'errors' => false, 'links' => false, 'message' => false, - 'category' => false, - 'errors' => false + 'sub_category' => false ]; /** @@ -184,13 +184,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', + 'category' => 'category', 'context' => 'context', 'correlation_id' => 'correlationId', + 'errors' => 'errors', 'links' => 'links', 'message' => 'message', - 'category' => 'category', - 'errors' => 'errors' + 'sub_category' => 'subCategory' ]; /** @@ -199,13 +199,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', + 'category' => 'setCategory', 'context' => 'setContext', 'correlation_id' => 'setCorrelationId', + 'errors' => 'setErrors', 'links' => 'setLinks', 'message' => 'setMessage', - 'category' => 'setCategory', - 'errors' => 'setErrors' + 'sub_category' => 'setSubCategory' ]; /** @@ -214,13 +214,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', + 'category' => 'getCategory', 'context' => 'getContext', 'correlation_id' => 'getCorrelationId', + 'errors' => 'getErrors', 'links' => 'getLinks', 'message' => 'getMessage', - 'category' => 'getCategory', - 'errors' => 'getErrors' + 'sub_category' => 'getSubCategory' ]; /** @@ -280,13 +280,13 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); $this->setIfExists('correlation_id', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('links', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); - $this->setIfExists('category', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -316,15 +316,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['category'] === null) { + $invalidProperties[] = "'category' can't be null"; + } if ($this->container['correlation_id'] === null) { $invalidProperties[] = "'correlation_id' can't be null"; } if ($this->container['message'] === null) { $invalidProperties[] = "'message' can't be null"; } - if ($this->container['category'] === null) { - $invalidProperties[] = "'category' can't be null"; - } return $invalidProperties; } @@ -341,28 +341,28 @@ public function valid() /** - * Gets sub_category + * Gets category * - * @return string|null + * @return string */ - public function getSubCategory() + public function getCategory() { - return $this->container['sub_category']; + return $this->container['category']; } /** - * Sets sub_category + * Sets category * - * @param string|null $sub_category A specific category that contains more specific detail about the error + * @param string $category The error category * * @return self */ - public function setSubCategory($sub_category) + public function setCategory($category) { - if (is_null($sub_category)) { - throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['sub_category'] = $sub_category; + $this->container['category'] = $category; return $this; } @@ -421,6 +421,33 @@ public function setCorrelationId($correlation_id) return $this; } + /** + * Gets errors + * + * @return \HubSpot\Client\Crm\Objects\Communications\Model\ErrorDetail[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Objects\Communications\Model\ErrorDetail[]|null $errors further information about the error + * + * @return self + */ + public function setErrors($errors) + { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; + + return $this; + } + /** * Gets links * @@ -476,66 +503,39 @@ public function setMessage($message) } /** - * Gets category - * - * @return string - */ - public function getCategory() - { - return $this->container['category']; - } - - /** - * Sets category - * - * @param string $category The error category - * - * @return self - */ - public function setCategory($category) - { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); - } - $this->container['category'] = $category; - - return $this; - } - - /** - * Gets errors + * Gets sub_category * - * @return \HubSpot\Client\Crm\Objects\Communications\Model\ErrorDetail[]|null + * @return string|null */ - public function getErrors() + public function getSubCategory() { - return $this->container['errors']; + return $this->container['sub_category']; } /** - * Sets errors + * Sets sub_category * - * @param \HubSpot\Client\Crm\Objects\Communications\Model\ErrorDetail[]|null $errors further information about the error + * @param string|null $sub_category A specific category that contains more specific detail about the error * * @return self */ - public function setErrors($errors) + public function setSubCategory($sub_category) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['errors'] = $errors; + $this->container['sub_category'] = $sub_category; return $this; } /** * 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/Objects/Communications/Model/ErrorDetail.php b/codegen/Crm/Objects/Communications/Model/ErrorDetail.php index c97ecb1b..e72c5c67 100644 --- a/codegen/Crm/Objects/Communications/Model/ErrorDetail.php +++ b/codegen/Crm/Objects/Communications/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,11 +57,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'string', 'code' => 'string', - 'in' => 'string', 'context' => 'array', - 'message' => 'string' + 'in' => 'string', + 'message' => 'string', + 'sub_category' => 'string' ]; /** @@ -72,11 +72,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, 'code' => null, - 'in' => null, 'context' => null, - 'message' => null + 'in' => null, + 'message' => null, + 'sub_category' => null ]; /** @@ -85,11 +85,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, 'code' => false, - 'in' => false, 'context' => false, - 'message' => false + 'in' => false, + 'message' => false, + 'sub_category' => false ]; /** @@ -178,11 +178,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', 'code' => 'code', - 'in' => 'in', 'context' => 'context', - 'message' => 'message' + 'in' => 'in', + 'message' => 'message', + 'sub_category' => 'subCategory' ]; /** @@ -191,11 +191,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', 'code' => 'setCode', - 'in' => 'setIn', 'context' => 'setContext', - 'message' => 'setMessage' + 'in' => 'setIn', + 'message' => 'setMessage', + 'sub_category' => 'setSubCategory' ]; /** @@ -204,11 +204,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', 'code' => 'getCode', - 'in' => 'getIn', 'context' => 'getContext', - 'message' => 'getMessage' + 'in' => 'getIn', + 'message' => 'getMessage', + 'sub_category' => 'getSubCategory' ]; /** @@ -268,11 +268,11 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('in', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); + $this->setIfExists('in', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -321,55 +321,55 @@ public function valid() /** - * Gets sub_category + * Gets code * * @return string|null */ - public function getSubCategory() + public function getCode() { - return $this->container['sub_category']; + return $this->container['code']; } /** - * Sets sub_category + * Sets code * - * @param string|null $sub_category A specific category that contains more specific detail about the error + * @param string|null $code The status code associated with the error detail * * @return self */ - public function setSubCategory($sub_category) + public function setCode($code) { - if (is_null($sub_category)) { - throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); } - $this->container['sub_category'] = $sub_category; + $this->container['code'] = $code; return $this; } /** - * Gets code + * Gets context * - * @return string|null + * @return array|null */ - public function getCode() + public function getContext() { - return $this->container['code']; + return $this->container['context']; } /** - * Sets code + * Sets context * - * @param string|null $code The status code associated with the error detail + * @param array|null $context Context about the error condition * * @return self */ - public function setCode($code) + public function setContext($context) { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); + if (is_null($context)) { + throw new \InvalidArgumentException('non-nullable context cannot be null'); } - $this->container['code'] = $code; + $this->container['context'] = $context; return $this; } @@ -402,66 +402,66 @@ public function setIn($in) } /** - * Gets context + * Gets message * - * @return array|null + * @return string */ - public function getContext() + public function getMessage() { - return $this->container['context']; + return $this->container['message']; } /** - * Sets context + * Sets message * - * @param array|null $context Context about the error condition + * @param string $message A human readable message describing the error along with remediation steps where appropriate * * @return self */ - public function setContext($context) + public function setMessage($message) { - if (is_null($context)) { - throw new \InvalidArgumentException('non-nullable context cannot be null'); + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - $this->container['context'] = $context; + $this->container['message'] = $message; return $this; } /** - * Gets message + * Gets sub_category * - * @return string + * @return string|null */ - public function getMessage() + public function getSubCategory() { - return $this->container['message']; + return $this->container['sub_category']; } /** - * Sets message + * Sets sub_category * - * @param string $message A human readable message describing the error along with remediation steps where appropriate + * @param string|null $sub_category A specific category that contains more specific detail about the error * * @return self */ - public function setMessage($message) + public function setSubCategory($sub_category) { - if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['message'] = $message; + $this->container['sub_category'] = $sub_category; return $this; } /** * 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/Objects/Communications/Model/Filter.php b/codegen/Crm/Objects/Communications/Model/Filter.php index 41a594b8..ef9631a2 100644 --- a/codegen/Crm/Objects/Communications/Model/Filter.php +++ b/codegen/Crm/Objects/Communications/Model/Filter.php @@ -2,7 +2,7 @@ /** * Filter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * Filter Class Doc Comment * * @category Class + * @description Defines a single condition for searching CRM objects, specifying the property to filter on, the operator to use (such as equals, greater than, or contains), and the value(s) to compare against. * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,10 +59,10 @@ class Filter implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'high_value' => 'string', + 'operator' => 'string', 'property_name' => 'string', - 'values' => 'string[]', 'value' => 'string', - 'operator' => 'string' + 'values' => 'string[]' ]; /** @@ -73,10 +74,10 @@ class Filter implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'high_value' => null, + 'operator' => null, 'property_name' => null, - 'values' => null, 'value' => null, - 'operator' => null + 'values' => null ]; /** @@ -86,10 +87,10 @@ class Filter implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'high_value' => false, + 'operator' => false, 'property_name' => false, - 'values' => false, 'value' => false, - 'operator' => false + 'values' => false ]; /** @@ -179,10 +180,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'high_value' => 'highValue', + 'operator' => 'operator', 'property_name' => 'propertyName', - 'values' => 'values', 'value' => 'value', - 'operator' => 'operator' + 'values' => 'values' ]; /** @@ -192,10 +193,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'high_value' => 'setHighValue', + 'operator' => 'setOperator', 'property_name' => 'setPropertyName', - 'values' => 'setValues', 'value' => 'setValue', - 'operator' => 'setOperator' + 'values' => 'setValues' ]; /** @@ -205,10 +206,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'high_value' => 'getHighValue', + 'operator' => 'getOperator', 'property_name' => 'getPropertyName', - 'values' => 'getValues', 'value' => 'getValue', - 'operator' => 'getOperator' + 'values' => 'getValues' ]; /** @@ -252,19 +253,19 @@ public function getModelName() return self::$openAPIModelName; } + public const OPERATOR_BETWEEN = 'BETWEEN'; + public const OPERATOR_CONTAINS_TOKEN = 'CONTAINS_TOKEN'; public const OPERATOR_EQ = 'EQ'; - public const OPERATOR_NEQ = 'NEQ'; - public const OPERATOR_LT = 'LT'; - public const OPERATOR_LTE = 'LTE'; public const OPERATOR_GT = 'GT'; public const OPERATOR_GTE = 'GTE'; - public const OPERATOR_BETWEEN = 'BETWEEN'; - public const OPERATOR_IN = 'IN'; - public const OPERATOR_NOT_IN = 'NOT_IN'; public const OPERATOR_HAS_PROPERTY = 'HAS_PROPERTY'; - public const OPERATOR_NOT_HAS_PROPERTY = 'NOT_HAS_PROPERTY'; - public const OPERATOR_CONTAINS_TOKEN = 'CONTAINS_TOKEN'; + public const OPERATOR_IN = 'IN'; + public const OPERATOR_LT = 'LT'; + public const OPERATOR_LTE = 'LTE'; + public const OPERATOR_NEQ = 'NEQ'; public const OPERATOR_NOT_CONTAINS_TOKEN = 'NOT_CONTAINS_TOKEN'; + public const OPERATOR_NOT_HAS_PROPERTY = 'NOT_HAS_PROPERTY'; + public const OPERATOR_NOT_IN = 'NOT_IN'; /** * Gets allowable values of the enum @@ -274,19 +275,19 @@ public function getModelName() public function getOperatorAllowableValues() { return [ + self::OPERATOR_BETWEEN, + self::OPERATOR_CONTAINS_TOKEN, self::OPERATOR_EQ, - self::OPERATOR_NEQ, - self::OPERATOR_LT, - self::OPERATOR_LTE, self::OPERATOR_GT, self::OPERATOR_GTE, - self::OPERATOR_BETWEEN, - self::OPERATOR_IN, - self::OPERATOR_NOT_IN, self::OPERATOR_HAS_PROPERTY, - self::OPERATOR_NOT_HAS_PROPERTY, - self::OPERATOR_CONTAINS_TOKEN, + self::OPERATOR_IN, + self::OPERATOR_LT, + self::OPERATOR_LTE, + self::OPERATOR_NEQ, self::OPERATOR_NOT_CONTAINS_TOKEN, + self::OPERATOR_NOT_HAS_PROPERTY, + self::OPERATOR_NOT_IN, ]; } @@ -306,10 +307,10 @@ public function getOperatorAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('high_value', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); $this->setIfExists('property_name', $data ?? [], null); - $this->setIfExists('values', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); - $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); } /** @@ -339,9 +340,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['property_name'] === null) { - $invalidProperties[] = "'property_name' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } @@ -354,6 +352,9 @@ public function listInvalidProperties() ); } + if ($this->container['property_name'] === null) { + $invalidProperties[] = "'property_name' can't be null"; + } return $invalidProperties; } @@ -382,7 +383,7 @@ public function getHighValue() /** * Sets high_value * - * @param string|null $high_value high_value + * @param string|null $high_value The upper boundary value when using ranged-based filters. * * @return self */ @@ -397,55 +398,65 @@ public function setHighValue($high_value) } /** - * Gets property_name + * Gets operator * * @return string */ - public function getPropertyName() + public function getOperator() { - return $this->container['property_name']; + return $this->container['operator']; } /** - * Sets property_name + * Sets operator * - * @param string $property_name property_name + * @param string $operator null * * @return self */ - public function setPropertyName($property_name) + public function setOperator($operator) { - if (is_null($property_name)) { - throw new \InvalidArgumentException('non-nullable property_name cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['property_name'] = $property_name; + $allowedValues = $this->getOperatorAllowableValues(); + if (!in_array($operator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'operator', must be one of '%s'", + $operator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['operator'] = $operator; return $this; } /** - * Gets values + * Gets property_name * - * @return string[]|null + * @return string */ - public function getValues() + public function getPropertyName() { - return $this->container['values']; + return $this->container['property_name']; } /** - * Sets values + * Sets property_name * - * @param string[]|null $values values + * @param string $property_name The name of the property to apply the filter to. * * @return self */ - public function setValues($values) + public function setPropertyName($property_name) { - if (is_null($values)) { - throw new \InvalidArgumentException('non-nullable values cannot be null'); + if (is_null($property_name)) { + throw new \InvalidArgumentException('non-nullable property_name cannot be null'); } - $this->container['values'] = $values; + $this->container['property_name'] = $property_name; return $this; } @@ -463,7 +474,7 @@ public function getValue() /** * Sets value * - * @param string|null $value value + * @param string|null $value The value to match against the property. * * @return self */ @@ -478,49 +489,39 @@ public function setValue($value) } /** - * Gets operator + * Gets values * - * @return string + * @return string[]|null */ - public function getOperator() + public function getValues() { - return $this->container['operator']; + return $this->container['values']; } /** - * Sets operator + * Sets values * - * @param string $operator null + * @param string[]|null $values The values to match against the property. * * @return self */ - public function setOperator($operator) + public function setValues($values) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); - } - $allowedValues = $this->getOperatorAllowableValues(); - if (!in_array($operator, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'operator', must be one of '%s'", - $operator, - implode("', '", $allowedValues) - ) - ); + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); } - $this->container['operator'] = $operator; + $this->container['values'] = $values; return $this; } /** * 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]); } @@ -528,12 +529,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; } @@ -558,11 +559,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/Objects/Communications/Model/FilterGroup.php b/codegen/Crm/Objects/Communications/Model/FilterGroup.php index 616ee858..e594d04f 100644 --- a/codegen/Crm/Objects/Communications/Model/FilterGroup.php +++ b/codegen/Crm/Objects/Communications/Model/FilterGroup.php @@ -2,7 +2,7 @@ /** * FilterGroup * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -321,11 +321,11 @@ public function setFilters($filters) /** * 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/Objects/Communications/Model/ForwardPaging.php b/codegen/Crm/Objects/Communications/Model/ForwardPaging.php deleted file mode 100644 index ce56282d..00000000 --- a/codegen/Crm/Objects/Communications/Model/ForwardPaging.php +++ /dev/null @@ -1,409 +0,0 @@ - - */ -class ForwardPaging implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'ForwardPaging'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'next' => '\HubSpot\Client\Crm\Objects\Communications\Model\NextPage' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'next' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'next' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'next' => 'next' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'next' => 'setNext' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'next' => 'getNext' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('next', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets next - * - * @return \HubSpot\Client\Crm\Objects\Communications\Model\NextPage|null - */ - public function getNext() - { - return $this->container['next']; - } - - /** - * Sets next - * - * @param \HubSpot\Client\Crm\Objects\Communications\Model\NextPage|null $next next - * - * @return self - */ - public function setNext($next) - { - if (is_null($next)) { - throw new \InvalidArgumentException('non-nullable next cannot be null'); - } - $this->container['next'] = $next; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/codegen/Crm/Objects/Communications/Model/ModelInterface.php b/codegen/Crm/Objects/Communications/Model/ModelInterface.php index 49a4fefa..f5428a40 100644 --- a/codegen/Crm/Objects/Communications/Model/ModelInterface.php +++ b/codegen/Crm/Objects/Communications/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications\Model @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/Communications/Model/NextPage.php b/codegen/Crm/Objects/Communications/Model/NextPage.php index 37d3f355..6e0094c3 100644 --- a/codegen/Crm/Objects/Communications/Model/NextPage.php +++ b/codegen/Crm/Objects/Communications/Model/NextPage.php @@ -2,7 +2,7 @@ /** * NextPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * NextPage Class Doc Comment * * @category Class + * @description Specifies the paging information needed to retrieve the next set of results in a paginated API response * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,8 +58,8 @@ class NextPage implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'link' => 'string', - 'after' => 'string' + 'after' => 'string', + 'link' => 'string' ]; /** @@ -69,8 +70,8 @@ class NextPage implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'link' => null, - 'after' => null + 'after' => null, + 'link' => null ]; /** @@ -79,8 +80,8 @@ class NextPage implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'link' => false, - 'after' => false + 'after' => false, + 'link' => false ]; /** @@ -169,8 +170,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'link' => 'link', - 'after' => 'after' + 'after' => 'after', + 'link' => 'link' ]; /** @@ -179,8 +180,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'link' => 'setLink', - 'after' => 'setAfter' + 'after' => 'setAfter', + 'link' => 'setLink' ]; /** @@ -189,8 +190,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'link' => 'getLink', - 'after' => 'getAfter' + 'after' => 'getAfter', + 'link' => 'getLink' ]; /** @@ -250,8 +251,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('link', $data ?? [], null); $this->setIfExists('after', $data ?? [], null); + $this->setIfExists('link', $data ?? [], null); } /** @@ -300,66 +301,66 @@ public function valid() /** - * Gets link + * Gets after * - * @return string|null + * @return string */ - public function getLink() + public function getAfter() { - return $this->container['link']; + return $this->container['after']; } /** - * Sets link + * Sets after * - * @param string|null $link link + * @param string $after A paging cursor token for retrieving subsequent pages. * * @return self */ - public function setLink($link) + public function setAfter($after) { - if (is_null($link)) { - throw new \InvalidArgumentException('non-nullable link cannot be null'); + if (is_null($after)) { + throw new \InvalidArgumentException('non-nullable after cannot be null'); } - $this->container['link'] = $link; + $this->container['after'] = $after; return $this; } /** - * Gets after + * Gets link * - * @return string + * @return string|null */ - public function getAfter() + public function getLink() { - return $this->container['after']; + return $this->container['link']; } /** - * Sets after + * Sets link * - * @param string $after after + * @param string|null $link A URL that can be used to retrieve the next page results. * * @return self */ - public function setAfter($after) + public function setLink($link) { - if (is_null($after)) { - throw new \InvalidArgumentException('non-nullable after cannot be null'); + if (is_null($link)) { + throw new \InvalidArgumentException('non-nullable link cannot be null'); } - $this->container['after'] = $after; + $this->container['link'] = $link; return $this; } /** * 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]); } @@ -367,12 +368,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; } @@ -397,11 +398,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/Objects/Communications/Model/Paging.php b/codegen/Crm/Objects/Communications/Model/Paging.php index 484f63a0..8fd93f0c 100644 --- a/codegen/Crm/Objects/Communications/Model/Paging.php +++ b/codegen/Crm/Objects/Communications/Model/Paging.php @@ -2,7 +2,7 @@ /** * Paging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -352,11 +352,11 @@ public function setPrev($prev) /** * 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]); } @@ -364,12 +364,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; } @@ -394,11 +394,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/Objects/Communications/Model/PreviousPage.php b/codegen/Crm/Objects/Communications/Model/PreviousPage.php index 4d683bc6..728865e4 100644 --- a/codegen/Crm/Objects/Communications/Model/PreviousPage.php +++ b/codegen/Crm/Objects/Communications/Model/PreviousPage.php @@ -2,7 +2,7 @@ /** * PreviousPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * PreviousPage Class Doc Comment * * @category Class + * @description specifies the paging information needed to retrieve the previous set of results in a paginated API response * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -312,7 +313,7 @@ public function getBefore() /** * Sets before * - * @param string $before before + * @param string $before A paging cursor token for retrieving previous pages. * * @return self */ @@ -339,7 +340,7 @@ public function getLink() /** * Sets link * - * @param string|null $link link + * @param string|null $link A URL that can be used to retrieve the previous pages' results. * * @return self */ @@ -355,11 +356,11 @@ public function setLink($link) /** * 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]); } @@ -367,12 +368,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; } @@ -397,11 +398,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/Objects/Communications/Model/PublicAssociationsForObject.php b/codegen/Crm/Objects/Communications/Model/PublicAssociationsForObject.php index b1f238a6..907d6c0f 100644 --- a/codegen/Crm/Objects/Communications/Model/PublicAssociationsForObject.php +++ b/codegen/Crm/Objects/Communications/Model/PublicAssociationsForObject.php @@ -2,7 +2,7 @@ /** * PublicAssociationsForObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,8 +57,8 @@ class PublicAssociationsForObject implements ModelInterface, ArrayAccess, \JsonS * @var string[] */ protected static $openAPITypes = [ - 'types' => '\HubSpot\Client\Crm\Objects\Communications\Model\AssociationSpec[]', - 'to' => '\HubSpot\Client\Crm\Objects\Communications\Model\PublicObjectId' + 'to' => '\HubSpot\Client\Crm\Objects\Communications\Model\PublicObjectId', + 'types' => '\HubSpot\Client\Crm\Objects\Communications\Model\AssociationSpec[]' ]; /** @@ -69,8 +69,8 @@ class PublicAssociationsForObject implements ModelInterface, ArrayAccess, \JsonS * @psalm-var array */ protected static $openAPIFormats = [ - 'types' => null, - 'to' => null + 'to' => null, + 'types' => null ]; /** @@ -79,8 +79,8 @@ class PublicAssociationsForObject implements ModelInterface, ArrayAccess, \JsonS * @var boolean[] */ protected static array $openAPINullables = [ - 'types' => false, - 'to' => false + 'to' => false, + 'types' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'types' => 'types', - 'to' => 'to' + 'to' => 'to', + 'types' => 'types' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'types' => 'setTypes', - 'to' => 'setTo' + 'to' => 'setTo', + 'types' => 'setTypes' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'types' => 'getTypes', - 'to' => 'getTo' + 'to' => 'getTo', + 'types' => 'getTypes' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('types', $data ?? [], null); $this->setIfExists('to', $data ?? [], null); + $this->setIfExists('types', $data ?? [], null); } /** @@ -281,12 +281,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['types'] === null) { - $invalidProperties[] = "'types' can't be null"; - } if ($this->container['to'] === null) { $invalidProperties[] = "'to' can't be null"; } + if ($this->container['types'] === null) { + $invalidProperties[] = "'types' can't be null"; + } return $invalidProperties; } @@ -303,66 +303,66 @@ public function valid() /** - * Gets types + * Gets to * - * @return \HubSpot\Client\Crm\Objects\Communications\Model\AssociationSpec[] + * @return \HubSpot\Client\Crm\Objects\Communications\Model\PublicObjectId */ - public function getTypes() + public function getTo() { - return $this->container['types']; + return $this->container['to']; } /** - * Sets types + * Sets to * - * @param \HubSpot\Client\Crm\Objects\Communications\Model\AssociationSpec[] $types types + * @param \HubSpot\Client\Crm\Objects\Communications\Model\PublicObjectId $to to * * @return self */ - public function setTypes($types) + public function setTo($to) { - if (is_null($types)) { - throw new \InvalidArgumentException('non-nullable types cannot be null'); + if (is_null($to)) { + throw new \InvalidArgumentException('non-nullable to cannot be null'); } - $this->container['types'] = $types; + $this->container['to'] = $to; return $this; } /** - * Gets to + * Gets types * - * @return \HubSpot\Client\Crm\Objects\Communications\Model\PublicObjectId + * @return \HubSpot\Client\Crm\Objects\Communications\Model\AssociationSpec[] */ - public function getTo() + public function getTypes() { - return $this->container['to']; + return $this->container['types']; } /** - * Sets to + * Sets types * - * @param \HubSpot\Client\Crm\Objects\Communications\Model\PublicObjectId $to to + * @param \HubSpot\Client\Crm\Objects\Communications\Model\AssociationSpec[] $types types * * @return self */ - public function setTo($to) + public function setTypes($types) { - if (is_null($to)) { - throw new \InvalidArgumentException('non-nullable to cannot be null'); + if (is_null($types)) { + throw new \InvalidArgumentException('non-nullable types cannot be null'); } - $this->container['to'] = $to; + $this->container['types'] = $types; return $this; } /** * 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/Objects/Communications/Model/PublicObjectId.php b/codegen/Crm/Objects/Communications/Model/PublicObjectId.php index 0cef465a..186398da 100644 --- a/codegen/Crm/Objects/Communications/Model/PublicObjectId.php +++ b/codegen/Crm/Objects/Communications/Model/PublicObjectId.php @@ -2,7 +2,7 @@ /** * PublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * PublicObjectId Class Doc Comment * * @category Class + * @description Contains the Id of a Public Object * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -305,7 +306,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -321,11 +322,11 @@ public function setId($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]); } @@ -333,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; } @@ -363,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/Objects/Communications/Model/PublicObjectSearchRequest.php b/codegen/Crm/Objects/Communications/Model/PublicObjectSearchRequest.php index 27377360..8196118a 100644 --- a/codegen/Crm/Objects/Communications/Model/PublicObjectSearchRequest.php +++ b/codegen/Crm/Objects/Communications/Model/PublicObjectSearchRequest.php @@ -2,7 +2,7 @@ /** * PublicObjectSearchRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * PublicObjectSearchRequest Class Doc Comment * * @category Class + * @description Describes a search request * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,12 +58,12 @@ class PublicObjectSearchRequest implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ - 'query' => 'string', - 'limit' => 'int', 'after' => 'string', - 'sorts' => 'string[]', + 'filter_groups' => '\HubSpot\Client\Crm\Objects\Communications\Model\FilterGroup[]', + 'limit' => 'int', 'properties' => 'string[]', - 'filter_groups' => '\HubSpot\Client\Crm\Objects\Communications\Model\FilterGroup[]' + 'query' => 'string', + 'sorts' => 'string[]' ]; /** @@ -73,12 +74,12 @@ class PublicObjectSearchRequest implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ - 'query' => null, - 'limit' => 'int32', 'after' => null, - 'sorts' => null, + 'filter_groups' => null, + 'limit' => 'int32', 'properties' => null, - 'filter_groups' => null + 'query' => null, + 'sorts' => null ]; /** @@ -87,12 +88,12 @@ class PublicObjectSearchRequest implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static array $openAPINullables = [ - 'query' => false, - 'limit' => false, 'after' => false, - 'sorts' => false, + 'filter_groups' => false, + 'limit' => false, 'properties' => false, - 'filter_groups' => false + 'query' => false, + 'sorts' => false ]; /** @@ -181,12 +182,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'query' => 'query', - 'limit' => 'limit', 'after' => 'after', - 'sorts' => 'sorts', + 'filter_groups' => 'filterGroups', + 'limit' => 'limit', 'properties' => 'properties', - 'filter_groups' => 'filterGroups' + 'query' => 'query', + 'sorts' => 'sorts' ]; /** @@ -195,12 +196,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'query' => 'setQuery', - 'limit' => 'setLimit', 'after' => 'setAfter', - 'sorts' => 'setSorts', + 'filter_groups' => 'setFilterGroups', + 'limit' => 'setLimit', 'properties' => 'setProperties', - 'filter_groups' => 'setFilterGroups' + 'query' => 'setQuery', + 'sorts' => 'setSorts' ]; /** @@ -209,12 +210,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'query' => 'getQuery', - 'limit' => 'getLimit', 'after' => 'getAfter', - 'sorts' => 'getSorts', + 'filter_groups' => 'getFilterGroups', + 'limit' => 'getLimit', 'properties' => 'getProperties', - 'filter_groups' => 'getFilterGroups' + 'query' => 'getQuery', + 'sorts' => 'getSorts' ]; /** @@ -274,12 +275,12 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('query', $data ?? [], null); - $this->setIfExists('limit', $data ?? [], null); $this->setIfExists('after', $data ?? [], null); - $this->setIfExists('sorts', $data ?? [], null); - $this->setIfExists('properties', $data ?? [], null); $this->setIfExists('filter_groups', $data ?? [], null); + $this->setIfExists('limit', $data ?? [], null); + $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('query', $data ?? [], null); + $this->setIfExists('sorts', $data ?? [], null); } /** @@ -325,174 +326,174 @@ public function valid() /** - * Gets query + * Gets after * * @return string|null */ - public function getQuery() + public function getAfter() { - return $this->container['query']; + return $this->container['after']; } /** - * Sets query + * Sets after * - * @param string|null $query query + * @param string|null $after A paging cursor token for retrieving subsequent pages. * * @return self */ - public function setQuery($query) + public function setAfter($after) { - if (is_null($query)) { - throw new \InvalidArgumentException('non-nullable query cannot be null'); + if (is_null($after)) { + throw new \InvalidArgumentException('non-nullable after cannot be null'); } - $this->container['query'] = $query; + $this->container['after'] = $after; return $this; } /** - * Gets limit + * Gets filter_groups * - * @return int|null + * @return \HubSpot\Client\Crm\Objects\Communications\Model\FilterGroup[]|null */ - public function getLimit() + public function getFilterGroups() { - return $this->container['limit']; + return $this->container['filter_groups']; } /** - * Sets limit + * Sets filter_groups * - * @param int|null $limit limit + * @param \HubSpot\Client\Crm\Objects\Communications\Model\FilterGroup[]|null $filter_groups Up to 6 groups of filters defining additional query criteria. * * @return self */ - public function setLimit($limit) + public function setFilterGroups($filter_groups) { - if (is_null($limit)) { - throw new \InvalidArgumentException('non-nullable limit cannot be null'); + if (is_null($filter_groups)) { + throw new \InvalidArgumentException('non-nullable filter_groups cannot be null'); } - $this->container['limit'] = $limit; + $this->container['filter_groups'] = $filter_groups; return $this; } /** - * Gets after + * Gets limit * - * @return string|null + * @return int|null */ - public function getAfter() + public function getLimit() { - return $this->container['after']; + return $this->container['limit']; } /** - * Sets after + * Sets limit * - * @param string|null $after after + * @param int|null $limit The maximum results to return, up to 200 objects. * * @return self */ - public function setAfter($after) + public function setLimit($limit) { - if (is_null($after)) { - throw new \InvalidArgumentException('non-nullable after cannot be null'); + if (is_null($limit)) { + throw new \InvalidArgumentException('non-nullable limit cannot be null'); } - $this->container['after'] = $after; + $this->container['limit'] = $limit; return $this; } /** - * Gets sorts + * Gets properties * * @return string[]|null */ - public function getSorts() + public function getProperties() { - return $this->container['sorts']; + return $this->container['properties']; } /** - * Sets sorts + * Sets properties * - * @param string[]|null $sorts sorts + * @param string[]|null $properties A list of property names to include in the response. * * @return self */ - public function setSorts($sorts) + public function setProperties($properties) { - if (is_null($sorts)) { - throw new \InvalidArgumentException('non-nullable sorts cannot be null'); + if (is_null($properties)) { + throw new \InvalidArgumentException('non-nullable properties cannot be null'); } - $this->container['sorts'] = $sorts; + $this->container['properties'] = $properties; return $this; } /** - * Gets properties + * Gets query * - * @return string[]|null + * @return string|null */ - public function getProperties() + public function getQuery() { - return $this->container['properties']; + return $this->container['query']; } /** - * Sets properties + * Sets query * - * @param string[]|null $properties properties + * @param string|null $query The search query string, up to 3000 characters. * * @return self */ - public function setProperties($properties) + public function setQuery($query) { - if (is_null($properties)) { - throw new \InvalidArgumentException('non-nullable properties cannot be null'); + if (is_null($query)) { + throw new \InvalidArgumentException('non-nullable query cannot be null'); } - $this->container['properties'] = $properties; + $this->container['query'] = $query; return $this; } /** - * Gets filter_groups + * Gets sorts * - * @return \HubSpot\Client\Crm\Objects\Communications\Model\FilterGroup[]|null + * @return string[]|null */ - public function getFilterGroups() + public function getSorts() { - return $this->container['filter_groups']; + return $this->container['sorts']; } /** - * Sets filter_groups + * Sets sorts * - * @param \HubSpot\Client\Crm\Objects\Communications\Model\FilterGroup[]|null $filter_groups filter_groups + * @param string[]|null $sorts Specifies sorting order based on object properties. * * @return self */ - public function setFilterGroups($filter_groups) + public function setSorts($sorts) { - if (is_null($filter_groups)) { - throw new \InvalidArgumentException('non-nullable filter_groups cannot be null'); + if (is_null($sorts)) { + throw new \InvalidArgumentException('non-nullable sorts cannot be null'); } - $this->container['filter_groups'] = $filter_groups; + $this->container['sorts'] = $sorts; return $this; } /** * 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]); } @@ -500,12 +501,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; } @@ -530,11 +531,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/Objects/Communications/Model/SimplePublicObject.php b/codegen/Crm/Objects/Communications/Model/SimplePublicObject.php index 064af215..5ea9959e 100644 --- a/codegen/Crm/Objects/Communications/Model/SimplePublicObject.php +++ b/codegen/Crm/Objects/Communications/Model/SimplePublicObject.php @@ -2,7 +2,7 @@ /** * SimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObject Class Doc Comment * * @category Class + * @description A simple public object. * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,13 +58,13 @@ class SimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'created_at' => '\DateTime', 'archived' => 'bool', 'archived_at' => '\DateTime', - 'properties_with_history' => 'array', + 'created_at' => '\DateTime', 'id' => 'string', 'object_write_trace_id' => 'string', 'properties' => 'array', + 'properties_with_history' => 'array', 'updated_at' => '\DateTime' ]; @@ -75,13 +76,13 @@ class SimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ - 'created_at' => 'date-time', 'archived' => null, 'archived_at' => 'date-time', - 'properties_with_history' => null, + 'created_at' => 'date-time', 'id' => null, 'object_write_trace_id' => null, 'properties' => null, + 'properties_with_history' => null, 'updated_at' => 'date-time' ]; @@ -91,13 +92,13 @@ class SimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializab * @var boolean[] */ protected static array $openAPINullables = [ - 'created_at' => false, 'archived' => false, 'archived_at' => false, - 'properties_with_history' => false, + 'created_at' => false, 'id' => false, 'object_write_trace_id' => false, 'properties' => false, + 'properties_with_history' => false, 'updated_at' => false ]; @@ -187,13 +188,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'created_at' => 'createdAt', 'archived' => 'archived', 'archived_at' => 'archivedAt', - 'properties_with_history' => 'propertiesWithHistory', + 'created_at' => 'createdAt', 'id' => 'id', 'object_write_trace_id' => 'objectWriteTraceId', 'properties' => 'properties', + 'properties_with_history' => 'propertiesWithHistory', 'updated_at' => 'updatedAt' ]; @@ -203,13 +204,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'created_at' => 'setCreatedAt', 'archived' => 'setArchived', 'archived_at' => 'setArchivedAt', - 'properties_with_history' => 'setPropertiesWithHistory', + 'created_at' => 'setCreatedAt', 'id' => 'setId', 'object_write_trace_id' => 'setObjectWriteTraceId', 'properties' => 'setProperties', + 'properties_with_history' => 'setPropertiesWithHistory', 'updated_at' => 'setUpdatedAt' ]; @@ -219,13 +220,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'created_at' => 'getCreatedAt', 'archived' => 'getArchived', 'archived_at' => 'getArchivedAt', - 'properties_with_history' => 'getPropertiesWithHistory', + 'created_at' => 'getCreatedAt', 'id' => 'getId', 'object_write_trace_id' => 'getObjectWriteTraceId', 'properties' => 'getProperties', + 'properties_with_history' => 'getPropertiesWithHistory', 'updated_at' => 'getUpdatedAt' ]; @@ -286,13 +287,13 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('archived', $data ?? [], null); $this->setIfExists('archived_at', $data ?? [], null); - $this->setIfExists('properties_with_history', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('properties_with_history', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); } @@ -323,6 +324,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['archived'] === null) { + $invalidProperties[] = "'archived' can't be null"; + } if ($this->container['created_at'] === null) { $invalidProperties[] = "'created_at' can't be null"; } @@ -350,37 +354,10 @@ public function valid() } - /** - * Gets created_at - * - * @return \DateTime - */ - public function getCreatedAt() - { - return $this->container['created_at']; - } - - /** - * Sets created_at - * - * @param \DateTime $created_at created_at - * - * @return self - */ - public function setCreatedAt($created_at) - { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); - } - $this->container['created_at'] = $created_at; - - return $this; - } - /** * Gets archived * - * @return bool|null + * @return bool */ public function getArchived() { @@ -390,7 +367,7 @@ public function getArchived() /** * Sets archived * - * @param bool|null $archived archived + * @param bool $archived Whether the object is archived. * * @return self */ @@ -417,7 +394,7 @@ public function getArchivedAt() /** * Sets archived_at * - * @param \DateTime|null $archived_at archived_at + * @param \DateTime|null $archived_at The timestamp when the object was archived, in ISO 8601 format. * * @return self */ @@ -432,28 +409,28 @@ public function setArchivedAt($archived_at) } /** - * Gets properties_with_history + * Gets created_at * - * @return array|null + * @return \DateTime */ - public function getPropertiesWithHistory() + public function getCreatedAt() { - return $this->container['properties_with_history']; + return $this->container['created_at']; } /** - * Sets properties_with_history + * Sets created_at * - * @param array|null $properties_with_history properties_with_history + * @param \DateTime $created_at The timestamp when the object was created, in ISO 8601 format. * * @return self */ - public function setPropertiesWithHistory($properties_with_history) + public function setCreatedAt($created_at) { - if (is_null($properties_with_history)) { - throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['properties_with_history'] = $properties_with_history; + $this->container['created_at'] = $created_at; return $this; } @@ -471,7 +448,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -498,7 +475,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id An identifier used for tracing the write request for the object. * * @return self */ @@ -525,7 +502,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key-value pairs representing the properties of the object. * * @return self */ @@ -539,6 +516,33 @@ public function setProperties($properties) return $this; } + /** + * Gets properties_with_history + * + * @return array|null + */ + public function getPropertiesWithHistory() + { + return $this->container['properties_with_history']; + } + + /** + * Sets properties_with_history + * + * @param array|null $properties_with_history Key-value pairs representing the properties of the object along with their history. + * + * @return self + */ + public function setPropertiesWithHistory($properties_with_history) + { + if (is_null($properties_with_history)) { + throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + } + $this->container['properties_with_history'] = $properties_with_history; + + return $this; + } + /** * Gets updated_at * @@ -552,7 +556,7 @@ public function getUpdatedAt() /** * Sets updated_at * - * @param \DateTime $updated_at updated_at + * @param \DateTime $updated_at The timestamp when the object was last updated, in ISO 8601 format. * * @return self */ @@ -568,11 +572,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]); } @@ -580,12 +584,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; } @@ -610,11 +614,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/Objects/Communications/Model/SimplePublicObjectBatchInput.php b/codegen/Crm/Objects/Communications/Model/SimplePublicObjectBatchInput.php index 59367a2a..e455fe94 100644 --- a/codegen/Crm/Objects/Communications/Model/SimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/Communications/Model/SimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectBatchInput Class Doc Comment * * @category Class + * @description Contains an array of CRM object records to be processed in a batch operation, each defined by their ID and properties. * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,9 +58,9 @@ class SimplePublicObjectBatchInput implements ModelInterface, ArrayAccess, \Json * @var string[] */ protected static $openAPITypes = [ + 'id' => 'string', 'id_property' => 'string', 'object_write_trace_id' => 'string', - 'id' => 'string', 'properties' => 'array' ]; @@ -71,9 +72,9 @@ class SimplePublicObjectBatchInput implements ModelInterface, ArrayAccess, \Json * @psalm-var array */ protected static $openAPIFormats = [ + 'id' => null, 'id_property' => null, 'object_write_trace_id' => null, - 'id' => null, 'properties' => null ]; @@ -83,9 +84,9 @@ class SimplePublicObjectBatchInput implements ModelInterface, ArrayAccess, \Json * @var boolean[] */ protected static array $openAPINullables = [ + 'id' => false, 'id_property' => false, 'object_write_trace_id' => false, - 'id' => false, 'properties' => false ]; @@ -175,9 +176,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'id' => 'id', 'id_property' => 'idProperty', 'object_write_trace_id' => 'objectWriteTraceId', - 'id' => 'id', 'properties' => 'properties' ]; @@ -187,9 +188,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'id' => 'setId', 'id_property' => 'setIdProperty', 'object_write_trace_id' => 'setObjectWriteTraceId', - 'id' => 'setId', 'properties' => 'setProperties' ]; @@ -199,9 +200,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'id' => 'getId', 'id_property' => 'getIdProperty', 'object_write_trace_id' => 'getObjectWriteTraceId', - 'id' => 'getId', 'properties' => 'getProperties' ]; @@ -262,9 +263,9 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('id', $data ?? [], null); $this->setIfExists('id_property', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); - $this->setIfExists('id', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); } @@ -316,6 +317,33 @@ public function valid() } + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The id to be updated. This can be the object id, or the unique property value of the idProperty property + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** * Gets id_property * @@ -356,7 +384,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id A unique identifier for tracing the request. * * @return self */ @@ -370,33 +398,6 @@ public function setObjectWriteTraceId($object_write_trace_id) return $this; } - /** - * Gets id - * - * @return string - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param string $id The id to be updated. This can be the object id, or the unique property value of the idProperty property - * - * @return self - */ - public function setId($id) - { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); - } - $this->container['id'] = $id; - - return $this; - } - /** * Gets properties * @@ -410,7 +411,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key-value pairs representing the properties of the object. * * @return self */ @@ -426,11 +427,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]); } @@ -438,12 +439,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; } @@ -468,11 +469,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/Objects/Communications/Model/SimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/Communications/Model/SimplePublicObjectBatchInputForCreate.php index d37e6f75..70bca9c0 100644 --- a/codegen/Crm/Objects/Communications/Model/SimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/Communications/Model/SimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectBatchInputForCreate Class Doc Comment * * @category Class + * @description An input object that contains a collection of objects to be created together in a batch. * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -346,7 +347,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id An identifier used for tracing the creation or update request of the object. * * @return self */ @@ -373,7 +374,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key value pairs representing the properties of the object. * * @return self */ @@ -389,11 +390,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]); } @@ -401,12 +402,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 +432,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/Objects/Communications/Model/SimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/Communications/Model/SimplePublicObjectBatchInputUpsert.php index 9ab75dc9..fadebf2b 100644 --- a/codegen/Crm/Objects/Communications/Model/SimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Objects/Communications/Model/SimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectBatchInputUpsert Class Doc Comment * * @category Class + * @description Represents an object used in batch upsert operations, containing an object’s unique identifier, its properties, and optionally the unique property name and a write trace ID. * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,9 +58,9 @@ class SimplePublicObjectBatchInputUpsert implements ModelInterface, ArrayAccess, * @var string[] */ protected static $openAPITypes = [ + 'id' => 'string', 'id_property' => 'string', 'object_write_trace_id' => 'string', - 'id' => 'string', 'properties' => 'array' ]; @@ -71,9 +72,9 @@ class SimplePublicObjectBatchInputUpsert implements ModelInterface, ArrayAccess, * @psalm-var array */ protected static $openAPIFormats = [ + 'id' => null, 'id_property' => null, 'object_write_trace_id' => null, - 'id' => null, 'properties' => null ]; @@ -83,9 +84,9 @@ class SimplePublicObjectBatchInputUpsert implements ModelInterface, ArrayAccess, * @var boolean[] */ protected static array $openAPINullables = [ + 'id' => false, 'id_property' => false, 'object_write_trace_id' => false, - 'id' => false, 'properties' => false ]; @@ -175,9 +176,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'id' => 'id', 'id_property' => 'idProperty', 'object_write_trace_id' => 'objectWriteTraceId', - 'id' => 'id', 'properties' => 'properties' ]; @@ -187,9 +188,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'id' => 'setId', 'id_property' => 'setIdProperty', 'object_write_trace_id' => 'setObjectWriteTraceId', - 'id' => 'setId', 'properties' => 'setProperties' ]; @@ -199,9 +200,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'id' => 'getId', 'id_property' => 'getIdProperty', 'object_write_trace_id' => 'getObjectWriteTraceId', - 'id' => 'getId', 'properties' => 'getProperties' ]; @@ -262,9 +263,9 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('id', $data ?? [], null); $this->setIfExists('id_property', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); - $this->setIfExists('id', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); } @@ -316,6 +317,33 @@ public function valid() } + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique ID of the object. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** * Gets id_property * @@ -356,7 +384,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id An identifier for tracing the creation request. * * @return self */ @@ -370,33 +398,6 @@ public function setObjectWriteTraceId($object_write_trace_id) return $this; } - /** - * Gets id - * - * @return string - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param string $id id - * - * @return self - */ - public function setId($id) - { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); - } - $this->container['id'] = $id; - - return $this; - } - /** * Gets properties * @@ -410,7 +411,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key value pairs representing the properties of the object. * * @return self */ @@ -426,11 +427,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]); } @@ -438,12 +439,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; } @@ -468,11 +469,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/Objects/Communications/Model/SimplePublicObjectId.php b/codegen/Crm/Objects/Communications/Model/SimplePublicObjectId.php index 821c93bb..ad83163d 100644 --- a/codegen/Crm/Objects/Communications/Model/SimplePublicObjectId.php +++ b/codegen/Crm/Objects/Communications/Model/SimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectId Class Doc Comment * * @category Class + * @description Contains the Id of a Public Object * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -305,7 +306,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -321,11 +322,11 @@ public function setId($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]); } @@ -333,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; } @@ -363,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/Objects/Communications/Model/SimplePublicObjectInput.php b/codegen/Crm/Objects/Communications/Model/SimplePublicObjectInput.php index 532bd989..c1609c2e 100644 --- a/codegen/Crm/Objects/Communications/Model/SimplePublicObjectInput.php +++ b/codegen/Crm/Objects/Communications/Model/SimplePublicObjectInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectInput Class Doc Comment * * @category Class + * @description Represents the input required to create or update a CRM object, containing an object with property names and their corresponding values. * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -305,7 +306,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key value pairs representing the properties of the object. * * @return self */ @@ -321,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]); } @@ -333,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; } @@ -363,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/Objects/Communications/Model/SimplePublicObjectInputForCreate.php b/codegen/Crm/Objects/Communications/Model/SimplePublicObjectInputForCreate.php index af99350e..46da61b8 100644 --- a/codegen/Crm/Objects/Communications/Model/SimplePublicObjectInputForCreate.php +++ b/codegen/Crm/Objects/Communications/Model/SimplePublicObjectInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectInputForCreate Class Doc Comment * * @category Class + * @description Is the input object used to create a new CRM object, containing the properties to be set and optional associations to link the new record with other CRM objects. * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -339,7 +340,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key-value pairs for setting properties for the new object. * * @return self */ @@ -355,11 +356,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]); } @@ -367,12 +368,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; } @@ -397,11 +398,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/Objects/Communications/Model/SimplePublicObjectWithAssociations.php b/codegen/Crm/Objects/Communications/Model/SimplePublicObjectWithAssociations.php index 72ae8088..a2bfc9b4 100644 --- a/codegen/Crm/Objects/Communications/Model/SimplePublicObjectWithAssociations.php +++ b/codegen/Crm/Objects/Communications/Model/SimplePublicObjectWithAssociations.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectWithAssociations * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectWithAssociations Class Doc Comment * * @category Class + * @description Represents a CRM object along with its properties, timestamps, and a set of associated object IDs grouped by association type. * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,14 +58,14 @@ class SimplePublicObjectWithAssociations implements ModelInterface, ArrayAccess, * @var string[] */ protected static $openAPITypes = [ - 'associations' => 'array', - 'created_at' => '\DateTime', 'archived' => 'bool', 'archived_at' => '\DateTime', - 'properties_with_history' => 'array', + 'associations' => 'array', + 'created_at' => '\DateTime', 'id' => 'string', 'object_write_trace_id' => 'string', 'properties' => 'array', + 'properties_with_history' => 'array', 'updated_at' => '\DateTime' ]; @@ -76,14 +77,14 @@ class SimplePublicObjectWithAssociations implements ModelInterface, ArrayAccess, * @psalm-var array */ protected static $openAPIFormats = [ - 'associations' => null, - 'created_at' => 'date-time', 'archived' => null, 'archived_at' => 'date-time', - 'properties_with_history' => null, + 'associations' => null, + 'created_at' => 'date-time', 'id' => null, 'object_write_trace_id' => null, 'properties' => null, + 'properties_with_history' => null, 'updated_at' => 'date-time' ]; @@ -93,14 +94,14 @@ class SimplePublicObjectWithAssociations implements ModelInterface, ArrayAccess, * @var boolean[] */ protected static array $openAPINullables = [ - 'associations' => false, - 'created_at' => false, 'archived' => false, 'archived_at' => false, - 'properties_with_history' => false, + 'associations' => false, + 'created_at' => false, 'id' => false, 'object_write_trace_id' => false, 'properties' => false, + 'properties_with_history' => false, 'updated_at' => false ]; @@ -190,14 +191,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'associations' => 'associations', - 'created_at' => 'createdAt', 'archived' => 'archived', 'archived_at' => 'archivedAt', - 'properties_with_history' => 'propertiesWithHistory', + 'associations' => 'associations', + 'created_at' => 'createdAt', 'id' => 'id', 'object_write_trace_id' => 'objectWriteTraceId', 'properties' => 'properties', + 'properties_with_history' => 'propertiesWithHistory', 'updated_at' => 'updatedAt' ]; @@ -207,14 +208,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'associations' => 'setAssociations', - 'created_at' => 'setCreatedAt', 'archived' => 'setArchived', 'archived_at' => 'setArchivedAt', - 'properties_with_history' => 'setPropertiesWithHistory', + 'associations' => 'setAssociations', + 'created_at' => 'setCreatedAt', 'id' => 'setId', 'object_write_trace_id' => 'setObjectWriteTraceId', 'properties' => 'setProperties', + 'properties_with_history' => 'setPropertiesWithHistory', 'updated_at' => 'setUpdatedAt' ]; @@ -224,14 +225,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'associations' => 'getAssociations', - 'created_at' => 'getCreatedAt', 'archived' => 'getArchived', 'archived_at' => 'getArchivedAt', - 'properties_with_history' => 'getPropertiesWithHistory', + 'associations' => 'getAssociations', + 'created_at' => 'getCreatedAt', 'id' => 'getId', 'object_write_trace_id' => 'getObjectWriteTraceId', 'properties' => 'getProperties', + 'properties_with_history' => 'getPropertiesWithHistory', 'updated_at' => 'getUpdatedAt' ]; @@ -292,14 +293,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('associations', $data ?? [], null); - $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('archived', $data ?? [], null); $this->setIfExists('archived_at', $data ?? [], null); - $this->setIfExists('properties_with_history', $data ?? [], null); + $this->setIfExists('associations', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('properties_with_history', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); } @@ -330,6 +331,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['archived'] === null) { + $invalidProperties[] = "'archived' can't be null"; + } if ($this->container['created_at'] === null) { $invalidProperties[] = "'created_at' can't be null"; } @@ -357,64 +361,10 @@ public function valid() } - /** - * Gets associations - * - * @return array|null - */ - public function getAssociations() - { - return $this->container['associations']; - } - - /** - * Sets associations - * - * @param array|null $associations associations - * - * @return self - */ - public function setAssociations($associations) - { - if (is_null($associations)) { - throw new \InvalidArgumentException('non-nullable associations cannot be null'); - } - $this->container['associations'] = $associations; - - return $this; - } - - /** - * Gets created_at - * - * @return \DateTime - */ - public function getCreatedAt() - { - return $this->container['created_at']; - } - - /** - * Sets created_at - * - * @param \DateTime $created_at created_at - * - * @return self - */ - public function setCreatedAt($created_at) - { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); - } - $this->container['created_at'] = $created_at; - - return $this; - } - /** * Gets archived * - * @return bool|null + * @return bool */ public function getArchived() { @@ -424,7 +374,7 @@ public function getArchived() /** * Sets archived * - * @param bool|null $archived archived + * @param bool $archived Whether the object is archived. * * @return self */ @@ -451,7 +401,7 @@ public function getArchivedAt() /** * Sets archived_at * - * @param \DateTime|null $archived_at archived_at + * @param \DateTime|null $archived_at The timestamp when the object was archived, in ISO 8601 format. * * @return self */ @@ -466,28 +416,55 @@ public function setArchivedAt($archived_at) } /** - * Gets properties_with_history + * Gets associations * - * @return array|null + * @return array|null */ - public function getPropertiesWithHistory() + public function getAssociations() { - return $this->container['properties_with_history']; + return $this->container['associations']; } /** - * Sets properties_with_history + * Sets associations * - * @param array|null $properties_with_history properties_with_history + * @param array|null $associations A list defining relationships with other objects. * * @return self */ - public function setPropertiesWithHistory($properties_with_history) + public function setAssociations($associations) { - if (is_null($properties_with_history)) { - throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + if (is_null($associations)) { + throw new \InvalidArgumentException('non-nullable associations cannot be null'); } - $this->container['properties_with_history'] = $properties_with_history; + $this->container['associations'] = $associations; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime $created_at The timestamp when the object was created, in ISO 8601 format. + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; return $this; } @@ -505,7 +482,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -532,7 +509,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id An identifier used for tracing the creation or update request of the object. * * @return self */ @@ -559,7 +536,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key value pairs representing the properties of the object. * * @return self */ @@ -573,6 +550,33 @@ public function setProperties($properties) return $this; } + /** + * Gets properties_with_history + * + * @return array|null + */ + public function getPropertiesWithHistory() + { + return $this->container['properties_with_history']; + } + + /** + * Sets properties_with_history + * + * @param array|null $properties_with_history Key-value pairs representing the properties of the object along with their history. + * + * @return self + */ + public function setPropertiesWithHistory($properties_with_history) + { + if (is_null($properties_with_history)) { + throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + } + $this->container['properties_with_history'] = $properties_with_history; + + return $this; + } + /** * Gets updated_at * @@ -586,7 +590,7 @@ public function getUpdatedAt() /** * Sets updated_at * - * @param \DateTime $updated_at updated_at + * @param \DateTime $updated_at The timestamp when the object was last updated, in ISO 8601 format. * * @return self */ @@ -602,11 +606,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]); } @@ -614,12 +618,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; } @@ -644,11 +648,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/Objects/Communications/Model/SimplePublicUpsertObject.php b/codegen/Crm/Objects/Communications/Model/SimplePublicUpsertObject.php index 87294476..52d21959 100644 --- a/codegen/Crm/Objects/Communications/Model/SimplePublicUpsertObject.php +++ b/codegen/Crm/Objects/Communications/Model/SimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * SimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicUpsertObject Class Doc Comment * * @category Class + * @description Represents a CRM object that has either been created or updated (upserted) * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,14 +58,14 @@ class SimplePublicUpsertObject implements ModelInterface, ArrayAccess, \JsonSeri * @var string[] */ protected static $openAPITypes = [ - 'created_at' => '\DateTime', 'archived' => 'bool', 'archived_at' => '\DateTime', - 'new' => 'bool', - 'properties_with_history' => 'array', + 'created_at' => '\DateTime', 'id' => 'string', + 'new' => 'bool', 'object_write_trace_id' => 'string', 'properties' => 'array', + 'properties_with_history' => 'array', 'updated_at' => '\DateTime' ]; @@ -76,14 +77,14 @@ class SimplePublicUpsertObject implements ModelInterface, ArrayAccess, \JsonSeri * @psalm-var array */ protected static $openAPIFormats = [ - 'created_at' => 'date-time', 'archived' => null, 'archived_at' => 'date-time', - 'new' => null, - 'properties_with_history' => null, + 'created_at' => 'date-time', 'id' => null, + 'new' => null, 'object_write_trace_id' => null, 'properties' => null, + 'properties_with_history' => null, 'updated_at' => 'date-time' ]; @@ -93,14 +94,14 @@ class SimplePublicUpsertObject implements ModelInterface, ArrayAccess, \JsonSeri * @var boolean[] */ protected static array $openAPINullables = [ - 'created_at' => false, 'archived' => false, 'archived_at' => false, - 'new' => false, - 'properties_with_history' => false, + 'created_at' => false, 'id' => false, + 'new' => false, 'object_write_trace_id' => false, 'properties' => false, + 'properties_with_history' => false, 'updated_at' => false ]; @@ -190,14 +191,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'created_at' => 'createdAt', 'archived' => 'archived', 'archived_at' => 'archivedAt', - 'new' => 'new', - 'properties_with_history' => 'propertiesWithHistory', + 'created_at' => 'createdAt', 'id' => 'id', + 'new' => 'new', 'object_write_trace_id' => 'objectWriteTraceId', 'properties' => 'properties', + 'properties_with_history' => 'propertiesWithHistory', 'updated_at' => 'updatedAt' ]; @@ -207,14 +208,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'created_at' => 'setCreatedAt', 'archived' => 'setArchived', 'archived_at' => 'setArchivedAt', - 'new' => 'setNew', - 'properties_with_history' => 'setPropertiesWithHistory', + 'created_at' => 'setCreatedAt', 'id' => 'setId', + 'new' => 'setNew', 'object_write_trace_id' => 'setObjectWriteTraceId', 'properties' => 'setProperties', + 'properties_with_history' => 'setPropertiesWithHistory', 'updated_at' => 'setUpdatedAt' ]; @@ -224,14 +225,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'created_at' => 'getCreatedAt', 'archived' => 'getArchived', 'archived_at' => 'getArchivedAt', - 'new' => 'getNew', - 'properties_with_history' => 'getPropertiesWithHistory', + 'created_at' => 'getCreatedAt', 'id' => 'getId', + 'new' => 'getNew', 'object_write_trace_id' => 'getObjectWriteTraceId', 'properties' => 'getProperties', + 'properties_with_history' => 'getPropertiesWithHistory', 'updated_at' => 'getUpdatedAt' ]; @@ -292,14 +293,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('archived', $data ?? [], null); $this->setIfExists('archived_at', $data ?? [], null); - $this->setIfExists('new', $data ?? [], null); - $this->setIfExists('properties_with_history', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('new', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('properties_with_history', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); } @@ -330,15 +331,18 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['archived'] === null) { + $invalidProperties[] = "'archived' can't be null"; + } if ($this->container['created_at'] === null) { $invalidProperties[] = "'created_at' can't be null"; } - if ($this->container['new'] === null) { - $invalidProperties[] = "'new' can't be null"; - } if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } + if ($this->container['new'] === null) { + $invalidProperties[] = "'new' can't be null"; + } if ($this->container['properties'] === null) { $invalidProperties[] = "'properties' can't be null"; } @@ -360,37 +364,10 @@ public function valid() } - /** - * Gets created_at - * - * @return \DateTime - */ - public function getCreatedAt() - { - return $this->container['created_at']; - } - - /** - * Sets created_at - * - * @param \DateTime $created_at created_at - * - * @return self - */ - public function setCreatedAt($created_at) - { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); - } - $this->container['created_at'] = $created_at; - - return $this; - } - /** * Gets archived * - * @return bool|null + * @return bool */ public function getArchived() { @@ -400,7 +377,7 @@ public function getArchived() /** * Sets archived * - * @param bool|null $archived archived + * @param bool $archived Whether the object is archived. * * @return self */ @@ -427,7 +404,7 @@ public function getArchivedAt() /** * Sets archived_at * - * @param \DateTime|null $archived_at archived_at + * @param \DateTime|null $archived_at The timestamp when the object was archived, in ISO 8601 format. * * @return self */ @@ -442,82 +419,82 @@ public function setArchivedAt($archived_at) } /** - * Gets new + * Gets created_at * - * @return bool + * @return \DateTime */ - public function getNew() + public function getCreatedAt() { - return $this->container['new']; + return $this->container['created_at']; } /** - * Sets new + * Sets created_at * - * @param bool $new new + * @param \DateTime $created_at The timestamp when the object was created, in ISO 8601 format. * * @return self */ - public function setNew($new) + public function setCreatedAt($created_at) { - if (is_null($new)) { - throw new \InvalidArgumentException('non-nullable new cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['new'] = $new; + $this->container['created_at'] = $created_at; return $this; } /** - * Gets properties_with_history + * Gets id * - * @return array|null + * @return string */ - public function getPropertiesWithHistory() + public function getId() { - return $this->container['properties_with_history']; + return $this->container['id']; } /** - * Sets properties_with_history + * Sets id * - * @param array|null $properties_with_history properties_with_history + * @param string $id The unique ID of the object. * * @return self */ - public function setPropertiesWithHistory($properties_with_history) + public function setId($id) { - if (is_null($properties_with_history)) { - throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['properties_with_history'] = $properties_with_history; + $this->container['id'] = $id; return $this; } /** - * Gets id + * Gets new * - * @return string + * @return bool */ - public function getId() + public function getNew() { - return $this->container['id']; + return $this->container['new']; } /** - * Sets id + * Sets new * - * @param string $id id + * @param bool $new Whether the property is new. * * @return self */ - public function setId($id) + public function setNew($new) { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + if (is_null($new)) { + throw new \InvalidArgumentException('non-nullable new cannot be null'); } - $this->container['id'] = $id; + $this->container['new'] = $new; return $this; } @@ -535,7 +512,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id An identifier used for tracing the write request for the object. * * @return self */ @@ -562,7 +539,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key value pairs representing the properties of the object. * * @return self */ @@ -576,6 +553,33 @@ public function setProperties($properties) return $this; } + /** + * Gets properties_with_history + * + * @return array|null + */ + public function getPropertiesWithHistory() + { + return $this->container['properties_with_history']; + } + + /** + * Sets properties_with_history + * + * @param array|null $properties_with_history Key-value pairs representing the properties of the object along with their history. + * + * @return self + */ + public function setPropertiesWithHistory($properties_with_history) + { + if (is_null($properties_with_history)) { + throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + } + $this->container['properties_with_history'] = $properties_with_history; + + return $this; + } + /** * Gets updated_at * @@ -589,7 +593,7 @@ public function getUpdatedAt() /** * Sets updated_at * - * @param \DateTime $updated_at updated_at + * @param \DateTime $updated_at The timestamp when the object was last updated, in ISO 8601 format. * * @return self */ @@ -605,11 +609,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]); } @@ -617,12 +621,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; } @@ -647,11 +651,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/Objects/Communications/Model/StandardError.php b/codegen/Crm/Objects/Communications/Model/StandardError.php index 9877c0ee..71edcad4 100644 --- a/codegen/Crm/Objects/Communications/Model/StandardError.php +++ b/codegen/Crm/Objects/Communications/Model/StandardError.php @@ -2,7 +2,7 @@ /** * StandardError * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * StandardError Class Doc Comment * * @category Class + * @description Ye olde error * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,14 +58,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'object', + 'category' => 'string', 'context' => 'array', - 'links' => 'array', + 'errors' => '\HubSpot\Client\Crm\Objects\Communications\Model\ErrorDetail[]', 'id' => 'string', - 'category' => 'string', + 'links' => 'array', 'message' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\Communications\Model\ErrorDetail[]', - 'status' => 'string' + 'status' => 'string', + 'sub_category' => 'object' ]; /** @@ -75,14 +76,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, + 'category' => null, 'context' => null, - 'links' => null, + 'errors' => null, 'id' => null, - 'category' => null, + 'links' => null, 'message' => null, - 'errors' => null, - 'status' => null + 'status' => null, + 'sub_category' => null ]; /** @@ -91,14 +92,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, + 'category' => false, 'context' => false, - 'links' => false, + 'errors' => false, 'id' => false, - 'category' => false, + 'links' => false, 'message' => false, - 'errors' => false, - 'status' => false + 'status' => false, + 'sub_category' => false ]; /** @@ -187,14 +188,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', + 'category' => 'category', 'context' => 'context', - 'links' => 'links', + 'errors' => 'errors', 'id' => 'id', - 'category' => 'category', + 'links' => 'links', 'message' => 'message', - 'errors' => 'errors', - 'status' => 'status' + 'status' => 'status', + 'sub_category' => 'subCategory' ]; /** @@ -203,14 +204,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', + 'category' => 'setCategory', 'context' => 'setContext', - 'links' => 'setLinks', + 'errors' => 'setErrors', 'id' => 'setId', - 'category' => 'setCategory', + 'links' => 'setLinks', 'message' => 'setMessage', - 'errors' => 'setErrors', - 'status' => 'setStatus' + 'status' => 'setStatus', + 'sub_category' => 'setSubCategory' ]; /** @@ -219,14 +220,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', + 'category' => 'getCategory', 'context' => 'getContext', - 'links' => 'getLinks', + 'errors' => 'getErrors', 'id' => 'getId', - 'category' => 'getCategory', + 'links' => 'getLinks', 'message' => 'getMessage', - 'errors' => 'getErrors', - 'status' => 'getStatus' + 'status' => 'getStatus', + 'sub_category' => 'getSubCategory' ]; /** @@ -286,14 +287,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('links', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -323,21 +324,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['category'] === null) { + $invalidProperties[] = "'category' can't be null"; + } if ($this->container['context'] === null) { $invalidProperties[] = "'context' can't be null"; } + if ($this->container['errors'] === null) { + $invalidProperties[] = "'errors' can't be null"; + } if ($this->container['links'] === null) { $invalidProperties[] = "'links' can't be null"; } - if ($this->container['category'] === null) { - $invalidProperties[] = "'category' can't be null"; - } if ($this->container['message'] === null) { $invalidProperties[] = "'message' can't be null"; } - if ($this->container['errors'] === null) { - $invalidProperties[] = "'errors' can't be null"; - } if ($this->container['status'] === null) { $invalidProperties[] = "'status' can't be null"; } @@ -357,28 +358,28 @@ public function valid() /** - * Gets sub_category + * Gets category * - * @return object|null + * @return string */ - public function getSubCategory() + public function getCategory() { - return $this->container['sub_category']; + return $this->container['category']; } /** - * Sets sub_category + * Sets category * - * @param object|null $sub_category sub_category + * @param string $category The main category of the error. * * @return self */ - public function setSubCategory($sub_category) + public function setCategory($category) { - if (is_null($sub_category)) { - throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['sub_category'] = $sub_category; + $this->container['category'] = $category; return $this; } @@ -396,7 +397,7 @@ public function getContext() /** * Sets context * - * @param array $context context + * @param array $context Additional context-specific information related to the error. * * @return self */ @@ -411,28 +412,28 @@ public function setContext($context) } /** - * Gets links + * Gets errors * - * @return array + * @return \HubSpot\Client\Crm\Objects\Communications\Model\ErrorDetail[] */ - public function getLinks() + public function getErrors() { - return $this->container['links']; + return $this->container['errors']; } /** - * Sets links + * Sets errors * - * @param array $links links + * @param \HubSpot\Client\Crm\Objects\Communications\Model\ErrorDetail[] $errors The detailed error objects. * * @return self */ - public function setLinks($links) + public function setErrors($errors) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['links'] = $links; + $this->container['errors'] = $errors; return $this; } @@ -450,7 +451,7 @@ public function getId() /** * Sets id * - * @param string|null $id id + * @param string|null $id A unique ID for the error instance. * * @return self */ @@ -465,28 +466,28 @@ public function setId($id) } /** - * Gets category + * Gets links * - * @return string + * @return array */ - public function getCategory() + public function getLinks() { - return $this->container['category']; + return $this->container['links']; } /** - * Sets category + * Sets links * - * @param string $category category + * @param array $links URLs linking to documentation or resources associated with the error. * * @return self */ - public function setCategory($category) + public function setLinks($links) { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['category'] = $category; + $this->container['links'] = $links; return $this; } @@ -504,7 +505,7 @@ public function getMessage() /** * Sets message * - * @param string $message message + * @param string $message A human-readable string describing the error and possible remediation steps. * * @return self */ @@ -519,66 +520,66 @@ public function setMessage($message) } /** - * Gets errors + * Gets status * - * @return \HubSpot\Client\Crm\Objects\Communications\Model\ErrorDetail[] + * @return string */ - public function getErrors() + public function getStatus() { - return $this->container['errors']; + return $this->container['status']; } /** - * Sets errors + * Sets status * - * @param \HubSpot\Client\Crm\Objects\Communications\Model\ErrorDetail[] $errors errors + * @param string $status The HTTP status code associated with the error. * * @return self */ - public function setErrors($errors) + public function setStatus($status) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); } - $this->container['errors'] = $errors; + $this->container['status'] = $status; return $this; } /** - * Gets status + * Gets sub_category * - * @return string + * @return object|null */ - public function getStatus() + public function getSubCategory() { - return $this->container['status']; + return $this->container['sub_category']; } /** - * Sets status + * Sets sub_category * - * @param string $status status + * @param object|null $sub_category A more specific error category within each main category. * * @return self */ - public function setStatus($status) + public function setSubCategory($sub_category) { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['status'] = $status; + $this->container['sub_category'] = $sub_category; return $this; } /** * 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 +587,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 +617,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/Objects/Communications/Model/ValueWithTimestamp.php b/codegen/Crm/Objects/Communications/Model/ValueWithTimestamp.php index 1989ab4a..1db746ac 100644 --- a/codegen/Crm/Objects/Communications/Model/ValueWithTimestamp.php +++ b/codegen/Crm/Objects/Communications/Model/ValueWithTimestamp.php @@ -2,7 +2,7 @@ /** * ValueWithTimestamp * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * ValueWithTimestamp Class Doc Comment * * @category Class + * @description Property model that includes timestamp. * @package HubSpot\Client\Crm\Objects\Communications * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,11 +59,11 @@ class ValueWithTimestamp implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPITypes = [ 'source_id' => 'string', - 'source_type' => 'string', 'source_label' => 'string', + 'source_type' => 'string', + 'timestamp' => '\DateTime', 'updated_by_user_id' => 'int', - 'value' => 'string', - 'timestamp' => '\DateTime' + 'value' => 'string' ]; /** @@ -74,11 +75,11 @@ class ValueWithTimestamp implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPIFormats = [ 'source_id' => null, - 'source_type' => null, 'source_label' => null, + 'source_type' => null, + 'timestamp' => 'date-time', 'updated_by_user_id' => 'int32', - 'value' => null, - 'timestamp' => 'date-time' + 'value' => null ]; /** @@ -88,11 +89,11 @@ class ValueWithTimestamp implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static array $openAPINullables = [ 'source_id' => false, - 'source_type' => false, 'source_label' => false, + 'source_type' => false, + 'timestamp' => false, 'updated_by_user_id' => false, - 'value' => false, - 'timestamp' => false + 'value' => false ]; /** @@ -182,11 +183,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'source_id' => 'sourceId', - 'source_type' => 'sourceType', 'source_label' => 'sourceLabel', + 'source_type' => 'sourceType', + 'timestamp' => 'timestamp', 'updated_by_user_id' => 'updatedByUserId', - 'value' => 'value', - 'timestamp' => 'timestamp' + 'value' => 'value' ]; /** @@ -196,11 +197,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'source_id' => 'setSourceId', - 'source_type' => 'setSourceType', 'source_label' => 'setSourceLabel', + 'source_type' => 'setSourceType', + 'timestamp' => 'setTimestamp', 'updated_by_user_id' => 'setUpdatedByUserId', - 'value' => 'setValue', - 'timestamp' => 'setTimestamp' + 'value' => 'setValue' ]; /** @@ -210,11 +211,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'source_id' => 'getSourceId', - 'source_type' => 'getSourceType', 'source_label' => 'getSourceLabel', + 'source_type' => 'getSourceType', + 'timestamp' => 'getTimestamp', 'updated_by_user_id' => 'getUpdatedByUserId', - 'value' => 'getValue', - 'timestamp' => 'getTimestamp' + 'value' => 'getValue' ]; /** @@ -275,11 +276,11 @@ public function getModelName() public function __construct(?array $data = null) { $this->setIfExists('source_id', $data ?? [], null); - $this->setIfExists('source_type', $data ?? [], null); $this->setIfExists('source_label', $data ?? [], null); + $this->setIfExists('source_type', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); $this->setIfExists('updated_by_user_id', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); - $this->setIfExists('timestamp', $data ?? [], null); } /** @@ -312,12 +313,12 @@ public function listInvalidProperties() if ($this->container['source_type'] === null) { $invalidProperties[] = "'source_type' can't be null"; } - if ($this->container['value'] === null) { - $invalidProperties[] = "'value' can't be null"; - } if ($this->container['timestamp'] === null) { $invalidProperties[] = "'timestamp' can't be null"; } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } return $invalidProperties; } @@ -346,7 +347,7 @@ public function getSourceId() /** * Sets source_id * - * @param string|null $source_id source_id + * @param string|null $source_id The unique ID of the property. * * @return self */ @@ -360,6 +361,33 @@ public function setSourceId($source_id) return $this; } + /** + * Gets source_label + * + * @return string|null + */ + public function getSourceLabel() + { + return $this->container['source_label']; + } + + /** + * Sets source_label + * + * @param string|null $source_label A human-readable label. + * + * @return self + */ + public function setSourceLabel($source_label) + { + if (is_null($source_label)) { + throw new \InvalidArgumentException('non-nullable source_label cannot be null'); + } + $this->container['source_label'] = $source_label; + + return $this; + } + /** * Gets source_type * @@ -373,7 +401,7 @@ public function getSourceType() /** * Sets source_type * - * @param string $source_type source_type + * @param string $source_type The property type. * * @return self */ @@ -388,28 +416,28 @@ public function setSourceType($source_type) } /** - * Gets source_label + * Gets timestamp * - * @return string|null + * @return \DateTime */ - public function getSourceLabel() + public function getTimestamp() { - return $this->container['source_label']; + return $this->container['timestamp']; } /** - * Sets source_label + * Sets timestamp * - * @param string|null $source_label source_label + * @param \DateTime $timestamp The timestamp when the property was updated, in ISO 8601 format. * * @return self */ - public function setSourceLabel($source_label) + public function setTimestamp($timestamp) { - if (is_null($source_label)) { - throw new \InvalidArgumentException('non-nullable source_label cannot be null'); + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); } - $this->container['source_label'] = $source_label; + $this->container['timestamp'] = $timestamp; return $this; } @@ -427,7 +455,7 @@ public function getUpdatedByUserId() /** * Sets updated_by_user_id * - * @param int|null $updated_by_user_id updated_by_user_id + * @param int|null $updated_by_user_id The ID of the user who last updated the property. * * @return self */ @@ -454,7 +482,7 @@ public function getValue() /** * Sets value * - * @param string $value value + * @param string $value The property value. * * @return self */ @@ -467,41 +495,14 @@ public function setValue($value) return $this; } - - /** - * Gets timestamp - * - * @return \DateTime - */ - public function getTimestamp() - { - return $this->container['timestamp']; - } - - /** - * Sets timestamp - * - * @param \DateTime $timestamp timestamp - * - * @return self - */ - public function setTimestamp($timestamp) - { - if (is_null($timestamp)) { - throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); - } - $this->container['timestamp'] = $timestamp; - - return $this; - } /** * 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]); } @@ -509,12 +510,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; } @@ -539,11 +540,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/Objects/Communications/ObjectSerializer.php b/codegen/Crm/Objects/Communications/ObjectSerializer.php index d920477d..53c9a31d 100644 --- a/codegen/Crm/Objects/Communications/ObjectSerializer.php +++ b/codegen/Crm/Objects/Communications/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Communications @@ -13,11 +13,11 @@ /** * Communications * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.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) : ''; } } From ecdd6a56c33fc6a0009798458c1d8b4057c1f149 Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Thu, 29 Jan 2026 16:16:47 +0300 Subject: [PATCH 2/4] Codegen: CRM Deal Splits --- codegen/Crm/Objects/DealSplits/Api/BatchApi.php | 2 +- codegen/Crm/Objects/DealSplits/ApiException.php | 2 +- codegen/Crm/Objects/DealSplits/Configuration.php | 2 +- codegen/Crm/Objects/DealSplits/FormDataProcessor.php | 2 +- codegen/Crm/Objects/DealSplits/HeaderSelector.php | 2 +- .../Crm/Objects/DealSplits/Model/BatchInputPublicObjectId.php | 2 +- .../Objects/DealSplits/Model/BatchResponseDealToDealSplits.php | 2 +- .../Model/BatchResponseDealToDealSplitsWithErrors.php | 2 +- codegen/Crm/Objects/DealSplits/Model/DealToDealSplits.php | 2 +- codegen/Crm/Objects/DealSplits/Model/Error.php | 2 +- codegen/Crm/Objects/DealSplits/Model/ErrorDetail.php | 2 +- codegen/Crm/Objects/DealSplits/Model/ModelInterface.php | 2 +- codegen/Crm/Objects/DealSplits/Model/PublicDealSplitInput.php | 2 +- .../DealSplits/Model/PublicDealSplitsBatchCreateRequest.php | 2 +- .../Objects/DealSplits/Model/PublicDealSplitsCreateRequest.php | 2 +- codegen/Crm/Objects/DealSplits/Model/PublicObjectId.php | 3 ++- codegen/Crm/Objects/DealSplits/Model/SimplePublicObject.php | 2 +- codegen/Crm/Objects/DealSplits/Model/StandardError.php | 2 +- codegen/Crm/Objects/DealSplits/Model/ValueWithTimestamp.php | 2 +- codegen/Crm/Objects/DealSplits/ObjectSerializer.php | 2 +- 20 files changed, 21 insertions(+), 20 deletions(-) diff --git a/codegen/Crm/Objects/DealSplits/Api/BatchApi.php b/codegen/Crm/Objects/DealSplits/Api/BatchApi.php index 3e369ed0..b20d24b2 100644 --- a/codegen/Crm/Objects/DealSplits/Api/BatchApi.php +++ b/codegen/Crm/Objects/DealSplits/Api/BatchApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/ApiException.php b/codegen/Crm/Objects/DealSplits/ApiException.php index fb9503bd..f0d4d4a1 100644 --- a/codegen/Crm/Objects/DealSplits/ApiException.php +++ b/codegen/Crm/Objects/DealSplits/ApiException.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/Configuration.php b/codegen/Crm/Objects/DealSplits/Configuration.php index 9cee0d34..f6fc46ba 100644 --- a/codegen/Crm/Objects/DealSplits/Configuration.php +++ b/codegen/Crm/Objects/DealSplits/Configuration.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/FormDataProcessor.php b/codegen/Crm/Objects/DealSplits/FormDataProcessor.php index 601ecbd2..137ff9b1 100644 --- a/codegen/Crm/Objects/DealSplits/FormDataProcessor.php +++ b/codegen/Crm/Objects/DealSplits/FormDataProcessor.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/HeaderSelector.php b/codegen/Crm/Objects/DealSplits/HeaderSelector.php index f2a70b48..c26fb599 100644 --- a/codegen/Crm/Objects/DealSplits/HeaderSelector.php +++ b/codegen/Crm/Objects/DealSplits/HeaderSelector.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/Model/BatchInputPublicObjectId.php b/codegen/Crm/Objects/DealSplits/Model/BatchInputPublicObjectId.php index a5236d11..99b2d88d 100644 --- a/codegen/Crm/Objects/DealSplits/Model/BatchInputPublicObjectId.php +++ b/codegen/Crm/Objects/DealSplits/Model/BatchInputPublicObjectId.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplits.php b/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplits.php index 12ed672d..44baba07 100644 --- a/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplits.php +++ b/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplits.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplitsWithErrors.php b/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplitsWithErrors.php index 47e77681..7ffce796 100644 --- a/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplitsWithErrors.php +++ b/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplitsWithErrors.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/Model/DealToDealSplits.php b/codegen/Crm/Objects/DealSplits/Model/DealToDealSplits.php index ae7c5b5f..0abbc7db 100644 --- a/codegen/Crm/Objects/DealSplits/Model/DealToDealSplits.php +++ b/codegen/Crm/Objects/DealSplits/Model/DealToDealSplits.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/Model/Error.php b/codegen/Crm/Objects/DealSplits/Model/Error.php index e0c065c3..5d98cc25 100644 --- a/codegen/Crm/Objects/DealSplits/Model/Error.php +++ b/codegen/Crm/Objects/DealSplits/Model/Error.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/Model/ErrorDetail.php b/codegen/Crm/Objects/DealSplits/Model/ErrorDetail.php index be708a65..d08abf23 100644 --- a/codegen/Crm/Objects/DealSplits/Model/ErrorDetail.php +++ b/codegen/Crm/Objects/DealSplits/Model/ErrorDetail.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/Model/ModelInterface.php b/codegen/Crm/Objects/DealSplits/Model/ModelInterface.php index 102d3961..13cc6878 100644 --- a/codegen/Crm/Objects/DealSplits/Model/ModelInterface.php +++ b/codegen/Crm/Objects/DealSplits/Model/ModelInterface.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitInput.php b/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitInput.php index a35df6db..dba841e5 100644 --- a/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitInput.php +++ b/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitInput.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsBatchCreateRequest.php b/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsBatchCreateRequest.php index 913b328b..e5f98324 100644 --- a/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsBatchCreateRequest.php +++ b/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsBatchCreateRequest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsCreateRequest.php b/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsCreateRequest.php index 14583f6c..e533e9d0 100644 --- a/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsCreateRequest.php +++ b/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsCreateRequest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/Model/PublicObjectId.php b/codegen/Crm/Objects/DealSplits/Model/PublicObjectId.php index 2a7f0bc6..e72cd3da 100644 --- a/codegen/Crm/Objects/DealSplits/Model/PublicObjectId.php +++ b/codegen/Crm/Objects/DealSplits/Model/PublicObjectId.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * PublicObjectId Class Doc Comment * * @category Class + * @description Contains the Id of a Public Object * @package HubSpot\Client\Crm\Objects\DealSplits * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/codegen/Crm/Objects/DealSplits/Model/SimplePublicObject.php b/codegen/Crm/Objects/DealSplits/Model/SimplePublicObject.php index f4cae445..decb4608 100644 --- a/codegen/Crm/Objects/DealSplits/Model/SimplePublicObject.php +++ b/codegen/Crm/Objects/DealSplits/Model/SimplePublicObject.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/Model/StandardError.php b/codegen/Crm/Objects/DealSplits/Model/StandardError.php index 01facd24..f2f32c7e 100644 --- a/codegen/Crm/Objects/DealSplits/Model/StandardError.php +++ b/codegen/Crm/Objects/DealSplits/Model/StandardError.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/Model/ValueWithTimestamp.php b/codegen/Crm/Objects/DealSplits/Model/ValueWithTimestamp.php index aac2ad52..cccbf4fc 100644 --- a/codegen/Crm/Objects/DealSplits/Model/ValueWithTimestamp.php +++ b/codegen/Crm/Objects/DealSplits/Model/ValueWithTimestamp.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/ObjectSerializer.php b/codegen/Crm/Objects/DealSplits/ObjectSerializer.php index e1bfbbb2..8994fe5e 100644 --- a/codegen/Crm/Objects/DealSplits/ObjectSerializer.php +++ b/codegen/Crm/Objects/DealSplits/ObjectSerializer.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.17.0 + * Generator version: 7.19.0 */ /** From f6bc7550990755a69436499ff31c846f907b124c Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Thu, 29 Jan 2026 16:29:20 +0300 Subject: [PATCH 3/4] Codegen: CRM Emails --- codegen/Crm/Objects/Emails/Api/BasicApi.php | 514 +++++-------- codegen/Crm/Objects/Emails/Api/BatchApi.php | 637 ++++------------ codegen/Crm/Objects/Emails/Api/SearchApi.php | 179 ++--- codegen/Crm/Objects/Emails/ApiException.php | 6 +- codegen/Crm/Objects/Emails/Configuration.php | 65 +- .../Crm/Objects/Emails/FormDataProcessor.php | 246 +++++++ codegen/Crm/Objects/Emails/HeaderSelector.php | 6 +- .../Crm/Objects/Emails/Model/AssociatedId.php | 23 +- .../Objects/Emails/Model/AssociationSpec.php | 27 +- ...BatchInputSimplePublicObjectBatchInput.php | 18 +- ...tSimplePublicObjectBatchInputForCreate.php | 18 +- ...nputSimplePublicObjectBatchInputUpsert.php | 18 +- .../Model/BatchInputSimplePublicObjectId.php | 18 +- .../BatchReadInputSimplePublicObjectId.php | 107 +-- .../Model/BatchResponseSimplePublicObject.php | 193 +++-- ...chResponseSimplePublicObjectWithErrors.php | 697 ------------------ .../BatchResponseSimplePublicUpsertObject.php | 193 +++-- ...onseSimplePublicUpsertObjectWithErrors.php | 697 ------------------ .../Model/CollectionResponseAssociatedId.php | 18 +- ...nseSimplePublicObjectWithAssociations.php} | 32 +- ...onResponseWithTotalSimplePublicObject.php} | 119 +-- codegen/Crm/Objects/Emails/Model/Error.php | 160 ++-- .../Crm/Objects/Emails/Model/ErrorDetail.php | 136 ++-- codegen/Crm/Objects/Emails/Model/Filter.php | 167 ++--- .../Crm/Objects/Emails/Model/FilterGroup.php | 18 +- .../Objects/Emails/Model/ForwardPaging.php | 409 ---------- .../Objects/Emails/Model/ModelInterface.php | 6 +- codegen/Crm/Objects/Emails/Model/NextPage.php | 85 +-- codegen/Crm/Objects/Emails/Model/Paging.php | 18 +- .../Crm/Objects/Emails/Model/PreviousPage.php | 23 +- .../Model/PublicAssociationsForObject.php | 90 +-- .../Objects/Emails/Model/PublicObjectId.php | 21 +- .../Model/PublicObjectSearchRequest.php | 191 ++--- .../Emails/Model/SimplePublicObject.php | 138 ++-- .../Model/SimplePublicObjectBatchInput.php | 91 +-- .../SimplePublicObjectBatchInputForCreate.php | 23 +- .../SimplePublicObjectBatchInputUpsert.php | 91 +-- .../Emails/Model/SimplePublicObjectId.php | 21 +- .../Emails/Model/SimplePublicObjectInput.php | 21 +- .../SimplePublicObjectInputForCreate.php | 21 +- .../SimplePublicObjectWithAssociations.php | 206 +++--- .../Emails/Model/SimplePublicUpsertObject.php | 196 ++--- .../Objects/Emails/Model/StandardError.php | 205 +++--- .../Emails/Model/ValueWithTimestamp.php | 147 ++-- .../Crm/Objects/Emails/ObjectSerializer.php | 26 +- 45 files changed, 2241 insertions(+), 4100 deletions(-) create mode 100644 codegen/Crm/Objects/Emails/FormDataProcessor.php delete mode 100644 codegen/Crm/Objects/Emails/Model/BatchResponseSimplePublicObjectWithErrors.php delete mode 100644 codegen/Crm/Objects/Emails/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php rename codegen/Crm/Objects/Emails/Model/{CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php => CollectionResponseSimplePublicObjectWithAssociations.php} (82%) rename codegen/Crm/Objects/Emails/Model/{CollectionResponseWithTotalSimplePublicObjectForwardPaging.php => CollectionResponseWithTotalSimplePublicObject.php} (79%) delete mode 100644 codegen/Crm/Objects/Emails/Model/ForwardPaging.php diff --git a/codegen/Crm/Objects/Emails/Api/BasicApi.php b/codegen/Crm/Objects/Emails/Api/BasicApi.php index 01836d65..d82dc90e 100644 --- a/codegen/Crm/Objects/Emails/Api/BasicApi.php +++ b/codegen/Crm/Objects/Emails/Api/BasicApi.php @@ -1,7 +1,7 @@ getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -201,8 +203,10 @@ public function archiveWithHttpInfo($email_id, string $contentType = self::conte $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -285,7 +289,10 @@ public function archiveRequest($email_id, string $contentType = self::contentTyp 'Missing the required parameter $email_id when calling archive' ); } - + if (!preg_match("/.+/", $email_id)) { + throw new \InvalidArgumentException("invalid value for \"email_id\" when calling BasicApi.archive, must conform to the pattern /.+/."); + } + $resourcePath = '/crm/v3/objects/emails/{emailId}'; $formParams = []; @@ -421,62 +428,22 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin switch($statusCode) { - case 201: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObject' !== '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\Objects\Emails\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\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\Objects\Emails\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Emails\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -490,44 +457,21 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin ); } - $returnType = '\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObject'; - 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\Objects\Emails\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -535,8 +479,10 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -778,61 +724,21 @@ public function getByIdWithHttpInfo($email_id, $properties = null, $properties_w switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObjectWithAssociations' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObjectWithAssociations' !== '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\Objects\Emails\Model\SimplePublicObjectWithAssociations', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\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\Objects\Emails\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Emails\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -846,34 +752,11 @@ public function getByIdWithHttpInfo($email_id, $properties = null, $properties_w ); } - $returnType = '\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObjectWithAssociations'; - 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\Objects\Emails\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -883,7 +766,7 @@ public function getByIdWithHttpInfo($email_id, $properties = null, $properties_w $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -891,8 +774,10 @@ public function getByIdWithHttpInfo($email_id, $properties = null, $properties_w $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1003,7 +888,10 @@ public function getByIdRequest($email_id, $properties = null, $properties_with_h 'Missing the required parameter $email_id when calling getById' ); } - + if (!preg_match("/.+/", $email_id)) { + throw new \InvalidArgumentException("invalid value for \"email_id\" when calling BasicApi.getById, must conform to the pattern /.+/."); + } + @@ -1139,14 +1027,14 @@ public function getByIdRequest($email_id, $properties = null, $properties_with_h * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of emails that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\Emails\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\Emails\Model\Error + * @return \HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\Emails\Model\Error */ public function getPage($limit = 10, $after = null, $properties = null, $properties_with_history = null, $associations = null, $archived = false, string $contentType = self::contentTypes['getPage'][0]) { @@ -1162,14 +1050,14 @@ public function getPage($limit = 10, $after = null, $properties = null, $propert * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of emails that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\Emails\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\Emails\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\Emails\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = null, $properties_with_history = null, $associations = null, $archived = false, string $contentType = self::contentTypes['getPage'][0]) { @@ -1200,61 +1088,21 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging' !== '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\Objects\Emails\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\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\Objects\Emails\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Emails\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1268,44 +1116,21 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu ); } - $returnType = '\HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; - 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\Objects\Emails\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', + '\HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseSimplePublicObjectWithAssociations', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1313,8 +1138,10 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1327,7 +1154,7 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of emails that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation @@ -1353,7 +1180,7 @@ function ($response) { * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of emails that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation @@ -1363,7 +1190,7 @@ function ($response) { */ public function getPageAsyncWithHttpInfo($limit = 10, $after = null, $properties = null, $properties_with_history = null, $associations = null, $archived = false, string $contentType = self::contentTypes['getPage'][0]) { - $returnType = '\HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseSimplePublicObjectWithAssociations'; $request = $this->getPageRequest($limit, $after, $properties, $properties_with_history, $associations, $archived, $contentType); return $this->client @@ -1408,7 +1235,7 @@ function ($exception) { * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of emails that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation @@ -1611,61 +1438,21 @@ public function updateWithHttpInfo($email_id, $simple_public_object_input, $id_p switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObject' !== '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\Objects\Emails\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\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\Objects\Emails\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Emails\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1679,34 +1466,11 @@ public function updateWithHttpInfo($email_id, $simple_public_object_input, $id_p ); } - $returnType = '\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObject'; - 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\Objects\Emails\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1716,7 +1480,7 @@ public function updateWithHttpInfo($email_id, $simple_public_object_input, $id_p $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1724,8 +1488,10 @@ public function updateWithHttpInfo($email_id, $simple_public_object_input, $id_p $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1827,7 +1593,10 @@ public function updateRequest($email_id, $simple_public_object_input, $id_proper 'Missing the required parameter $email_id when calling update' ); } - + if (!preg_match("/.+/", $email_id)) { + throw new \InvalidArgumentException("invalid value for \"email_id\" when calling BasicApi.update, must conform to the pattern /.+/."); + } + // verify the required parameter 'simple_public_object_input' is set if ($simple_public_object_input === null || (is_array($simple_public_object_input) && count($simple_public_object_input) === 0)) { throw new \InvalidArgumentException( @@ -1945,6 +1714,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/Objects/Emails/Api/BatchApi.php b/codegen/Crm/Objects/Emails/Api/BatchApi.php index 6704d23c..ff6fbbfe 100644 --- a/codegen/Crm/Objects/Emails/Api/BatchApi.php +++ b/codegen/Crm/Objects/Emails/Api/BatchApi.php @@ -1,7 +1,7 @@ getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -201,8 +203,10 @@ public function archiveWithHttpInfo($batch_input_simple_public_object_id, string $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -372,7 +376,7 @@ public function archiveRequest($batch_input_simple_public_object_id, string $con * * @throws \HubSpot\Client\Crm\Objects\Emails\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Emails\Model\Error + * @return \HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Emails\Model\Error */ public function create($batch_input_simple_public_object_batch_input_for_create, string $contentType = self::contentTypes['create'][0]) { @@ -390,7 +394,7 @@ public function create($batch_input_simple_public_object_batch_input_for_create, * * @throws \HubSpot\Client\Crm\Objects\Emails\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Emails\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Emails\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function createWithHttpInfo($batch_input_simple_public_object_batch_input_for_create, string $contentType = self::contentTypes['create'][0]) { @@ -420,89 +424,22 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input switch($statusCode) { - case 201: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject' !== '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\Objects\Emails\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObjectWithErrors' !== '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\Objects\Emails\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\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\Objects\Emails\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Emails\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -516,52 +453,21 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input ); } - $returnType = '\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject'; - 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\Objects\Emails\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObjectWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -569,8 +475,10 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -754,7 +662,7 @@ public function createRequest($batch_input_simple_public_object_batch_input_for_ * * @throws \HubSpot\Client\Crm\Objects\Emails\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Emails\Model\Error + * @return \HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Emails\Model\Error */ public function read($batch_read_input_simple_public_object_id, $archived = false, string $contentType = self::contentTypes['read'][0]) { @@ -773,7 +681,7 @@ public function read($batch_read_input_simple_public_object_id, $archived = fals * * @throws \HubSpot\Client\Crm\Objects\Emails\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Emails\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Emails\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $archived = false, string $contentType = self::contentTypes['read'][0]) { @@ -804,88 +712,21 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject' !== '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\Objects\Emails\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObjectWithErrors' !== '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\Objects\Emails\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\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\Objects\Emails\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Emails\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -899,34 +740,11 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc ); } - $returnType = '\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject'; - 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\Objects\Emails\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -936,15 +754,7 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObjectWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -952,8 +762,10 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1149,7 +961,7 @@ public function readRequest($batch_read_input_simple_public_object_id, $archived * * @throws \HubSpot\Client\Crm\Objects\Emails\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Emails\Model\Error + * @return \HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Emails\Model\Error */ public function update($batch_input_simple_public_object_batch_input, string $contentType = self::contentTypes['update'][0]) { @@ -1167,7 +979,7 @@ public function update($batch_input_simple_public_object_batch_input, string $co * * @throws \HubSpot\Client\Crm\Objects\Emails\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Emails\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Emails\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input, string $contentType = self::contentTypes['update'][0]) { @@ -1198,88 +1010,21 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject' !== '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\Objects\Emails\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObjectWithErrors' !== '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\Objects\Emails\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\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\Objects\Emails\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Emails\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1293,34 +1038,11 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input ); } - $returnType = '\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObject'; - 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\Objects\Emails\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1330,15 +1052,7 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicObjectWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1346,8 +1060,10 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1530,7 +1246,7 @@ public function updateRequest($batch_input_simple_public_object_batch_input, str * * @throws \HubSpot\Client\Crm\Objects\Emails\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\Emails\Model\Error + * @return \HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Emails\Model\Error */ public function upsert($batch_input_simple_public_object_batch_input_upsert, string $contentType = self::contentTypes['upsert'][0]) { @@ -1548,7 +1264,7 @@ public function upsert($batch_input_simple_public_object_batch_input_upsert, str * * @throws \HubSpot\Client\Crm\Objects\Emails\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\Emails\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Emails\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input_upsert, string $contentType = self::contentTypes['upsert'][0]) { @@ -1579,88 +1295,21 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicUpsertObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicUpsertObject' !== '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\Objects\Emails\Model\BatchResponseSimplePublicUpsertObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicUpsertObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicUpsertObjectWithErrors' !== '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\Objects\Emails\Model\BatchResponseSimplePublicUpsertObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicUpsertObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\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\Objects\Emails\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Emails\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1674,34 +1323,11 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input ); } - $returnType = '\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicUpsertObject'; - 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\Objects\Emails\Model\BatchResponseSimplePublicUpsertObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1711,15 +1337,7 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Emails\Model\BatchResponseSimplePublicUpsertObjectWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1727,8 +1345,10 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1917,6 +1537,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/Objects/Emails/Api/SearchApi.php b/codegen/Crm/Objects/Emails/Api/SearchApi.php index 6a02a044..6e98f043 100644 --- a/codegen/Crm/Objects/Emails/Api/SearchApi.php +++ b/codegen/Crm/Objects/Emails/Api/SearchApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging' !== '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\Objects\Emails\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Emails\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Emails\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\Objects\Emails\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Emails\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -245,44 +212,21 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont ); } - $returnType = '\HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging'; - 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\Objects\Emails\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', + '\HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseWithTotalSimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -290,8 +234,10 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -299,6 +245,8 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont /** * Operation doSearchAsync * + * Search for emails using specified criteria and filters. + * * @param \HubSpot\Client\Crm\Objects\Emails\Model\PublicObjectSearchRequest $public_object_search_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['doSearch'] to see the possible values for this operation * @@ -318,6 +266,8 @@ function ($response) { /** * Operation doSearchAsyncWithHttpInfo * + * Search for emails using specified criteria and filters. + * * @param \HubSpot\Client\Crm\Objects\Emails\Model\PublicObjectSearchRequest $public_object_search_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['doSearch'] to see the possible values for this operation * @@ -326,7 +276,7 @@ function ($response) { */ public function doSearchAsyncWithHttpInfo($public_object_search_request, string $contentType = self::contentTypes['doSearch'][0]) { - $returnType = '\HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\Emails\Model\CollectionResponseWithTotalSimplePublicObject'; $request = $this->doSearchRequest($public_object_search_request, $contentType); return $this->client @@ -476,6 +426,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/Objects/Emails/ApiException.php b/codegen/Crm/Objects/Emails/ApiException.php index 706732f3..77004174 100644 --- a/codegen/Crm/Objects/Emails/ApiException.php +++ b/codegen/Crm/Objects/Emails/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/Objects/Emails/FormDataProcessor.php b/codegen/Crm/Objects/Emails/FormDataProcessor.php new file mode 100644 index 00000000..2c3bb012 --- /dev/null +++ b/codegen/Crm/Objects/Emails/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/Objects/Emails/HeaderSelector.php b/codegen/Crm/Objects/Emails/HeaderSelector.php index bcedba9f..b7d2d942 100644 --- a/codegen/Crm/Objects/Emails/HeaderSelector.php +++ b/codegen/Crm/Objects/Emails/HeaderSelector.php @@ -1,7 +1,7 @@ container[$offset]); } @@ -370,12 +371,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 +401,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/Objects/Emails/Model/AssociationSpec.php b/codegen/Crm/Objects/Emails/Model/AssociationSpec.php index a53253fe..5067d43b 100644 --- a/codegen/Crm/Objects/Emails/Model/AssociationSpec.php +++ b/codegen/Crm/Objects/Emails/Model/AssociationSpec.php @@ -2,7 +2,7 @@ /** * AssociationSpec * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * AssociationSpec Class Doc Comment * * @category Class + * @description Defines the type, direction, and details of the relationship between two CRM objects. * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -235,8 +236,8 @@ public function getModelName() } public const ASSOCIATION_CATEGORY_HUBSPOT_DEFINED = 'HUBSPOT_DEFINED'; - public const ASSOCIATION_CATEGORY_USER_DEFINED = 'USER_DEFINED'; public const ASSOCIATION_CATEGORY_INTEGRATOR_DEFINED = 'INTEGRATOR_DEFINED'; + public const ASSOCIATION_CATEGORY_USER_DEFINED = 'USER_DEFINED'; /** * Gets allowable values of the enum @@ -247,8 +248,8 @@ public function getAssociationCategoryAllowableValues() { return [ self::ASSOCIATION_CATEGORY_HUBSPOT_DEFINED, - self::ASSOCIATION_CATEGORY_USER_DEFINED, self::ASSOCIATION_CATEGORY_INTEGRATOR_DEFINED, + self::ASSOCIATION_CATEGORY_USER_DEFINED, ]; } @@ -341,7 +342,7 @@ public function getAssociationCategory() /** * Sets association_category * - * @param string $association_category association_category + * @param string $association_category The category of the association, such as \"HUBSPOT_DEFINED\". * * @return self */ @@ -378,7 +379,7 @@ public function getAssociationTypeId() /** * Sets association_type_id * - * @param int $association_type_id association_type_id + * @param int $association_type_id The ID representing the specific type of association. * * @return self */ @@ -394,11 +395,11 @@ public function setAssociationTypeId($association_type_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]); } @@ -406,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; } @@ -436,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/Objects/Emails/Model/BatchInputSimplePublicObjectBatchInput.php b/codegen/Crm/Objects/Emails/Model/BatchInputSimplePublicObjectBatchInput.php index 25ad6eaa..1ea3321f 100644 --- a/codegen/Crm/Objects/Emails/Model/BatchInputSimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/Emails/Model/BatchInputSimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -321,11 +321,11 @@ public function setInputs($inputs) /** * 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/Objects/Emails/Model/BatchInputSimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/Emails/Model/BatchInputSimplePublicObjectBatchInputForCreate.php index 6e951268..5f47c247 100644 --- a/codegen/Crm/Objects/Emails/Model/BatchInputSimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/Emails/Model/BatchInputSimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -321,11 +321,11 @@ public function setInputs($inputs) /** * 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/Objects/Emails/Model/BatchInputSimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/Emails/Model/BatchInputSimplePublicObjectBatchInputUpsert.php index 207cb92a..ec37e22c 100644 --- a/codegen/Crm/Objects/Emails/Model/BatchInputSimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Objects/Emails/Model/BatchInputSimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -321,11 +321,11 @@ public function setInputs($inputs) /** * 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/Objects/Emails/Model/BatchInputSimplePublicObjectId.php b/codegen/Crm/Objects/Emails/Model/BatchInputSimplePublicObjectId.php index 6d853b12..c9ad6af9 100644 --- a/codegen/Crm/Objects/Emails/Model/BatchInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/Emails/Model/BatchInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -321,11 +321,11 @@ public function setInputs($inputs) /** * 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/Objects/Emails/Model/BatchReadInputSimplePublicObjectId.php b/codegen/Crm/Objects/Emails/Model/BatchReadInputSimplePublicObjectId.php index 25d6a5d6..f90d8e38 100644 --- a/codegen/Crm/Objects/Emails/Model/BatchReadInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/Emails/Model/BatchReadInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchReadInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * BatchReadInputSimplePublicObjectId Class Doc Comment * * @category Class + * @description Specifies the input for reading a batch of CRM objects, including arrays of object IDs, requested property names (with optional history), and an optional unique identifying property. * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,10 +58,10 @@ class BatchReadInputSimplePublicObjectId implements ModelInterface, ArrayAccess, * @var string[] */ protected static $openAPITypes = [ - 'properties_with_history' => 'string[]', 'id_property' => 'string', 'inputs' => '\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObjectId[]', - 'properties' => 'string[]' + 'properties' => 'string[]', + 'properties_with_history' => 'string[]' ]; /** @@ -71,10 +72,10 @@ class BatchReadInputSimplePublicObjectId implements ModelInterface, ArrayAccess, * @psalm-var array */ protected static $openAPIFormats = [ - 'properties_with_history' => null, 'id_property' => null, 'inputs' => null, - 'properties' => null + 'properties' => null, + 'properties_with_history' => null ]; /** @@ -83,10 +84,10 @@ class BatchReadInputSimplePublicObjectId implements ModelInterface, ArrayAccess, * @var boolean[] */ protected static array $openAPINullables = [ - 'properties_with_history' => false, 'id_property' => false, 'inputs' => false, - 'properties' => false + 'properties' => false, + 'properties_with_history' => false ]; /** @@ -175,10 +176,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'properties_with_history' => 'propertiesWithHistory', 'id_property' => 'idProperty', 'inputs' => 'inputs', - 'properties' => 'properties' + 'properties' => 'properties', + 'properties_with_history' => 'propertiesWithHistory' ]; /** @@ -187,10 +188,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'properties_with_history' => 'setPropertiesWithHistory', 'id_property' => 'setIdProperty', 'inputs' => 'setInputs', - 'properties' => 'setProperties' + 'properties' => 'setProperties', + 'properties_with_history' => 'setPropertiesWithHistory' ]; /** @@ -199,10 +200,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'properties_with_history' => 'getPropertiesWithHistory', 'id_property' => 'getIdProperty', 'inputs' => 'getInputs', - 'properties' => 'getProperties' + 'properties' => 'getProperties', + 'properties_with_history' => 'getPropertiesWithHistory' ]; /** @@ -262,10 +263,10 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('properties_with_history', $data ?? [], null); $this->setIfExists('id_property', $data ?? [], null); $this->setIfExists('inputs', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('properties_with_history', $data ?? [], null); } /** @@ -295,15 +296,15 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['properties_with_history'] === null) { - $invalidProperties[] = "'properties_with_history' can't be null"; - } if ($this->container['inputs'] === null) { $invalidProperties[] = "'inputs' can't be null"; } if ($this->container['properties'] === null) { $invalidProperties[] = "'properties' can't be null"; } + if ($this->container['properties_with_history'] === null) { + $invalidProperties[] = "'properties_with_history' can't be null"; + } return $invalidProperties; } @@ -319,33 +320,6 @@ public function valid() } - /** - * Gets properties_with_history - * - * @return string[] - */ - public function getPropertiesWithHistory() - { - return $this->container['properties_with_history']; - } - - /** - * Sets properties_with_history - * - * @param string[] $properties_with_history properties_with_history - * - * @return self - */ - public function setPropertiesWithHistory($properties_with_history) - { - if (is_null($properties_with_history)) { - throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); - } - $this->container['properties_with_history'] = $properties_with_history; - - return $this; - } - /** * Gets id_property * @@ -413,7 +387,7 @@ public function getProperties() /** * Sets properties * - * @param string[] $properties properties + * @param string[] $properties Key-value pairs for setting properties for the new object. * * @return self */ @@ -426,14 +400,41 @@ public function setProperties($properties) return $this; } + + /** + * Gets properties_with_history + * + * @return string[] + */ + public function getPropertiesWithHistory() + { + return $this->container['properties_with_history']; + } + + /** + * Sets properties_with_history + * + * @param string[] $properties_with_history Key-value pairs for setting properties for the new object and their histories. + * + * @return self + */ + public function setPropertiesWithHistory($properties_with_history) + { + if (is_null($properties_with_history)) { + throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + } + $this->container['properties_with_history'] = $properties_with_history; + + return $this; + } /** * 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]); } @@ -441,12 +442,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; } @@ -471,11 +472,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/Objects/Emails/Model/BatchResponseSimplePublicObject.php b/codegen/Crm/Objects/Emails/Model/BatchResponseSimplePublicObject.php index a164ec2a..58b60f8b 100644 --- a/codegen/Crm/Objects/Emails/Model/BatchResponseSimplePublicObject.php +++ b/codegen/Crm/Objects/Emails/Model/BatchResponseSimplePublicObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * BatchResponseSimplePublicObject Class Doc Comment * * @category Class + * @description A public object batch response object * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,10 +59,12 @@ class BatchResponseSimplePublicObject implements ModelInterface, ArrayAccess, \J */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', + 'errors' => '\HubSpot\Client\Crm\Objects\Emails\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObject[]', + 'started_at' => '\DateTime', 'status' => 'string' ]; @@ -74,10 +77,12 @@ class BatchResponseSimplePublicObject implements ModelInterface, ArrayAccess, \J */ protected static $openAPIFormats = [ 'completed_at' => 'date-time', - 'requested_at' => 'date-time', - 'started_at' => 'date-time', + 'errors' => null, 'links' => null, + 'num_errors' => 'int32', + 'requested_at' => 'date-time', 'results' => null, + 'started_at' => 'date-time', 'status' => null ]; @@ -88,10 +93,12 @@ class BatchResponseSimplePublicObject implements ModelInterface, ArrayAccess, \J */ protected static array $openAPINullables = [ 'completed_at' => false, - 'requested_at' => false, - 'started_at' => false, + 'errors' => false, 'links' => false, + 'num_errors' => false, + 'requested_at' => false, 'results' => false, + 'started_at' => false, 'status' => false ]; @@ -182,10 +189,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'completed_at' => 'completedAt', - 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', + 'errors' => 'errors', 'links' => 'links', + 'num_errors' => 'numErrors', + 'requested_at' => 'requestedAt', 'results' => 'results', + 'started_at' => 'startedAt', 'status' => 'status' ]; @@ -196,10 +205,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'completed_at' => 'setCompletedAt', - 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', + 'errors' => 'setErrors', 'links' => 'setLinks', + 'num_errors' => 'setNumErrors', + 'requested_at' => 'setRequestedAt', 'results' => 'setResults', + 'started_at' => 'setStartedAt', 'status' => 'setStatus' ]; @@ -210,10 +221,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'completed_at' => 'getCompletedAt', - 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', + 'errors' => 'getErrors', 'links' => 'getLinks', + 'num_errors' => 'getNumErrors', + 'requested_at' => 'getRequestedAt', 'results' => 'getResults', + 'started_at' => 'getStartedAt', 'status' => 'getStatus' ]; @@ -258,10 +271,10 @@ public function getModelName() return self::$openAPIModelName; } - public const STATUS_PENDING = 'PENDING'; - public const STATUS_PROCESSING = 'PROCESSING'; public const STATUS_CANCELED = 'CANCELED'; public const STATUS_COMPLETE = 'COMPLETE'; + public const STATUS_PENDING = 'PENDING'; + public const STATUS_PROCESSING = 'PROCESSING'; /** * Gets allowable values of the enum @@ -271,10 +284,10 @@ public function getModelName() public function getStatusAllowableValues() { return [ - self::STATUS_PENDING, - self::STATUS_PROCESSING, self::STATUS_CANCELED, self::STATUS_COMPLETE, + self::STATUS_PENDING, + self::STATUS_PROCESSING, ]; } @@ -294,10 +307,12 @@ public function getStatusAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('completed_at', $data ?? [], null); - $this->setIfExists('requested_at', $data ?? [], null); - $this->setIfExists('started_at', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('links', $data ?? [], null); + $this->setIfExists('num_errors', $data ?? [], null); + $this->setIfExists('requested_at', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('started_at', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); } @@ -331,12 +346,12 @@ public function listInvalidProperties() if ($this->container['completed_at'] === null) { $invalidProperties[] = "'completed_at' can't be null"; } - if ($this->container['started_at'] === null) { - $invalidProperties[] = "'started_at' can't be null"; - } if ($this->container['results'] === null) { $invalidProperties[] = "'results' can't be null"; } + if ($this->container['started_at'] === null) { + $invalidProperties[] = "'started_at' can't be null"; + } if ($this->container['status'] === null) { $invalidProperties[] = "'status' can't be null"; } @@ -377,7 +392,7 @@ public function getCompletedAt() /** * Sets completed_at * - * @param \DateTime $completed_at completed_at + * @param \DateTime $completed_at The timestamp when the batch processing was completed, in ISO 8601 format. * * @return self */ @@ -392,82 +407,109 @@ public function setCompletedAt($completed_at) } /** - * Gets requested_at + * Gets errors * - * @return \DateTime|null + * @return \HubSpot\Client\Crm\Objects\Emails\Model\StandardError[]|null */ - public function getRequestedAt() + public function getErrors() { - return $this->container['requested_at']; + return $this->container['errors']; } /** - * Sets requested_at + * Sets errors * - * @param \DateTime|null $requested_at requested_at + * @param \HubSpot\Client\Crm\Objects\Emails\Model\StandardError[]|null $errors errors * * @return self */ - public function setRequestedAt($requested_at) + public function setErrors($errors) { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['requested_at'] = $requested_at; + $this->container['errors'] = $errors; return $this; } /** - * Gets started_at + * Gets links * - * @return \DateTime + * @return array|null */ - public function getStartedAt() + public function getLinks() { - return $this->container['started_at']; + return $this->container['links']; } /** - * Sets started_at + * Sets links * - * @param \DateTime $started_at started_at + * @param array|null $links An object containing relevant links related to the batch request. * * @return self */ - public function setStartedAt($started_at) + public function setLinks($links) { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['started_at'] = $started_at; + $this->container['links'] = $links; return $this; } /** - * Gets links + * Gets num_errors * - * @return array|null + * @return int|null */ - public function getLinks() + public function getNumErrors() { - return $this->container['links']; + return $this->container['num_errors']; } /** - * Sets links + * Sets num_errors * - * @param array|null $links links + * @param int|null $num_errors The total number of errors that occurred during the batch operation. * * @return self */ - public function setLinks($links) + public function setNumErrors($num_errors) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($num_errors)) { + throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); } - $this->container['links'] = $links; + $this->container['num_errors'] = $num_errors; + + return $this; + } + + /** + * Gets requested_at + * + * @return \DateTime|null + */ + public function getRequestedAt() + { + return $this->container['requested_at']; + } + + /** + * Sets requested_at + * + * @param \DateTime|null $requested_at The timestamp when the batch request was initially made, in ISO 8601 format. + * + * @return self + */ + public function setRequestedAt($requested_at) + { + if (is_null($requested_at)) { + throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + } + $this->container['requested_at'] = $requested_at; return $this; } @@ -499,6 +541,33 @@ public function setResults($results) return $this; } + /** + * Gets started_at + * + * @return \DateTime + */ + public function getStartedAt() + { + return $this->container['started_at']; + } + + /** + * Sets started_at + * + * @param \DateTime $started_at The timestamp when the batch processing began, in ISO 8601 format. + * + * @return self + */ + public function setStartedAt($started_at) + { + if (is_null($started_at)) { + throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + } + $this->container['started_at'] = $started_at; + + return $this; + } + /** * Gets status * @@ -512,7 +581,7 @@ public function getStatus() /** * Sets status * - * @param string $status status + * @param string $status The status of the batch processing request: \"PENDING\", \"PROCESSING\", \"CANCELLED\", or \"COMPLETE\" * * @return self */ @@ -538,11 +607,11 @@ public function setStatus($status) /** * 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]); } @@ -550,12 +619,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; } @@ -580,11 +649,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/Objects/Emails/Model/BatchResponseSimplePublicObjectWithErrors.php b/codegen/Crm/Objects/Emails/Model/BatchResponseSimplePublicObjectWithErrors.php deleted file mode 100644 index 9af89f03..00000000 --- a/codegen/Crm/Objects/Emails/Model/BatchResponseSimplePublicObjectWithErrors.php +++ /dev/null @@ -1,697 +0,0 @@ - - */ -class BatchResponseSimplePublicObjectWithErrors implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'BatchResponseSimplePublicObjectWithErrors'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'completed_at' => '\DateTime', - 'num_errors' => 'int', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', - 'links' => 'array', - 'results' => '\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\Emails\Model\StandardError[]', - 'status' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'completed_at' => 'date-time', - 'num_errors' => 'int32', - 'requested_at' => 'date-time', - 'started_at' => 'date-time', - 'links' => null, - 'results' => null, - 'errors' => null, - 'status' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'completed_at' => false, - 'num_errors' => false, - 'requested_at' => false, - 'started_at' => false, - 'links' => false, - 'results' => false, - 'errors' => false, - 'status' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'completed_at' => 'completedAt', - 'num_errors' => 'numErrors', - 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', - 'links' => 'links', - 'results' => 'results', - 'errors' => 'errors', - 'status' => 'status' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'completed_at' => 'setCompletedAt', - 'num_errors' => 'setNumErrors', - 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', - 'links' => 'setLinks', - 'results' => 'setResults', - 'errors' => 'setErrors', - 'status' => 'setStatus' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'completed_at' => 'getCompletedAt', - 'num_errors' => 'getNumErrors', - 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', - 'links' => 'getLinks', - 'results' => 'getResults', - 'errors' => 'getErrors', - 'status' => 'getStatus' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - public const STATUS_PENDING = 'PENDING'; - public const STATUS_PROCESSING = 'PROCESSING'; - public const STATUS_CANCELED = 'CANCELED'; - public const STATUS_COMPLETE = 'COMPLETE'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStatusAllowableValues() - { - return [ - self::STATUS_PENDING, - self::STATUS_PROCESSING, - self::STATUS_CANCELED, - self::STATUS_COMPLETE, - ]; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('completed_at', $data ?? [], null); - $this->setIfExists('num_errors', $data ?? [], null); - $this->setIfExists('requested_at', $data ?? [], null); - $this->setIfExists('started_at', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); - $this->setIfExists('results', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['completed_at'] === null) { - $invalidProperties[] = "'completed_at' can't be null"; - } - if ($this->container['started_at'] === null) { - $invalidProperties[] = "'started_at' can't be null"; - } - if ($this->container['results'] === null) { - $invalidProperties[] = "'results' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'status', must be one of '%s'", - $this->container['status'], - implode("', '", $allowedValues) - ); - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets completed_at - * - * @return \DateTime - */ - public function getCompletedAt() - { - return $this->container['completed_at']; - } - - /** - * Sets completed_at - * - * @param \DateTime $completed_at completed_at - * - * @return self - */ - public function setCompletedAt($completed_at) - { - if (is_null($completed_at)) { - throw new \InvalidArgumentException('non-nullable completed_at cannot be null'); - } - $this->container['completed_at'] = $completed_at; - - return $this; - } - - /** - * Gets num_errors - * - * @return int|null - */ - public function getNumErrors() - { - return $this->container['num_errors']; - } - - /** - * Sets num_errors - * - * @param int|null $num_errors num_errors - * - * @return self - */ - public function setNumErrors($num_errors) - { - if (is_null($num_errors)) { - throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); - } - $this->container['num_errors'] = $num_errors; - - return $this; - } - - /** - * Gets requested_at - * - * @return \DateTime|null - */ - public function getRequestedAt() - { - return $this->container['requested_at']; - } - - /** - * Sets requested_at - * - * @param \DateTime|null $requested_at requested_at - * - * @return self - */ - public function setRequestedAt($requested_at) - { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); - } - $this->container['requested_at'] = $requested_at; - - return $this; - } - - /** - * Gets started_at - * - * @return \DateTime - */ - public function getStartedAt() - { - return $this->container['started_at']; - } - - /** - * Sets started_at - * - * @param \DateTime $started_at started_at - * - * @return self - */ - public function setStartedAt($started_at) - { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); - } - $this->container['started_at'] = $started_at; - - return $this; - } - - /** - * Gets links - * - * @return array|null - */ - public function getLinks() - { - return $this->container['links']; - } - - /** - * Sets links - * - * @param array|null $links links - * - * @return self - */ - public function setLinks($links) - { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); - } - $this->container['links'] = $links; - - return $this; - } - - /** - * Gets results - * - * @return \HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObject[] $results results - * - * @return self - */ - public function setResults($results) - { - if (is_null($results)) { - throw new \InvalidArgumentException('non-nullable results cannot be null'); - } - $this->container['results'] = $results; - - return $this; - } - - /** - * Gets errors - * - * @return \HubSpot\Client\Crm\Objects\Emails\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\Emails\Model\StandardError[]|null $errors errors - * - * @return self - */ - public function setErrors($errors) - { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); - } - $this->container['errors'] = $errors; - - return $this; - } - - /** - * Gets status - * - * @return string - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", - $status, - implode("', '", $allowedValues) - ) - ); - } - $this->container['status'] = $status; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/codegen/Crm/Objects/Emails/Model/BatchResponseSimplePublicUpsertObject.php b/codegen/Crm/Objects/Emails/Model/BatchResponseSimplePublicUpsertObject.php index ab4b8a38..19f477d1 100644 --- a/codegen/Crm/Objects/Emails/Model/BatchResponseSimplePublicUpsertObject.php +++ b/codegen/Crm/Objects/Emails/Model/BatchResponseSimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * BatchResponseSimplePublicUpsertObject Class Doc Comment * * @category Class + * @description Represents the result of a batch upsert operation, including the operation’s status, timestamps, and a list of successfully created or updated objects. * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,10 +59,12 @@ class BatchResponseSimplePublicUpsertObject implements ModelInterface, ArrayAcce */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', + 'errors' => '\HubSpot\Client\Crm\Objects\Emails\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicUpsertObject[]', + 'started_at' => '\DateTime', 'status' => 'string' ]; @@ -74,10 +77,12 @@ class BatchResponseSimplePublicUpsertObject implements ModelInterface, ArrayAcce */ protected static $openAPIFormats = [ 'completed_at' => 'date-time', - 'requested_at' => 'date-time', - 'started_at' => 'date-time', + 'errors' => null, 'links' => null, + 'num_errors' => 'int32', + 'requested_at' => 'date-time', 'results' => null, + 'started_at' => 'date-time', 'status' => null ]; @@ -88,10 +93,12 @@ class BatchResponseSimplePublicUpsertObject implements ModelInterface, ArrayAcce */ protected static array $openAPINullables = [ 'completed_at' => false, - 'requested_at' => false, - 'started_at' => false, + 'errors' => false, 'links' => false, + 'num_errors' => false, + 'requested_at' => false, 'results' => false, + 'started_at' => false, 'status' => false ]; @@ -182,10 +189,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'completed_at' => 'completedAt', - 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', + 'errors' => 'errors', 'links' => 'links', + 'num_errors' => 'numErrors', + 'requested_at' => 'requestedAt', 'results' => 'results', + 'started_at' => 'startedAt', 'status' => 'status' ]; @@ -196,10 +205,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'completed_at' => 'setCompletedAt', - 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', + 'errors' => 'setErrors', 'links' => 'setLinks', + 'num_errors' => 'setNumErrors', + 'requested_at' => 'setRequestedAt', 'results' => 'setResults', + 'started_at' => 'setStartedAt', 'status' => 'setStatus' ]; @@ -210,10 +221,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'completed_at' => 'getCompletedAt', - 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', + 'errors' => 'getErrors', 'links' => 'getLinks', + 'num_errors' => 'getNumErrors', + 'requested_at' => 'getRequestedAt', 'results' => 'getResults', + 'started_at' => 'getStartedAt', 'status' => 'getStatus' ]; @@ -258,10 +271,10 @@ public function getModelName() return self::$openAPIModelName; } - public const STATUS_PENDING = 'PENDING'; - public const STATUS_PROCESSING = 'PROCESSING'; public const STATUS_CANCELED = 'CANCELED'; public const STATUS_COMPLETE = 'COMPLETE'; + public const STATUS_PENDING = 'PENDING'; + public const STATUS_PROCESSING = 'PROCESSING'; /** * Gets allowable values of the enum @@ -271,10 +284,10 @@ public function getModelName() public function getStatusAllowableValues() { return [ - self::STATUS_PENDING, - self::STATUS_PROCESSING, self::STATUS_CANCELED, self::STATUS_COMPLETE, + self::STATUS_PENDING, + self::STATUS_PROCESSING, ]; } @@ -294,10 +307,12 @@ public function getStatusAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('completed_at', $data ?? [], null); - $this->setIfExists('requested_at', $data ?? [], null); - $this->setIfExists('started_at', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('links', $data ?? [], null); + $this->setIfExists('num_errors', $data ?? [], null); + $this->setIfExists('requested_at', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('started_at', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); } @@ -331,12 +346,12 @@ public function listInvalidProperties() if ($this->container['completed_at'] === null) { $invalidProperties[] = "'completed_at' can't be null"; } - if ($this->container['started_at'] === null) { - $invalidProperties[] = "'started_at' can't be null"; - } if ($this->container['results'] === null) { $invalidProperties[] = "'results' can't be null"; } + if ($this->container['started_at'] === null) { + $invalidProperties[] = "'started_at' can't be null"; + } if ($this->container['status'] === null) { $invalidProperties[] = "'status' can't be null"; } @@ -377,7 +392,7 @@ public function getCompletedAt() /** * Sets completed_at * - * @param \DateTime $completed_at completed_at + * @param \DateTime $completed_at The timestamp when the batch process was completed, in ISO 8601 format. * * @return self */ @@ -392,82 +407,109 @@ public function setCompletedAt($completed_at) } /** - * Gets requested_at + * Gets errors * - * @return \DateTime|null + * @return \HubSpot\Client\Crm\Objects\Emails\Model\StandardError[]|null */ - public function getRequestedAt() + public function getErrors() { - return $this->container['requested_at']; + return $this->container['errors']; } /** - * Sets requested_at + * Sets errors * - * @param \DateTime|null $requested_at requested_at + * @param \HubSpot\Client\Crm\Objects\Emails\Model\StandardError[]|null $errors errors * * @return self */ - public function setRequestedAt($requested_at) + public function setErrors($errors) { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['requested_at'] = $requested_at; + $this->container['errors'] = $errors; return $this; } /** - * Gets started_at + * Gets links * - * @return \DateTime + * @return array|null */ - public function getStartedAt() + public function getLinks() { - return $this->container['started_at']; + return $this->container['links']; } /** - * Sets started_at + * Sets links * - * @param \DateTime $started_at started_at + * @param array|null $links An object containing relevant links related to the batch request. * * @return self */ - public function setStartedAt($started_at) + public function setLinks($links) { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['started_at'] = $started_at; + $this->container['links'] = $links; return $this; } /** - * Gets links + * Gets num_errors * - * @return array|null + * @return int|null */ - public function getLinks() + public function getNumErrors() { - return $this->container['links']; + return $this->container['num_errors']; } /** - * Sets links + * Sets num_errors * - * @param array|null $links links + * @param int|null $num_errors The total number of errors that occurred during the operation. * * @return self */ - public function setLinks($links) + public function setNumErrors($num_errors) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($num_errors)) { + throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); } - $this->container['links'] = $links; + $this->container['num_errors'] = $num_errors; + + return $this; + } + + /** + * Gets requested_at + * + * @return \DateTime|null + */ + public function getRequestedAt() + { + return $this->container['requested_at']; + } + + /** + * Sets requested_at + * + * @param \DateTime|null $requested_at The timestamp when the batch process was initiated, in ISO 8601 format. + * + * @return self + */ + public function setRequestedAt($requested_at) + { + if (is_null($requested_at)) { + throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + } + $this->container['requested_at'] = $requested_at; return $this; } @@ -499,6 +541,33 @@ public function setResults($results) return $this; } + /** + * Gets started_at + * + * @return \DateTime + */ + public function getStartedAt() + { + return $this->container['started_at']; + } + + /** + * Sets started_at + * + * @param \DateTime $started_at The timestamp when the batch process began execution, in ISO 8601 format. + * + * @return self + */ + public function setStartedAt($started_at) + { + if (is_null($started_at)) { + throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + } + $this->container['started_at'] = $started_at; + + return $this; + } + /** * Gets status * @@ -512,7 +581,7 @@ public function getStatus() /** * Sets status * - * @param string $status status + * @param string $status The status of the batch processing request. Can be: \"PENDING\", \"PROCESSING\", \"CANCELED\", or \"COMPLETE\". * * @return self */ @@ -538,11 +607,11 @@ public function setStatus($status) /** * 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]); } @@ -550,12 +619,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; } @@ -580,11 +649,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/Objects/Emails/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php b/codegen/Crm/Objects/Emails/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php deleted file mode 100644 index 7eb39b6c..00000000 --- a/codegen/Crm/Objects/Emails/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php +++ /dev/null @@ -1,697 +0,0 @@ - - */ -class BatchResponseSimplePublicUpsertObjectWithErrors implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'BatchResponseSimplePublicUpsertObjectWithErrors'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'completed_at' => '\DateTime', - 'num_errors' => 'int', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', - 'links' => 'array', - 'results' => '\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicUpsertObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\Emails\Model\StandardError[]', - 'status' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'completed_at' => 'date-time', - 'num_errors' => 'int32', - 'requested_at' => 'date-time', - 'started_at' => 'date-time', - 'links' => null, - 'results' => null, - 'errors' => null, - 'status' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'completed_at' => false, - 'num_errors' => false, - 'requested_at' => false, - 'started_at' => false, - 'links' => false, - 'results' => false, - 'errors' => false, - 'status' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'completed_at' => 'completedAt', - 'num_errors' => 'numErrors', - 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', - 'links' => 'links', - 'results' => 'results', - 'errors' => 'errors', - 'status' => 'status' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'completed_at' => 'setCompletedAt', - 'num_errors' => 'setNumErrors', - 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', - 'links' => 'setLinks', - 'results' => 'setResults', - 'errors' => 'setErrors', - 'status' => 'setStatus' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'completed_at' => 'getCompletedAt', - 'num_errors' => 'getNumErrors', - 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', - 'links' => 'getLinks', - 'results' => 'getResults', - 'errors' => 'getErrors', - 'status' => 'getStatus' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - public const STATUS_PENDING = 'PENDING'; - public const STATUS_PROCESSING = 'PROCESSING'; - public const STATUS_CANCELED = 'CANCELED'; - public const STATUS_COMPLETE = 'COMPLETE'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStatusAllowableValues() - { - return [ - self::STATUS_PENDING, - self::STATUS_PROCESSING, - self::STATUS_CANCELED, - self::STATUS_COMPLETE, - ]; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('completed_at', $data ?? [], null); - $this->setIfExists('num_errors', $data ?? [], null); - $this->setIfExists('requested_at', $data ?? [], null); - $this->setIfExists('started_at', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); - $this->setIfExists('results', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['completed_at'] === null) { - $invalidProperties[] = "'completed_at' can't be null"; - } - if ($this->container['started_at'] === null) { - $invalidProperties[] = "'started_at' can't be null"; - } - if ($this->container['results'] === null) { - $invalidProperties[] = "'results' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'status', must be one of '%s'", - $this->container['status'], - implode("', '", $allowedValues) - ); - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets completed_at - * - * @return \DateTime - */ - public function getCompletedAt() - { - return $this->container['completed_at']; - } - - /** - * Sets completed_at - * - * @param \DateTime $completed_at completed_at - * - * @return self - */ - public function setCompletedAt($completed_at) - { - if (is_null($completed_at)) { - throw new \InvalidArgumentException('non-nullable completed_at cannot be null'); - } - $this->container['completed_at'] = $completed_at; - - return $this; - } - - /** - * Gets num_errors - * - * @return int|null - */ - public function getNumErrors() - { - return $this->container['num_errors']; - } - - /** - * Sets num_errors - * - * @param int|null $num_errors num_errors - * - * @return self - */ - public function setNumErrors($num_errors) - { - if (is_null($num_errors)) { - throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); - } - $this->container['num_errors'] = $num_errors; - - return $this; - } - - /** - * Gets requested_at - * - * @return \DateTime|null - */ - public function getRequestedAt() - { - return $this->container['requested_at']; - } - - /** - * Sets requested_at - * - * @param \DateTime|null $requested_at requested_at - * - * @return self - */ - public function setRequestedAt($requested_at) - { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); - } - $this->container['requested_at'] = $requested_at; - - return $this; - } - - /** - * Gets started_at - * - * @return \DateTime - */ - public function getStartedAt() - { - return $this->container['started_at']; - } - - /** - * Sets started_at - * - * @param \DateTime $started_at started_at - * - * @return self - */ - public function setStartedAt($started_at) - { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); - } - $this->container['started_at'] = $started_at; - - return $this; - } - - /** - * Gets links - * - * @return array|null - */ - public function getLinks() - { - return $this->container['links']; - } - - /** - * Sets links - * - * @param array|null $links links - * - * @return self - */ - public function setLinks($links) - { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); - } - $this->container['links'] = $links; - - return $this; - } - - /** - * Gets results - * - * @return \HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicUpsertObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicUpsertObject[] $results results - * - * @return self - */ - public function setResults($results) - { - if (is_null($results)) { - throw new \InvalidArgumentException('non-nullable results cannot be null'); - } - $this->container['results'] = $results; - - return $this; - } - - /** - * Gets errors - * - * @return \HubSpot\Client\Crm\Objects\Emails\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\Emails\Model\StandardError[]|null $errors errors - * - * @return self - */ - public function setErrors($errors) - { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); - } - $this->container['errors'] = $errors; - - return $this; - } - - /** - * Gets status - * - * @return string - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", - $status, - implode("', '", $allowedValues) - ) - ); - } - $this->container['status'] = $status; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/codegen/Crm/Objects/Emails/Model/CollectionResponseAssociatedId.php b/codegen/Crm/Objects/Emails/Model/CollectionResponseAssociatedId.php index fd1f0524..43ded48c 100644 --- a/codegen/Crm/Objects/Emails/Model/CollectionResponseAssociatedId.php +++ b/codegen/Crm/Objects/Emails/Model/CollectionResponseAssociatedId.php @@ -2,7 +2,7 @@ /** * CollectionResponseAssociatedId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -355,11 +355,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]); } @@ -367,12 +367,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; } @@ -397,11 +397,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/Objects/Emails/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php b/codegen/Crm/Objects/Emails/Model/CollectionResponseSimplePublicObjectWithAssociations.php similarity index 82% rename from codegen/Crm/Objects/Emails/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php rename to codegen/Crm/Objects/Emails/Model/CollectionResponseSimplePublicObjectWithAssociations.php index ea91fb5e..d074c6ea 100644 --- a/codegen/Crm/Objects/Emails/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php +++ b/codegen/Crm/Objects/Emails/Model/CollectionResponseSimplePublicObjectWithAssociations.php @@ -1,8 +1,8 @@ */ -class CollectionResponseSimplePublicObjectWithAssociationsForwardPaging implements ModelInterface, ArrayAccess, \JsonSerializable +class CollectionResponseSimplePublicObjectWithAssociations implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +49,7 @@ class CollectionResponseSimplePublicObjectWithAssociationsForwardPaging implemen * * @var string */ - protected static $openAPIModelName = 'CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; + protected static $openAPIModelName = 'CollectionResponseSimplePublicObjectWithAssociations'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,7 +57,7 @@ class CollectionResponseSimplePublicObjectWithAssociationsForwardPaging implemen * @var string[] */ protected static $openAPITypes = [ - 'paging' => '\HubSpot\Client\Crm\Objects\Emails\Model\ForwardPaging', + 'paging' => '\HubSpot\Client\Crm\Objects\Emails\Model\Paging', 'results' => '\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObjectWithAssociations[]' ]; @@ -302,7 +302,7 @@ public function valid() /** * Gets paging * - * @return \HubSpot\Client\Crm\Objects\Emails\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\Emails\Model\Paging|null */ public function getPaging() { @@ -312,7 +312,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\Emails\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\Emails\Model\Paging|null $paging paging * * @return self */ @@ -355,11 +355,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]); } @@ -367,12 +367,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; } @@ -397,11 +397,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/Objects/Emails/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php b/codegen/Crm/Objects/Emails/Model/CollectionResponseWithTotalSimplePublicObject.php similarity index 79% rename from codegen/Crm/Objects/Emails/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php rename to codegen/Crm/Objects/Emails/Model/CollectionResponseWithTotalSimplePublicObject.php index ea8ca585..46a06bd6 100644 --- a/codegen/Crm/Objects/Emails/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php +++ b/codegen/Crm/Objects/Emails/Model/CollectionResponseWithTotalSimplePublicObject.php @@ -1,8 +1,8 @@ */ -class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements ModelInterface, ArrayAccess, \JsonSerializable +class CollectionResponseWithTotalSimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +50,7 @@ class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements Mode * * @var string */ - protected static $openAPIModelName = 'CollectionResponseWithTotalSimplePublicObjectForwardPaging'; + protected static $openAPIModelName = 'CollectionResponseWithTotalSimplePublicObject'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,9 +58,9 @@ class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements Mode * @var string[] */ protected static $openAPITypes = [ - 'total' => 'int', - 'paging' => '\HubSpot\Client\Crm\Objects\Emails\Model\ForwardPaging', - 'results' => '\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObject[]' + 'paging' => '\HubSpot\Client\Crm\Objects\Emails\Model\Paging', + 'results' => '\HubSpot\Client\Crm\Objects\Emails\Model\SimplePublicObject[]', + 'total' => 'int' ]; /** @@ -70,9 +71,9 @@ class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements Mode * @psalm-var array */ protected static $openAPIFormats = [ - 'total' => 'int32', 'paging' => null, - 'results' => null + 'results' => null, + 'total' => 'int32' ]; /** @@ -81,9 +82,9 @@ class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements Mode * @var boolean[] */ protected static array $openAPINullables = [ - 'total' => false, 'paging' => false, - 'results' => false + 'results' => false, + 'total' => false ]; /** @@ -172,9 +173,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'total' => 'total', 'paging' => 'paging', - 'results' => 'results' + 'results' => 'results', + 'total' => 'total' ]; /** @@ -183,9 +184,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'total' => 'setTotal', 'paging' => 'setPaging', - 'results' => 'setResults' + 'results' => 'setResults', + 'total' => 'setTotal' ]; /** @@ -194,9 +195,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'total' => 'getTotal', 'paging' => 'getPaging', - 'results' => 'getResults' + 'results' => 'getResults', + 'total' => 'getTotal' ]; /** @@ -256,9 +257,9 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('total', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); } /** @@ -288,12 +289,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['total'] === null) { - $invalidProperties[] = "'total' can't be null"; - } if ($this->container['results'] === null) { $invalidProperties[] = "'results' can't be null"; } + if ($this->container['total'] === null) { + $invalidProperties[] = "'total' can't be null"; + } return $invalidProperties; } @@ -309,37 +310,10 @@ public function valid() } - /** - * Gets total - * - * @return int - */ - public function getTotal() - { - return $this->container['total']; - } - - /** - * Sets total - * - * @param int $total total - * - * @return self - */ - public function setTotal($total) - { - if (is_null($total)) { - throw new \InvalidArgumentException('non-nullable total cannot be null'); - } - $this->container['total'] = $total; - - return $this; - } - /** * Gets paging * - * @return \HubSpot\Client\Crm\Objects\Emails\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\Emails\Model\Paging|null */ public function getPaging() { @@ -349,7 +323,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\Emails\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\Emails\Model\Paging|null $paging paging * * @return self */ @@ -389,14 +363,41 @@ public function setResults($results) return $this; } + + /** + * Gets total + * + * @return int + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int $total The number of available results + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } /** * 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]); } @@ -404,12 +405,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; } @@ -434,11 +435,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/Objects/Emails/Model/Error.php b/codegen/Crm/Objects/Emails/Model/Error.php index b3c36b9a..3b241222 100644 --- a/codegen/Crm/Objects/Emails/Model/Error.php +++ b/codegen/Crm/Objects/Emails/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,13 +57,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'string', + 'category' => 'string', 'context' => 'array', 'correlation_id' => 'string', + 'errors' => '\HubSpot\Client\Crm\Objects\Emails\Model\ErrorDetail[]', 'links' => 'array', 'message' => 'string', - 'category' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\Emails\Model\ErrorDetail[]' + 'sub_category' => 'string' ]; /** @@ -74,13 +74,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, + 'category' => null, 'context' => null, 'correlation_id' => 'uuid', + 'errors' => null, 'links' => null, 'message' => null, - 'category' => null, - 'errors' => null + 'sub_category' => null ]; /** @@ -89,13 +89,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, + 'category' => false, 'context' => false, 'correlation_id' => false, + 'errors' => false, 'links' => false, 'message' => false, - 'category' => false, - 'errors' => false + 'sub_category' => false ]; /** @@ -184,13 +184,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', + 'category' => 'category', 'context' => 'context', 'correlation_id' => 'correlationId', + 'errors' => 'errors', 'links' => 'links', 'message' => 'message', - 'category' => 'category', - 'errors' => 'errors' + 'sub_category' => 'subCategory' ]; /** @@ -199,13 +199,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', + 'category' => 'setCategory', 'context' => 'setContext', 'correlation_id' => 'setCorrelationId', + 'errors' => 'setErrors', 'links' => 'setLinks', 'message' => 'setMessage', - 'category' => 'setCategory', - 'errors' => 'setErrors' + 'sub_category' => 'setSubCategory' ]; /** @@ -214,13 +214,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', + 'category' => 'getCategory', 'context' => 'getContext', 'correlation_id' => 'getCorrelationId', + 'errors' => 'getErrors', 'links' => 'getLinks', 'message' => 'getMessage', - 'category' => 'getCategory', - 'errors' => 'getErrors' + 'sub_category' => 'getSubCategory' ]; /** @@ -280,13 +280,13 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); $this->setIfExists('correlation_id', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('links', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); - $this->setIfExists('category', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -316,15 +316,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['category'] === null) { + $invalidProperties[] = "'category' can't be null"; + } if ($this->container['correlation_id'] === null) { $invalidProperties[] = "'correlation_id' can't be null"; } if ($this->container['message'] === null) { $invalidProperties[] = "'message' can't be null"; } - if ($this->container['category'] === null) { - $invalidProperties[] = "'category' can't be null"; - } return $invalidProperties; } @@ -341,28 +341,28 @@ public function valid() /** - * Gets sub_category + * Gets category * - * @return string|null + * @return string */ - public function getSubCategory() + public function getCategory() { - return $this->container['sub_category']; + return $this->container['category']; } /** - * Sets sub_category + * Sets category * - * @param string|null $sub_category A specific category that contains more specific detail about the error + * @param string $category The error category * * @return self */ - public function setSubCategory($sub_category) + public function setCategory($category) { - if (is_null($sub_category)) { - throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['sub_category'] = $sub_category; + $this->container['category'] = $category; return $this; } @@ -421,6 +421,33 @@ public function setCorrelationId($correlation_id) return $this; } + /** + * Gets errors + * + * @return \HubSpot\Client\Crm\Objects\Emails\Model\ErrorDetail[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Objects\Emails\Model\ErrorDetail[]|null $errors further information about the error + * + * @return self + */ + public function setErrors($errors) + { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; + + return $this; + } + /** * Gets links * @@ -476,66 +503,39 @@ public function setMessage($message) } /** - * Gets category - * - * @return string - */ - public function getCategory() - { - return $this->container['category']; - } - - /** - * Sets category - * - * @param string $category The error category - * - * @return self - */ - public function setCategory($category) - { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); - } - $this->container['category'] = $category; - - return $this; - } - - /** - * Gets errors + * Gets sub_category * - * @return \HubSpot\Client\Crm\Objects\Emails\Model\ErrorDetail[]|null + * @return string|null */ - public function getErrors() + public function getSubCategory() { - return $this->container['errors']; + return $this->container['sub_category']; } /** - * Sets errors + * Sets sub_category * - * @param \HubSpot\Client\Crm\Objects\Emails\Model\ErrorDetail[]|null $errors further information about the error + * @param string|null $sub_category A specific category that contains more specific detail about the error * * @return self */ - public function setErrors($errors) + public function setSubCategory($sub_category) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['errors'] = $errors; + $this->container['sub_category'] = $sub_category; return $this; } /** * 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/Objects/Emails/Model/ErrorDetail.php b/codegen/Crm/Objects/Emails/Model/ErrorDetail.php index 4840ecfe..303a2124 100644 --- a/codegen/Crm/Objects/Emails/Model/ErrorDetail.php +++ b/codegen/Crm/Objects/Emails/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,11 +57,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'string', 'code' => 'string', - 'in' => 'string', 'context' => 'array', - 'message' => 'string' + 'in' => 'string', + 'message' => 'string', + 'sub_category' => 'string' ]; /** @@ -72,11 +72,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, 'code' => null, - 'in' => null, 'context' => null, - 'message' => null + 'in' => null, + 'message' => null, + 'sub_category' => null ]; /** @@ -85,11 +85,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, 'code' => false, - 'in' => false, 'context' => false, - 'message' => false + 'in' => false, + 'message' => false, + 'sub_category' => false ]; /** @@ -178,11 +178,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', 'code' => 'code', - 'in' => 'in', 'context' => 'context', - 'message' => 'message' + 'in' => 'in', + 'message' => 'message', + 'sub_category' => 'subCategory' ]; /** @@ -191,11 +191,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', 'code' => 'setCode', - 'in' => 'setIn', 'context' => 'setContext', - 'message' => 'setMessage' + 'in' => 'setIn', + 'message' => 'setMessage', + 'sub_category' => 'setSubCategory' ]; /** @@ -204,11 +204,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', 'code' => 'getCode', - 'in' => 'getIn', 'context' => 'getContext', - 'message' => 'getMessage' + 'in' => 'getIn', + 'message' => 'getMessage', + 'sub_category' => 'getSubCategory' ]; /** @@ -268,11 +268,11 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('in', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); + $this->setIfExists('in', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -321,55 +321,55 @@ public function valid() /** - * Gets sub_category + * Gets code * * @return string|null */ - public function getSubCategory() + public function getCode() { - return $this->container['sub_category']; + return $this->container['code']; } /** - * Sets sub_category + * Sets code * - * @param string|null $sub_category A specific category that contains more specific detail about the error + * @param string|null $code The status code associated with the error detail * * @return self */ - public function setSubCategory($sub_category) + public function setCode($code) { - if (is_null($sub_category)) { - throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); } - $this->container['sub_category'] = $sub_category; + $this->container['code'] = $code; return $this; } /** - * Gets code + * Gets context * - * @return string|null + * @return array|null */ - public function getCode() + public function getContext() { - return $this->container['code']; + return $this->container['context']; } /** - * Sets code + * Sets context * - * @param string|null $code The status code associated with the error detail + * @param array|null $context Context about the error condition * * @return self */ - public function setCode($code) + public function setContext($context) { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); + if (is_null($context)) { + throw new \InvalidArgumentException('non-nullable context cannot be null'); } - $this->container['code'] = $code; + $this->container['context'] = $context; return $this; } @@ -402,66 +402,66 @@ public function setIn($in) } /** - * Gets context + * Gets message * - * @return array|null + * @return string */ - public function getContext() + public function getMessage() { - return $this->container['context']; + return $this->container['message']; } /** - * Sets context + * Sets message * - * @param array|null $context Context about the error condition + * @param string $message A human readable message describing the error along with remediation steps where appropriate * * @return self */ - public function setContext($context) + public function setMessage($message) { - if (is_null($context)) { - throw new \InvalidArgumentException('non-nullable context cannot be null'); + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - $this->container['context'] = $context; + $this->container['message'] = $message; return $this; } /** - * Gets message + * Gets sub_category * - * @return string + * @return string|null */ - public function getMessage() + public function getSubCategory() { - return $this->container['message']; + return $this->container['sub_category']; } /** - * Sets message + * Sets sub_category * - * @param string $message A human readable message describing the error along with remediation steps where appropriate + * @param string|null $sub_category A specific category that contains more specific detail about the error * * @return self */ - public function setMessage($message) + public function setSubCategory($sub_category) { - if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['message'] = $message; + $this->container['sub_category'] = $sub_category; return $this; } /** * 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/Objects/Emails/Model/Filter.php b/codegen/Crm/Objects/Emails/Model/Filter.php index 03d060a5..c8bf68a6 100644 --- a/codegen/Crm/Objects/Emails/Model/Filter.php +++ b/codegen/Crm/Objects/Emails/Model/Filter.php @@ -2,7 +2,7 @@ /** * Filter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * Filter Class Doc Comment * * @category Class + * @description Defines a single condition for searching CRM objects, specifying the property to filter on, the operator to use (such as equals, greater than, or contains), and the value(s) to compare against. * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,10 +59,10 @@ class Filter implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'high_value' => 'string', + 'operator' => 'string', 'property_name' => 'string', - 'values' => 'string[]', 'value' => 'string', - 'operator' => 'string' + 'values' => 'string[]' ]; /** @@ -73,10 +74,10 @@ class Filter implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'high_value' => null, + 'operator' => null, 'property_name' => null, - 'values' => null, 'value' => null, - 'operator' => null + 'values' => null ]; /** @@ -86,10 +87,10 @@ class Filter implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'high_value' => false, + 'operator' => false, 'property_name' => false, - 'values' => false, 'value' => false, - 'operator' => false + 'values' => false ]; /** @@ -179,10 +180,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'high_value' => 'highValue', + 'operator' => 'operator', 'property_name' => 'propertyName', - 'values' => 'values', 'value' => 'value', - 'operator' => 'operator' + 'values' => 'values' ]; /** @@ -192,10 +193,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'high_value' => 'setHighValue', + 'operator' => 'setOperator', 'property_name' => 'setPropertyName', - 'values' => 'setValues', 'value' => 'setValue', - 'operator' => 'setOperator' + 'values' => 'setValues' ]; /** @@ -205,10 +206,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'high_value' => 'getHighValue', + 'operator' => 'getOperator', 'property_name' => 'getPropertyName', - 'values' => 'getValues', 'value' => 'getValue', - 'operator' => 'getOperator' + 'values' => 'getValues' ]; /** @@ -252,19 +253,19 @@ public function getModelName() return self::$openAPIModelName; } + public const OPERATOR_BETWEEN = 'BETWEEN'; + public const OPERATOR_CONTAINS_TOKEN = 'CONTAINS_TOKEN'; public const OPERATOR_EQ = 'EQ'; - public const OPERATOR_NEQ = 'NEQ'; - public const OPERATOR_LT = 'LT'; - public const OPERATOR_LTE = 'LTE'; public const OPERATOR_GT = 'GT'; public const OPERATOR_GTE = 'GTE'; - public const OPERATOR_BETWEEN = 'BETWEEN'; - public const OPERATOR_IN = 'IN'; - public const OPERATOR_NOT_IN = 'NOT_IN'; public const OPERATOR_HAS_PROPERTY = 'HAS_PROPERTY'; - public const OPERATOR_NOT_HAS_PROPERTY = 'NOT_HAS_PROPERTY'; - public const OPERATOR_CONTAINS_TOKEN = 'CONTAINS_TOKEN'; + public const OPERATOR_IN = 'IN'; + public const OPERATOR_LT = 'LT'; + public const OPERATOR_LTE = 'LTE'; + public const OPERATOR_NEQ = 'NEQ'; public const OPERATOR_NOT_CONTAINS_TOKEN = 'NOT_CONTAINS_TOKEN'; + public const OPERATOR_NOT_HAS_PROPERTY = 'NOT_HAS_PROPERTY'; + public const OPERATOR_NOT_IN = 'NOT_IN'; /** * Gets allowable values of the enum @@ -274,19 +275,19 @@ public function getModelName() public function getOperatorAllowableValues() { return [ + self::OPERATOR_BETWEEN, + self::OPERATOR_CONTAINS_TOKEN, self::OPERATOR_EQ, - self::OPERATOR_NEQ, - self::OPERATOR_LT, - self::OPERATOR_LTE, self::OPERATOR_GT, self::OPERATOR_GTE, - self::OPERATOR_BETWEEN, - self::OPERATOR_IN, - self::OPERATOR_NOT_IN, self::OPERATOR_HAS_PROPERTY, - self::OPERATOR_NOT_HAS_PROPERTY, - self::OPERATOR_CONTAINS_TOKEN, + self::OPERATOR_IN, + self::OPERATOR_LT, + self::OPERATOR_LTE, + self::OPERATOR_NEQ, self::OPERATOR_NOT_CONTAINS_TOKEN, + self::OPERATOR_NOT_HAS_PROPERTY, + self::OPERATOR_NOT_IN, ]; } @@ -306,10 +307,10 @@ public function getOperatorAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('high_value', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); $this->setIfExists('property_name', $data ?? [], null); - $this->setIfExists('values', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); - $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); } /** @@ -339,9 +340,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['property_name'] === null) { - $invalidProperties[] = "'property_name' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } @@ -354,6 +352,9 @@ public function listInvalidProperties() ); } + if ($this->container['property_name'] === null) { + $invalidProperties[] = "'property_name' can't be null"; + } return $invalidProperties; } @@ -382,7 +383,7 @@ public function getHighValue() /** * Sets high_value * - * @param string|null $high_value high_value + * @param string|null $high_value The upper boundary value when using ranged-based filters. * * @return self */ @@ -397,55 +398,65 @@ public function setHighValue($high_value) } /** - * Gets property_name + * Gets operator * * @return string */ - public function getPropertyName() + public function getOperator() { - return $this->container['property_name']; + return $this->container['operator']; } /** - * Sets property_name + * Sets operator * - * @param string $property_name property_name + * @param string $operator null * * @return self */ - public function setPropertyName($property_name) + public function setOperator($operator) { - if (is_null($property_name)) { - throw new \InvalidArgumentException('non-nullable property_name cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['property_name'] = $property_name; + $allowedValues = $this->getOperatorAllowableValues(); + if (!in_array($operator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'operator', must be one of '%s'", + $operator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['operator'] = $operator; return $this; } /** - * Gets values + * Gets property_name * - * @return string[]|null + * @return string */ - public function getValues() + public function getPropertyName() { - return $this->container['values']; + return $this->container['property_name']; } /** - * Sets values + * Sets property_name * - * @param string[]|null $values values + * @param string $property_name The name of the property to apply the filter to. * * @return self */ - public function setValues($values) + public function setPropertyName($property_name) { - if (is_null($values)) { - throw new \InvalidArgumentException('non-nullable values cannot be null'); + if (is_null($property_name)) { + throw new \InvalidArgumentException('non-nullable property_name cannot be null'); } - $this->container['values'] = $values; + $this->container['property_name'] = $property_name; return $this; } @@ -463,7 +474,7 @@ public function getValue() /** * Sets value * - * @param string|null $value value + * @param string|null $value The value to match against the property. * * @return self */ @@ -478,49 +489,39 @@ public function setValue($value) } /** - * Gets operator + * Gets values * - * @return string + * @return string[]|null */ - public function getOperator() + public function getValues() { - return $this->container['operator']; + return $this->container['values']; } /** - * Sets operator + * Sets values * - * @param string $operator null + * @param string[]|null $values The values to match against the property. * * @return self */ - public function setOperator($operator) + public function setValues($values) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); - } - $allowedValues = $this->getOperatorAllowableValues(); - if (!in_array($operator, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'operator', must be one of '%s'", - $operator, - implode("', '", $allowedValues) - ) - ); + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); } - $this->container['operator'] = $operator; + $this->container['values'] = $values; return $this; } /** * 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]); } @@ -528,12 +529,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; } @@ -558,11 +559,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/Objects/Emails/Model/FilterGroup.php b/codegen/Crm/Objects/Emails/Model/FilterGroup.php index 402d6d14..a3ef70a7 100644 --- a/codegen/Crm/Objects/Emails/Model/FilterGroup.php +++ b/codegen/Crm/Objects/Emails/Model/FilterGroup.php @@ -2,7 +2,7 @@ /** * FilterGroup * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -321,11 +321,11 @@ public function setFilters($filters) /** * 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/Objects/Emails/Model/ForwardPaging.php b/codegen/Crm/Objects/Emails/Model/ForwardPaging.php deleted file mode 100644 index d4b44591..00000000 --- a/codegen/Crm/Objects/Emails/Model/ForwardPaging.php +++ /dev/null @@ -1,409 +0,0 @@ - - */ -class ForwardPaging implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'ForwardPaging'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'next' => '\HubSpot\Client\Crm\Objects\Emails\Model\NextPage' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'next' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'next' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'next' => 'next' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'next' => 'setNext' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'next' => 'getNext' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('next', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets next - * - * @return \HubSpot\Client\Crm\Objects\Emails\Model\NextPage|null - */ - public function getNext() - { - return $this->container['next']; - } - - /** - * Sets next - * - * @param \HubSpot\Client\Crm\Objects\Emails\Model\NextPage|null $next next - * - * @return self - */ - public function setNext($next) - { - if (is_null($next)) { - throw new \InvalidArgumentException('non-nullable next cannot be null'); - } - $this->container['next'] = $next; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/codegen/Crm/Objects/Emails/Model/ModelInterface.php b/codegen/Crm/Objects/Emails/Model/ModelInterface.php index b842bd3a..dcd6e958 100644 --- a/codegen/Crm/Objects/Emails/Model/ModelInterface.php +++ b/codegen/Crm/Objects/Emails/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails\Model @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/Emails/Model/NextPage.php b/codegen/Crm/Objects/Emails/Model/NextPage.php index 904296c2..d3850ee5 100644 --- a/codegen/Crm/Objects/Emails/Model/NextPage.php +++ b/codegen/Crm/Objects/Emails/Model/NextPage.php @@ -2,7 +2,7 @@ /** * NextPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * NextPage Class Doc Comment * * @category Class + * @description Specifies the paging information needed to retrieve the next set of results in a paginated API response * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,8 +58,8 @@ class NextPage implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'link' => 'string', - 'after' => 'string' + 'after' => 'string', + 'link' => 'string' ]; /** @@ -69,8 +70,8 @@ class NextPage implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'link' => null, - 'after' => null + 'after' => null, + 'link' => null ]; /** @@ -79,8 +80,8 @@ class NextPage implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'link' => false, - 'after' => false + 'after' => false, + 'link' => false ]; /** @@ -169,8 +170,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'link' => 'link', - 'after' => 'after' + 'after' => 'after', + 'link' => 'link' ]; /** @@ -179,8 +180,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'link' => 'setLink', - 'after' => 'setAfter' + 'after' => 'setAfter', + 'link' => 'setLink' ]; /** @@ -189,8 +190,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'link' => 'getLink', - 'after' => 'getAfter' + 'after' => 'getAfter', + 'link' => 'getLink' ]; /** @@ -250,8 +251,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('link', $data ?? [], null); $this->setIfExists('after', $data ?? [], null); + $this->setIfExists('link', $data ?? [], null); } /** @@ -300,66 +301,66 @@ public function valid() /** - * Gets link + * Gets after * - * @return string|null + * @return string */ - public function getLink() + public function getAfter() { - return $this->container['link']; + return $this->container['after']; } /** - * Sets link + * Sets after * - * @param string|null $link link + * @param string $after A paging cursor token for retrieving subsequent pages. * * @return self */ - public function setLink($link) + public function setAfter($after) { - if (is_null($link)) { - throw new \InvalidArgumentException('non-nullable link cannot be null'); + if (is_null($after)) { + throw new \InvalidArgumentException('non-nullable after cannot be null'); } - $this->container['link'] = $link; + $this->container['after'] = $after; return $this; } /** - * Gets after + * Gets link * - * @return string + * @return string|null */ - public function getAfter() + public function getLink() { - return $this->container['after']; + return $this->container['link']; } /** - * Sets after + * Sets link * - * @param string $after after + * @param string|null $link A URL that can be used to retrieve the next page results. * * @return self */ - public function setAfter($after) + public function setLink($link) { - if (is_null($after)) { - throw new \InvalidArgumentException('non-nullable after cannot be null'); + if (is_null($link)) { + throw new \InvalidArgumentException('non-nullable link cannot be null'); } - $this->container['after'] = $after; + $this->container['link'] = $link; return $this; } /** * 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]); } @@ -367,12 +368,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; } @@ -397,11 +398,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/Objects/Emails/Model/Paging.php b/codegen/Crm/Objects/Emails/Model/Paging.php index a54ba651..3bae6e51 100644 --- a/codegen/Crm/Objects/Emails/Model/Paging.php +++ b/codegen/Crm/Objects/Emails/Model/Paging.php @@ -2,7 +2,7 @@ /** * Paging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -352,11 +352,11 @@ public function setPrev($prev) /** * 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]); } @@ -364,12 +364,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; } @@ -394,11 +394,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/Objects/Emails/Model/PreviousPage.php b/codegen/Crm/Objects/Emails/Model/PreviousPage.php index a38d3b8b..8ed8403a 100644 --- a/codegen/Crm/Objects/Emails/Model/PreviousPage.php +++ b/codegen/Crm/Objects/Emails/Model/PreviousPage.php @@ -2,7 +2,7 @@ /** * PreviousPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * PreviousPage Class Doc Comment * * @category Class + * @description specifies the paging information needed to retrieve the previous set of results in a paginated API response * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -312,7 +313,7 @@ public function getBefore() /** * Sets before * - * @param string $before before + * @param string $before A paging cursor token for retrieving previous pages. * * @return self */ @@ -339,7 +340,7 @@ public function getLink() /** * Sets link * - * @param string|null $link link + * @param string|null $link A URL that can be used to retrieve the previous pages' results. * * @return self */ @@ -355,11 +356,11 @@ public function setLink($link) /** * 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]); } @@ -367,12 +368,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; } @@ -397,11 +398,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/Objects/Emails/Model/PublicAssociationsForObject.php b/codegen/Crm/Objects/Emails/Model/PublicAssociationsForObject.php index e9e0e19b..ddb2084c 100644 --- a/codegen/Crm/Objects/Emails/Model/PublicAssociationsForObject.php +++ b/codegen/Crm/Objects/Emails/Model/PublicAssociationsForObject.php @@ -2,7 +2,7 @@ /** * PublicAssociationsForObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,8 +57,8 @@ class PublicAssociationsForObject implements ModelInterface, ArrayAccess, \JsonS * @var string[] */ protected static $openAPITypes = [ - 'types' => '\HubSpot\Client\Crm\Objects\Emails\Model\AssociationSpec[]', - 'to' => '\HubSpot\Client\Crm\Objects\Emails\Model\PublicObjectId' + 'to' => '\HubSpot\Client\Crm\Objects\Emails\Model\PublicObjectId', + 'types' => '\HubSpot\Client\Crm\Objects\Emails\Model\AssociationSpec[]' ]; /** @@ -69,8 +69,8 @@ class PublicAssociationsForObject implements ModelInterface, ArrayAccess, \JsonS * @psalm-var array */ protected static $openAPIFormats = [ - 'types' => null, - 'to' => null + 'to' => null, + 'types' => null ]; /** @@ -79,8 +79,8 @@ class PublicAssociationsForObject implements ModelInterface, ArrayAccess, \JsonS * @var boolean[] */ protected static array $openAPINullables = [ - 'types' => false, - 'to' => false + 'to' => false, + 'types' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'types' => 'types', - 'to' => 'to' + 'to' => 'to', + 'types' => 'types' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'types' => 'setTypes', - 'to' => 'setTo' + 'to' => 'setTo', + 'types' => 'setTypes' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'types' => 'getTypes', - 'to' => 'getTo' + 'to' => 'getTo', + 'types' => 'getTypes' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('types', $data ?? [], null); $this->setIfExists('to', $data ?? [], null); + $this->setIfExists('types', $data ?? [], null); } /** @@ -281,12 +281,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['types'] === null) { - $invalidProperties[] = "'types' can't be null"; - } if ($this->container['to'] === null) { $invalidProperties[] = "'to' can't be null"; } + if ($this->container['types'] === null) { + $invalidProperties[] = "'types' can't be null"; + } return $invalidProperties; } @@ -303,66 +303,66 @@ public function valid() /** - * Gets types + * Gets to * - * @return \HubSpot\Client\Crm\Objects\Emails\Model\AssociationSpec[] + * @return \HubSpot\Client\Crm\Objects\Emails\Model\PublicObjectId */ - public function getTypes() + public function getTo() { - return $this->container['types']; + return $this->container['to']; } /** - * Sets types + * Sets to * - * @param \HubSpot\Client\Crm\Objects\Emails\Model\AssociationSpec[] $types types + * @param \HubSpot\Client\Crm\Objects\Emails\Model\PublicObjectId $to to * * @return self */ - public function setTypes($types) + public function setTo($to) { - if (is_null($types)) { - throw new \InvalidArgumentException('non-nullable types cannot be null'); + if (is_null($to)) { + throw new \InvalidArgumentException('non-nullable to cannot be null'); } - $this->container['types'] = $types; + $this->container['to'] = $to; return $this; } /** - * Gets to + * Gets types * - * @return \HubSpot\Client\Crm\Objects\Emails\Model\PublicObjectId + * @return \HubSpot\Client\Crm\Objects\Emails\Model\AssociationSpec[] */ - public function getTo() + public function getTypes() { - return $this->container['to']; + return $this->container['types']; } /** - * Sets to + * Sets types * - * @param \HubSpot\Client\Crm\Objects\Emails\Model\PublicObjectId $to to + * @param \HubSpot\Client\Crm\Objects\Emails\Model\AssociationSpec[] $types types * * @return self */ - public function setTo($to) + public function setTypes($types) { - if (is_null($to)) { - throw new \InvalidArgumentException('non-nullable to cannot be null'); + if (is_null($types)) { + throw new \InvalidArgumentException('non-nullable types cannot be null'); } - $this->container['to'] = $to; + $this->container['types'] = $types; return $this; } /** * 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/Objects/Emails/Model/PublicObjectId.php b/codegen/Crm/Objects/Emails/Model/PublicObjectId.php index 2376802a..e2b6d18b 100644 --- a/codegen/Crm/Objects/Emails/Model/PublicObjectId.php +++ b/codegen/Crm/Objects/Emails/Model/PublicObjectId.php @@ -2,7 +2,7 @@ /** * PublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * PublicObjectId Class Doc Comment * * @category Class + * @description Contains the Id of a Public Object * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -305,7 +306,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -321,11 +322,11 @@ public function setId($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]); } @@ -333,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; } @@ -363,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/Objects/Emails/Model/PublicObjectSearchRequest.php b/codegen/Crm/Objects/Emails/Model/PublicObjectSearchRequest.php index 0f03657f..273c9d55 100644 --- a/codegen/Crm/Objects/Emails/Model/PublicObjectSearchRequest.php +++ b/codegen/Crm/Objects/Emails/Model/PublicObjectSearchRequest.php @@ -2,7 +2,7 @@ /** * PublicObjectSearchRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * PublicObjectSearchRequest Class Doc Comment * * @category Class + * @description Describes a search request * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,12 +58,12 @@ class PublicObjectSearchRequest implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ - 'query' => 'string', - 'limit' => 'int', 'after' => 'string', - 'sorts' => 'string[]', + 'filter_groups' => '\HubSpot\Client\Crm\Objects\Emails\Model\FilterGroup[]', + 'limit' => 'int', 'properties' => 'string[]', - 'filter_groups' => '\HubSpot\Client\Crm\Objects\Emails\Model\FilterGroup[]' + 'query' => 'string', + 'sorts' => 'string[]' ]; /** @@ -73,12 +74,12 @@ class PublicObjectSearchRequest implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ - 'query' => null, - 'limit' => 'int32', 'after' => null, - 'sorts' => null, + 'filter_groups' => null, + 'limit' => 'int32', 'properties' => null, - 'filter_groups' => null + 'query' => null, + 'sorts' => null ]; /** @@ -87,12 +88,12 @@ class PublicObjectSearchRequest implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static array $openAPINullables = [ - 'query' => false, - 'limit' => false, 'after' => false, - 'sorts' => false, + 'filter_groups' => false, + 'limit' => false, 'properties' => false, - 'filter_groups' => false + 'query' => false, + 'sorts' => false ]; /** @@ -181,12 +182,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'query' => 'query', - 'limit' => 'limit', 'after' => 'after', - 'sorts' => 'sorts', + 'filter_groups' => 'filterGroups', + 'limit' => 'limit', 'properties' => 'properties', - 'filter_groups' => 'filterGroups' + 'query' => 'query', + 'sorts' => 'sorts' ]; /** @@ -195,12 +196,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'query' => 'setQuery', - 'limit' => 'setLimit', 'after' => 'setAfter', - 'sorts' => 'setSorts', + 'filter_groups' => 'setFilterGroups', + 'limit' => 'setLimit', 'properties' => 'setProperties', - 'filter_groups' => 'setFilterGroups' + 'query' => 'setQuery', + 'sorts' => 'setSorts' ]; /** @@ -209,12 +210,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'query' => 'getQuery', - 'limit' => 'getLimit', 'after' => 'getAfter', - 'sorts' => 'getSorts', + 'filter_groups' => 'getFilterGroups', + 'limit' => 'getLimit', 'properties' => 'getProperties', - 'filter_groups' => 'getFilterGroups' + 'query' => 'getQuery', + 'sorts' => 'getSorts' ]; /** @@ -274,12 +275,12 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('query', $data ?? [], null); - $this->setIfExists('limit', $data ?? [], null); $this->setIfExists('after', $data ?? [], null); - $this->setIfExists('sorts', $data ?? [], null); - $this->setIfExists('properties', $data ?? [], null); $this->setIfExists('filter_groups', $data ?? [], null); + $this->setIfExists('limit', $data ?? [], null); + $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('query', $data ?? [], null); + $this->setIfExists('sorts', $data ?? [], null); } /** @@ -325,174 +326,174 @@ public function valid() /** - * Gets query + * Gets after * * @return string|null */ - public function getQuery() + public function getAfter() { - return $this->container['query']; + return $this->container['after']; } /** - * Sets query + * Sets after * - * @param string|null $query query + * @param string|null $after A paging cursor token for retrieving subsequent pages. * * @return self */ - public function setQuery($query) + public function setAfter($after) { - if (is_null($query)) { - throw new \InvalidArgumentException('non-nullable query cannot be null'); + if (is_null($after)) { + throw new \InvalidArgumentException('non-nullable after cannot be null'); } - $this->container['query'] = $query; + $this->container['after'] = $after; return $this; } /** - * Gets limit + * Gets filter_groups * - * @return int|null + * @return \HubSpot\Client\Crm\Objects\Emails\Model\FilterGroup[]|null */ - public function getLimit() + public function getFilterGroups() { - return $this->container['limit']; + return $this->container['filter_groups']; } /** - * Sets limit + * Sets filter_groups * - * @param int|null $limit limit + * @param \HubSpot\Client\Crm\Objects\Emails\Model\FilterGroup[]|null $filter_groups Up to 6 groups of filters defining additional query criteria. * * @return self */ - public function setLimit($limit) + public function setFilterGroups($filter_groups) { - if (is_null($limit)) { - throw new \InvalidArgumentException('non-nullable limit cannot be null'); + if (is_null($filter_groups)) { + throw new \InvalidArgumentException('non-nullable filter_groups cannot be null'); } - $this->container['limit'] = $limit; + $this->container['filter_groups'] = $filter_groups; return $this; } /** - * Gets after + * Gets limit * - * @return string|null + * @return int|null */ - public function getAfter() + public function getLimit() { - return $this->container['after']; + return $this->container['limit']; } /** - * Sets after + * Sets limit * - * @param string|null $after after + * @param int|null $limit The maximum results to return, up to 200 objects. * * @return self */ - public function setAfter($after) + public function setLimit($limit) { - if (is_null($after)) { - throw new \InvalidArgumentException('non-nullable after cannot be null'); + if (is_null($limit)) { + throw new \InvalidArgumentException('non-nullable limit cannot be null'); } - $this->container['after'] = $after; + $this->container['limit'] = $limit; return $this; } /** - * Gets sorts + * Gets properties * * @return string[]|null */ - public function getSorts() + public function getProperties() { - return $this->container['sorts']; + return $this->container['properties']; } /** - * Sets sorts + * Sets properties * - * @param string[]|null $sorts sorts + * @param string[]|null $properties A list of property names to include in the response. * * @return self */ - public function setSorts($sorts) + public function setProperties($properties) { - if (is_null($sorts)) { - throw new \InvalidArgumentException('non-nullable sorts cannot be null'); + if (is_null($properties)) { + throw new \InvalidArgumentException('non-nullable properties cannot be null'); } - $this->container['sorts'] = $sorts; + $this->container['properties'] = $properties; return $this; } /** - * Gets properties + * Gets query * - * @return string[]|null + * @return string|null */ - public function getProperties() + public function getQuery() { - return $this->container['properties']; + return $this->container['query']; } /** - * Sets properties + * Sets query * - * @param string[]|null $properties properties + * @param string|null $query The search query string, up to 3000 characters. * * @return self */ - public function setProperties($properties) + public function setQuery($query) { - if (is_null($properties)) { - throw new \InvalidArgumentException('non-nullable properties cannot be null'); + if (is_null($query)) { + throw new \InvalidArgumentException('non-nullable query cannot be null'); } - $this->container['properties'] = $properties; + $this->container['query'] = $query; return $this; } /** - * Gets filter_groups + * Gets sorts * - * @return \HubSpot\Client\Crm\Objects\Emails\Model\FilterGroup[]|null + * @return string[]|null */ - public function getFilterGroups() + public function getSorts() { - return $this->container['filter_groups']; + return $this->container['sorts']; } /** - * Sets filter_groups + * Sets sorts * - * @param \HubSpot\Client\Crm\Objects\Emails\Model\FilterGroup[]|null $filter_groups filter_groups + * @param string[]|null $sorts Specifies sorting order based on object properties. * * @return self */ - public function setFilterGroups($filter_groups) + public function setSorts($sorts) { - if (is_null($filter_groups)) { - throw new \InvalidArgumentException('non-nullable filter_groups cannot be null'); + if (is_null($sorts)) { + throw new \InvalidArgumentException('non-nullable sorts cannot be null'); } - $this->container['filter_groups'] = $filter_groups; + $this->container['sorts'] = $sorts; return $this; } /** * 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]); } @@ -500,12 +501,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; } @@ -530,11 +531,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/Objects/Emails/Model/SimplePublicObject.php b/codegen/Crm/Objects/Emails/Model/SimplePublicObject.php index 9105a08b..6744086a 100644 --- a/codegen/Crm/Objects/Emails/Model/SimplePublicObject.php +++ b/codegen/Crm/Objects/Emails/Model/SimplePublicObject.php @@ -2,7 +2,7 @@ /** * SimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObject Class Doc Comment * * @category Class + * @description A simple public object. * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,13 +58,13 @@ class SimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'created_at' => '\DateTime', 'archived' => 'bool', 'archived_at' => '\DateTime', - 'properties_with_history' => 'array', + 'created_at' => '\DateTime', 'id' => 'string', 'object_write_trace_id' => 'string', 'properties' => 'array', + 'properties_with_history' => 'array', 'updated_at' => '\DateTime' ]; @@ -75,13 +76,13 @@ class SimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ - 'created_at' => 'date-time', 'archived' => null, 'archived_at' => 'date-time', - 'properties_with_history' => null, + 'created_at' => 'date-time', 'id' => null, 'object_write_trace_id' => null, 'properties' => null, + 'properties_with_history' => null, 'updated_at' => 'date-time' ]; @@ -91,13 +92,13 @@ class SimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializab * @var boolean[] */ protected static array $openAPINullables = [ - 'created_at' => false, 'archived' => false, 'archived_at' => false, - 'properties_with_history' => false, + 'created_at' => false, 'id' => false, 'object_write_trace_id' => false, 'properties' => false, + 'properties_with_history' => false, 'updated_at' => false ]; @@ -187,13 +188,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'created_at' => 'createdAt', 'archived' => 'archived', 'archived_at' => 'archivedAt', - 'properties_with_history' => 'propertiesWithHistory', + 'created_at' => 'createdAt', 'id' => 'id', 'object_write_trace_id' => 'objectWriteTraceId', 'properties' => 'properties', + 'properties_with_history' => 'propertiesWithHistory', 'updated_at' => 'updatedAt' ]; @@ -203,13 +204,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'created_at' => 'setCreatedAt', 'archived' => 'setArchived', 'archived_at' => 'setArchivedAt', - 'properties_with_history' => 'setPropertiesWithHistory', + 'created_at' => 'setCreatedAt', 'id' => 'setId', 'object_write_trace_id' => 'setObjectWriteTraceId', 'properties' => 'setProperties', + 'properties_with_history' => 'setPropertiesWithHistory', 'updated_at' => 'setUpdatedAt' ]; @@ -219,13 +220,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'created_at' => 'getCreatedAt', 'archived' => 'getArchived', 'archived_at' => 'getArchivedAt', - 'properties_with_history' => 'getPropertiesWithHistory', + 'created_at' => 'getCreatedAt', 'id' => 'getId', 'object_write_trace_id' => 'getObjectWriteTraceId', 'properties' => 'getProperties', + 'properties_with_history' => 'getPropertiesWithHistory', 'updated_at' => 'getUpdatedAt' ]; @@ -286,13 +287,13 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('archived', $data ?? [], null); $this->setIfExists('archived_at', $data ?? [], null); - $this->setIfExists('properties_with_history', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('properties_with_history', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); } @@ -323,6 +324,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['archived'] === null) { + $invalidProperties[] = "'archived' can't be null"; + } if ($this->container['created_at'] === null) { $invalidProperties[] = "'created_at' can't be null"; } @@ -350,37 +354,10 @@ public function valid() } - /** - * Gets created_at - * - * @return \DateTime - */ - public function getCreatedAt() - { - return $this->container['created_at']; - } - - /** - * Sets created_at - * - * @param \DateTime $created_at created_at - * - * @return self - */ - public function setCreatedAt($created_at) - { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); - } - $this->container['created_at'] = $created_at; - - return $this; - } - /** * Gets archived * - * @return bool|null + * @return bool */ public function getArchived() { @@ -390,7 +367,7 @@ public function getArchived() /** * Sets archived * - * @param bool|null $archived archived + * @param bool $archived Whether the object is archived. * * @return self */ @@ -417,7 +394,7 @@ public function getArchivedAt() /** * Sets archived_at * - * @param \DateTime|null $archived_at archived_at + * @param \DateTime|null $archived_at The timestamp when the object was archived, in ISO 8601 format. * * @return self */ @@ -432,28 +409,28 @@ public function setArchivedAt($archived_at) } /** - * Gets properties_with_history + * Gets created_at * - * @return array|null + * @return \DateTime */ - public function getPropertiesWithHistory() + public function getCreatedAt() { - return $this->container['properties_with_history']; + return $this->container['created_at']; } /** - * Sets properties_with_history + * Sets created_at * - * @param array|null $properties_with_history properties_with_history + * @param \DateTime $created_at The timestamp when the object was created, in ISO 8601 format. * * @return self */ - public function setPropertiesWithHistory($properties_with_history) + public function setCreatedAt($created_at) { - if (is_null($properties_with_history)) { - throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['properties_with_history'] = $properties_with_history; + $this->container['created_at'] = $created_at; return $this; } @@ -471,7 +448,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -498,7 +475,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id An identifier used for tracing the write request for the object. * * @return self */ @@ -525,7 +502,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key-value pairs representing the properties of the object. * * @return self */ @@ -539,6 +516,33 @@ public function setProperties($properties) return $this; } + /** + * Gets properties_with_history + * + * @return array|null + */ + public function getPropertiesWithHistory() + { + return $this->container['properties_with_history']; + } + + /** + * Sets properties_with_history + * + * @param array|null $properties_with_history Key-value pairs representing the properties of the object along with their history. + * + * @return self + */ + public function setPropertiesWithHistory($properties_with_history) + { + if (is_null($properties_with_history)) { + throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + } + $this->container['properties_with_history'] = $properties_with_history; + + return $this; + } + /** * Gets updated_at * @@ -552,7 +556,7 @@ public function getUpdatedAt() /** * Sets updated_at * - * @param \DateTime $updated_at updated_at + * @param \DateTime $updated_at The timestamp when the object was last updated, in ISO 8601 format. * * @return self */ @@ -568,11 +572,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]); } @@ -580,12 +584,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; } @@ -610,11 +614,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/Objects/Emails/Model/SimplePublicObjectBatchInput.php b/codegen/Crm/Objects/Emails/Model/SimplePublicObjectBatchInput.php index e81759b5..64a91907 100644 --- a/codegen/Crm/Objects/Emails/Model/SimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/Emails/Model/SimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectBatchInput Class Doc Comment * * @category Class + * @description Contains an array of CRM object records to be processed in a batch operation, each defined by their ID and properties. * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,9 +58,9 @@ class SimplePublicObjectBatchInput implements ModelInterface, ArrayAccess, \Json * @var string[] */ protected static $openAPITypes = [ + 'id' => 'string', 'id_property' => 'string', 'object_write_trace_id' => 'string', - 'id' => 'string', 'properties' => 'array' ]; @@ -71,9 +72,9 @@ class SimplePublicObjectBatchInput implements ModelInterface, ArrayAccess, \Json * @psalm-var array */ protected static $openAPIFormats = [ + 'id' => null, 'id_property' => null, 'object_write_trace_id' => null, - 'id' => null, 'properties' => null ]; @@ -83,9 +84,9 @@ class SimplePublicObjectBatchInput implements ModelInterface, ArrayAccess, \Json * @var boolean[] */ protected static array $openAPINullables = [ + 'id' => false, 'id_property' => false, 'object_write_trace_id' => false, - 'id' => false, 'properties' => false ]; @@ -175,9 +176,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'id' => 'id', 'id_property' => 'idProperty', 'object_write_trace_id' => 'objectWriteTraceId', - 'id' => 'id', 'properties' => 'properties' ]; @@ -187,9 +188,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'id' => 'setId', 'id_property' => 'setIdProperty', 'object_write_trace_id' => 'setObjectWriteTraceId', - 'id' => 'setId', 'properties' => 'setProperties' ]; @@ -199,9 +200,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'id' => 'getId', 'id_property' => 'getIdProperty', 'object_write_trace_id' => 'getObjectWriteTraceId', - 'id' => 'getId', 'properties' => 'getProperties' ]; @@ -262,9 +263,9 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('id', $data ?? [], null); $this->setIfExists('id_property', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); - $this->setIfExists('id', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); } @@ -316,6 +317,33 @@ public function valid() } + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The id to be updated. This can be the object id, or the unique property value of the idProperty property + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** * Gets id_property * @@ -356,7 +384,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id A unique identifier for tracing the request. * * @return self */ @@ -370,33 +398,6 @@ public function setObjectWriteTraceId($object_write_trace_id) return $this; } - /** - * Gets id - * - * @return string - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param string $id The id to be updated. This can be the object id, or the unique property value of the idProperty property - * - * @return self - */ - public function setId($id) - { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); - } - $this->container['id'] = $id; - - return $this; - } - /** * Gets properties * @@ -410,7 +411,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key-value pairs representing the properties of the object. * * @return self */ @@ -426,11 +427,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]); } @@ -438,12 +439,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; } @@ -468,11 +469,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/Objects/Emails/Model/SimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/Emails/Model/SimplePublicObjectBatchInputForCreate.php index 34b4bd2e..a2ed6430 100644 --- a/codegen/Crm/Objects/Emails/Model/SimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/Emails/Model/SimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectBatchInputForCreate Class Doc Comment * * @category Class + * @description An input object that contains a collection of objects to be created together in a batch. * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -346,7 +347,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id An identifier used for tracing the creation or update request of the object. * * @return self */ @@ -373,7 +374,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key value pairs representing the properties of the object. * * @return self */ @@ -389,11 +390,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]); } @@ -401,12 +402,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 +432,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/Objects/Emails/Model/SimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/Emails/Model/SimplePublicObjectBatchInputUpsert.php index 0a899f06..f3c93f1e 100644 --- a/codegen/Crm/Objects/Emails/Model/SimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Objects/Emails/Model/SimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectBatchInputUpsert Class Doc Comment * * @category Class + * @description Represents an object used in batch upsert operations, containing an object’s unique identifier, its properties, and optionally the unique property name and a write trace ID. * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,9 +58,9 @@ class SimplePublicObjectBatchInputUpsert implements ModelInterface, ArrayAccess, * @var string[] */ protected static $openAPITypes = [ + 'id' => 'string', 'id_property' => 'string', 'object_write_trace_id' => 'string', - 'id' => 'string', 'properties' => 'array' ]; @@ -71,9 +72,9 @@ class SimplePublicObjectBatchInputUpsert implements ModelInterface, ArrayAccess, * @psalm-var array */ protected static $openAPIFormats = [ + 'id' => null, 'id_property' => null, 'object_write_trace_id' => null, - 'id' => null, 'properties' => null ]; @@ -83,9 +84,9 @@ class SimplePublicObjectBatchInputUpsert implements ModelInterface, ArrayAccess, * @var boolean[] */ protected static array $openAPINullables = [ + 'id' => false, 'id_property' => false, 'object_write_trace_id' => false, - 'id' => false, 'properties' => false ]; @@ -175,9 +176,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'id' => 'id', 'id_property' => 'idProperty', 'object_write_trace_id' => 'objectWriteTraceId', - 'id' => 'id', 'properties' => 'properties' ]; @@ -187,9 +188,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'id' => 'setId', 'id_property' => 'setIdProperty', 'object_write_trace_id' => 'setObjectWriteTraceId', - 'id' => 'setId', 'properties' => 'setProperties' ]; @@ -199,9 +200,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'id' => 'getId', 'id_property' => 'getIdProperty', 'object_write_trace_id' => 'getObjectWriteTraceId', - 'id' => 'getId', 'properties' => 'getProperties' ]; @@ -262,9 +263,9 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('id', $data ?? [], null); $this->setIfExists('id_property', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); - $this->setIfExists('id', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); } @@ -316,6 +317,33 @@ public function valid() } + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique ID of the object. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** * Gets id_property * @@ -356,7 +384,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id An identifier for tracing the creation request. * * @return self */ @@ -370,33 +398,6 @@ public function setObjectWriteTraceId($object_write_trace_id) return $this; } - /** - * Gets id - * - * @return string - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param string $id id - * - * @return self - */ - public function setId($id) - { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); - } - $this->container['id'] = $id; - - return $this; - } - /** * Gets properties * @@ -410,7 +411,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key value pairs representing the properties of the object. * * @return self */ @@ -426,11 +427,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]); } @@ -438,12 +439,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; } @@ -468,11 +469,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/Objects/Emails/Model/SimplePublicObjectId.php b/codegen/Crm/Objects/Emails/Model/SimplePublicObjectId.php index bad0cda1..f3fe34fa 100644 --- a/codegen/Crm/Objects/Emails/Model/SimplePublicObjectId.php +++ b/codegen/Crm/Objects/Emails/Model/SimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectId Class Doc Comment * * @category Class + * @description Contains the Id of a Public Object * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -305,7 +306,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -321,11 +322,11 @@ public function setId($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]); } @@ -333,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; } @@ -363,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/Objects/Emails/Model/SimplePublicObjectInput.php b/codegen/Crm/Objects/Emails/Model/SimplePublicObjectInput.php index d3b5f710..e91142e7 100644 --- a/codegen/Crm/Objects/Emails/Model/SimplePublicObjectInput.php +++ b/codegen/Crm/Objects/Emails/Model/SimplePublicObjectInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectInput Class Doc Comment * * @category Class + * @description Represents the input required to create or update a CRM object, containing an object with property names and their corresponding values. * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -305,7 +306,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key value pairs representing the properties of the object. * * @return self */ @@ -321,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]); } @@ -333,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; } @@ -363,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/Objects/Emails/Model/SimplePublicObjectInputForCreate.php b/codegen/Crm/Objects/Emails/Model/SimplePublicObjectInputForCreate.php index 8ee767c8..422dfcce 100644 --- a/codegen/Crm/Objects/Emails/Model/SimplePublicObjectInputForCreate.php +++ b/codegen/Crm/Objects/Emails/Model/SimplePublicObjectInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectInputForCreate Class Doc Comment * * @category Class + * @description Is the input object used to create a new CRM object, containing the properties to be set and optional associations to link the new record with other CRM objects. * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -339,7 +340,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key-value pairs for setting properties for the new object. * * @return self */ @@ -355,11 +356,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]); } @@ -367,12 +368,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; } @@ -397,11 +398,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/Objects/Emails/Model/SimplePublicObjectWithAssociations.php b/codegen/Crm/Objects/Emails/Model/SimplePublicObjectWithAssociations.php index 5f9b03af..183c081b 100644 --- a/codegen/Crm/Objects/Emails/Model/SimplePublicObjectWithAssociations.php +++ b/codegen/Crm/Objects/Emails/Model/SimplePublicObjectWithAssociations.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectWithAssociations * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectWithAssociations Class Doc Comment * * @category Class + * @description Represents a CRM object along with its properties, timestamps, and a set of associated object IDs grouped by association type. * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,14 +58,14 @@ class SimplePublicObjectWithAssociations implements ModelInterface, ArrayAccess, * @var string[] */ protected static $openAPITypes = [ - 'associations' => 'array', - 'created_at' => '\DateTime', 'archived' => 'bool', 'archived_at' => '\DateTime', - 'properties_with_history' => 'array', + 'associations' => 'array', + 'created_at' => '\DateTime', 'id' => 'string', 'object_write_trace_id' => 'string', 'properties' => 'array', + 'properties_with_history' => 'array', 'updated_at' => '\DateTime' ]; @@ -76,14 +77,14 @@ class SimplePublicObjectWithAssociations implements ModelInterface, ArrayAccess, * @psalm-var array */ protected static $openAPIFormats = [ - 'associations' => null, - 'created_at' => 'date-time', 'archived' => null, 'archived_at' => 'date-time', - 'properties_with_history' => null, + 'associations' => null, + 'created_at' => 'date-time', 'id' => null, 'object_write_trace_id' => null, 'properties' => null, + 'properties_with_history' => null, 'updated_at' => 'date-time' ]; @@ -93,14 +94,14 @@ class SimplePublicObjectWithAssociations implements ModelInterface, ArrayAccess, * @var boolean[] */ protected static array $openAPINullables = [ - 'associations' => false, - 'created_at' => false, 'archived' => false, 'archived_at' => false, - 'properties_with_history' => false, + 'associations' => false, + 'created_at' => false, 'id' => false, 'object_write_trace_id' => false, 'properties' => false, + 'properties_with_history' => false, 'updated_at' => false ]; @@ -190,14 +191,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'associations' => 'associations', - 'created_at' => 'createdAt', 'archived' => 'archived', 'archived_at' => 'archivedAt', - 'properties_with_history' => 'propertiesWithHistory', + 'associations' => 'associations', + 'created_at' => 'createdAt', 'id' => 'id', 'object_write_trace_id' => 'objectWriteTraceId', 'properties' => 'properties', + 'properties_with_history' => 'propertiesWithHistory', 'updated_at' => 'updatedAt' ]; @@ -207,14 +208,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'associations' => 'setAssociations', - 'created_at' => 'setCreatedAt', 'archived' => 'setArchived', 'archived_at' => 'setArchivedAt', - 'properties_with_history' => 'setPropertiesWithHistory', + 'associations' => 'setAssociations', + 'created_at' => 'setCreatedAt', 'id' => 'setId', 'object_write_trace_id' => 'setObjectWriteTraceId', 'properties' => 'setProperties', + 'properties_with_history' => 'setPropertiesWithHistory', 'updated_at' => 'setUpdatedAt' ]; @@ -224,14 +225,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'associations' => 'getAssociations', - 'created_at' => 'getCreatedAt', 'archived' => 'getArchived', 'archived_at' => 'getArchivedAt', - 'properties_with_history' => 'getPropertiesWithHistory', + 'associations' => 'getAssociations', + 'created_at' => 'getCreatedAt', 'id' => 'getId', 'object_write_trace_id' => 'getObjectWriteTraceId', 'properties' => 'getProperties', + 'properties_with_history' => 'getPropertiesWithHistory', 'updated_at' => 'getUpdatedAt' ]; @@ -292,14 +293,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('associations', $data ?? [], null); - $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('archived', $data ?? [], null); $this->setIfExists('archived_at', $data ?? [], null); - $this->setIfExists('properties_with_history', $data ?? [], null); + $this->setIfExists('associations', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('properties_with_history', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); } @@ -330,6 +331,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['archived'] === null) { + $invalidProperties[] = "'archived' can't be null"; + } if ($this->container['created_at'] === null) { $invalidProperties[] = "'created_at' can't be null"; } @@ -357,64 +361,10 @@ public function valid() } - /** - * Gets associations - * - * @return array|null - */ - public function getAssociations() - { - return $this->container['associations']; - } - - /** - * Sets associations - * - * @param array|null $associations associations - * - * @return self - */ - public function setAssociations($associations) - { - if (is_null($associations)) { - throw new \InvalidArgumentException('non-nullable associations cannot be null'); - } - $this->container['associations'] = $associations; - - return $this; - } - - /** - * Gets created_at - * - * @return \DateTime - */ - public function getCreatedAt() - { - return $this->container['created_at']; - } - - /** - * Sets created_at - * - * @param \DateTime $created_at created_at - * - * @return self - */ - public function setCreatedAt($created_at) - { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); - } - $this->container['created_at'] = $created_at; - - return $this; - } - /** * Gets archived * - * @return bool|null + * @return bool */ public function getArchived() { @@ -424,7 +374,7 @@ public function getArchived() /** * Sets archived * - * @param bool|null $archived archived + * @param bool $archived Whether the object is archived. * * @return self */ @@ -451,7 +401,7 @@ public function getArchivedAt() /** * Sets archived_at * - * @param \DateTime|null $archived_at archived_at + * @param \DateTime|null $archived_at The timestamp when the object was archived, in ISO 8601 format. * * @return self */ @@ -466,28 +416,55 @@ public function setArchivedAt($archived_at) } /** - * Gets properties_with_history + * Gets associations * - * @return array|null + * @return array|null */ - public function getPropertiesWithHistory() + public function getAssociations() { - return $this->container['properties_with_history']; + return $this->container['associations']; } /** - * Sets properties_with_history + * Sets associations * - * @param array|null $properties_with_history properties_with_history + * @param array|null $associations A list defining relationships with other objects. * * @return self */ - public function setPropertiesWithHistory($properties_with_history) + public function setAssociations($associations) { - if (is_null($properties_with_history)) { - throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + if (is_null($associations)) { + throw new \InvalidArgumentException('non-nullable associations cannot be null'); } - $this->container['properties_with_history'] = $properties_with_history; + $this->container['associations'] = $associations; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime $created_at The timestamp when the object was created, in ISO 8601 format. + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; return $this; } @@ -505,7 +482,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -532,7 +509,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id An identifier used for tracing the creation or update request of the object. * * @return self */ @@ -559,7 +536,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key value pairs representing the properties of the object. * * @return self */ @@ -573,6 +550,33 @@ public function setProperties($properties) return $this; } + /** + * Gets properties_with_history + * + * @return array|null + */ + public function getPropertiesWithHistory() + { + return $this->container['properties_with_history']; + } + + /** + * Sets properties_with_history + * + * @param array|null $properties_with_history Key-value pairs representing the properties of the object along with their history. + * + * @return self + */ + public function setPropertiesWithHistory($properties_with_history) + { + if (is_null($properties_with_history)) { + throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + } + $this->container['properties_with_history'] = $properties_with_history; + + return $this; + } + /** * Gets updated_at * @@ -586,7 +590,7 @@ public function getUpdatedAt() /** * Sets updated_at * - * @param \DateTime $updated_at updated_at + * @param \DateTime $updated_at The timestamp when the object was last updated, in ISO 8601 format. * * @return self */ @@ -602,11 +606,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]); } @@ -614,12 +618,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; } @@ -644,11 +648,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/Objects/Emails/Model/SimplePublicUpsertObject.php b/codegen/Crm/Objects/Emails/Model/SimplePublicUpsertObject.php index ea4dd8e2..42215a3c 100644 --- a/codegen/Crm/Objects/Emails/Model/SimplePublicUpsertObject.php +++ b/codegen/Crm/Objects/Emails/Model/SimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * SimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicUpsertObject Class Doc Comment * * @category Class + * @description Represents a CRM object that has either been created or updated (upserted) * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,14 +58,14 @@ class SimplePublicUpsertObject implements ModelInterface, ArrayAccess, \JsonSeri * @var string[] */ protected static $openAPITypes = [ - 'created_at' => '\DateTime', 'archived' => 'bool', 'archived_at' => '\DateTime', - 'new' => 'bool', - 'properties_with_history' => 'array', + 'created_at' => '\DateTime', 'id' => 'string', + 'new' => 'bool', 'object_write_trace_id' => 'string', 'properties' => 'array', + 'properties_with_history' => 'array', 'updated_at' => '\DateTime' ]; @@ -76,14 +77,14 @@ class SimplePublicUpsertObject implements ModelInterface, ArrayAccess, \JsonSeri * @psalm-var array */ protected static $openAPIFormats = [ - 'created_at' => 'date-time', 'archived' => null, 'archived_at' => 'date-time', - 'new' => null, - 'properties_with_history' => null, + 'created_at' => 'date-time', 'id' => null, + 'new' => null, 'object_write_trace_id' => null, 'properties' => null, + 'properties_with_history' => null, 'updated_at' => 'date-time' ]; @@ -93,14 +94,14 @@ class SimplePublicUpsertObject implements ModelInterface, ArrayAccess, \JsonSeri * @var boolean[] */ protected static array $openAPINullables = [ - 'created_at' => false, 'archived' => false, 'archived_at' => false, - 'new' => false, - 'properties_with_history' => false, + 'created_at' => false, 'id' => false, + 'new' => false, 'object_write_trace_id' => false, 'properties' => false, + 'properties_with_history' => false, 'updated_at' => false ]; @@ -190,14 +191,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'created_at' => 'createdAt', 'archived' => 'archived', 'archived_at' => 'archivedAt', - 'new' => 'new', - 'properties_with_history' => 'propertiesWithHistory', + 'created_at' => 'createdAt', 'id' => 'id', + 'new' => 'new', 'object_write_trace_id' => 'objectWriteTraceId', 'properties' => 'properties', + 'properties_with_history' => 'propertiesWithHistory', 'updated_at' => 'updatedAt' ]; @@ -207,14 +208,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'created_at' => 'setCreatedAt', 'archived' => 'setArchived', 'archived_at' => 'setArchivedAt', - 'new' => 'setNew', - 'properties_with_history' => 'setPropertiesWithHistory', + 'created_at' => 'setCreatedAt', 'id' => 'setId', + 'new' => 'setNew', 'object_write_trace_id' => 'setObjectWriteTraceId', 'properties' => 'setProperties', + 'properties_with_history' => 'setPropertiesWithHistory', 'updated_at' => 'setUpdatedAt' ]; @@ -224,14 +225,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'created_at' => 'getCreatedAt', 'archived' => 'getArchived', 'archived_at' => 'getArchivedAt', - 'new' => 'getNew', - 'properties_with_history' => 'getPropertiesWithHistory', + 'created_at' => 'getCreatedAt', 'id' => 'getId', + 'new' => 'getNew', 'object_write_trace_id' => 'getObjectWriteTraceId', 'properties' => 'getProperties', + 'properties_with_history' => 'getPropertiesWithHistory', 'updated_at' => 'getUpdatedAt' ]; @@ -292,14 +293,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('archived', $data ?? [], null); $this->setIfExists('archived_at', $data ?? [], null); - $this->setIfExists('new', $data ?? [], null); - $this->setIfExists('properties_with_history', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('new', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('properties_with_history', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); } @@ -330,15 +331,18 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['archived'] === null) { + $invalidProperties[] = "'archived' can't be null"; + } if ($this->container['created_at'] === null) { $invalidProperties[] = "'created_at' can't be null"; } - if ($this->container['new'] === null) { - $invalidProperties[] = "'new' can't be null"; - } if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } + if ($this->container['new'] === null) { + $invalidProperties[] = "'new' can't be null"; + } if ($this->container['properties'] === null) { $invalidProperties[] = "'properties' can't be null"; } @@ -360,37 +364,10 @@ public function valid() } - /** - * Gets created_at - * - * @return \DateTime - */ - public function getCreatedAt() - { - return $this->container['created_at']; - } - - /** - * Sets created_at - * - * @param \DateTime $created_at created_at - * - * @return self - */ - public function setCreatedAt($created_at) - { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); - } - $this->container['created_at'] = $created_at; - - return $this; - } - /** * Gets archived * - * @return bool|null + * @return bool */ public function getArchived() { @@ -400,7 +377,7 @@ public function getArchived() /** * Sets archived * - * @param bool|null $archived archived + * @param bool $archived Whether the object is archived. * * @return self */ @@ -427,7 +404,7 @@ public function getArchivedAt() /** * Sets archived_at * - * @param \DateTime|null $archived_at archived_at + * @param \DateTime|null $archived_at The timestamp when the object was archived, in ISO 8601 format. * * @return self */ @@ -442,82 +419,82 @@ public function setArchivedAt($archived_at) } /** - * Gets new + * Gets created_at * - * @return bool + * @return \DateTime */ - public function getNew() + public function getCreatedAt() { - return $this->container['new']; + return $this->container['created_at']; } /** - * Sets new + * Sets created_at * - * @param bool $new new + * @param \DateTime $created_at The timestamp when the object was created, in ISO 8601 format. * * @return self */ - public function setNew($new) + public function setCreatedAt($created_at) { - if (is_null($new)) { - throw new \InvalidArgumentException('non-nullable new cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['new'] = $new; + $this->container['created_at'] = $created_at; return $this; } /** - * Gets properties_with_history + * Gets id * - * @return array|null + * @return string */ - public function getPropertiesWithHistory() + public function getId() { - return $this->container['properties_with_history']; + return $this->container['id']; } /** - * Sets properties_with_history + * Sets id * - * @param array|null $properties_with_history properties_with_history + * @param string $id The unique ID of the object. * * @return self */ - public function setPropertiesWithHistory($properties_with_history) + public function setId($id) { - if (is_null($properties_with_history)) { - throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['properties_with_history'] = $properties_with_history; + $this->container['id'] = $id; return $this; } /** - * Gets id + * Gets new * - * @return string + * @return bool */ - public function getId() + public function getNew() { - return $this->container['id']; + return $this->container['new']; } /** - * Sets id + * Sets new * - * @param string $id id + * @param bool $new Whether the property is new. * * @return self */ - public function setId($id) + public function setNew($new) { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + if (is_null($new)) { + throw new \InvalidArgumentException('non-nullable new cannot be null'); } - $this->container['id'] = $id; + $this->container['new'] = $new; return $this; } @@ -535,7 +512,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id An identifier used for tracing the write request for the object. * * @return self */ @@ -562,7 +539,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key value pairs representing the properties of the object. * * @return self */ @@ -576,6 +553,33 @@ public function setProperties($properties) return $this; } + /** + * Gets properties_with_history + * + * @return array|null + */ + public function getPropertiesWithHistory() + { + return $this->container['properties_with_history']; + } + + /** + * Sets properties_with_history + * + * @param array|null $properties_with_history Key-value pairs representing the properties of the object along with their history. + * + * @return self + */ + public function setPropertiesWithHistory($properties_with_history) + { + if (is_null($properties_with_history)) { + throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + } + $this->container['properties_with_history'] = $properties_with_history; + + return $this; + } + /** * Gets updated_at * @@ -589,7 +593,7 @@ public function getUpdatedAt() /** * Sets updated_at * - * @param \DateTime $updated_at updated_at + * @param \DateTime $updated_at The timestamp when the object was last updated, in ISO 8601 format. * * @return self */ @@ -605,11 +609,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]); } @@ -617,12 +621,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; } @@ -647,11 +651,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/Objects/Emails/Model/StandardError.php b/codegen/Crm/Objects/Emails/Model/StandardError.php index 1579aa2e..143c7b96 100644 --- a/codegen/Crm/Objects/Emails/Model/StandardError.php +++ b/codegen/Crm/Objects/Emails/Model/StandardError.php @@ -2,7 +2,7 @@ /** * StandardError * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * StandardError Class Doc Comment * * @category Class + * @description Ye olde error * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,14 +58,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'object', + 'category' => 'string', 'context' => 'array', - 'links' => 'array', + 'errors' => '\HubSpot\Client\Crm\Objects\Emails\Model\ErrorDetail[]', 'id' => 'string', - 'category' => 'string', + 'links' => 'array', 'message' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\Emails\Model\ErrorDetail[]', - 'status' => 'string' + 'status' => 'string', + 'sub_category' => 'object' ]; /** @@ -75,14 +76,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, + 'category' => null, 'context' => null, - 'links' => null, + 'errors' => null, 'id' => null, - 'category' => null, + 'links' => null, 'message' => null, - 'errors' => null, - 'status' => null + 'status' => null, + 'sub_category' => null ]; /** @@ -91,14 +92,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, + 'category' => false, 'context' => false, - 'links' => false, + 'errors' => false, 'id' => false, - 'category' => false, + 'links' => false, 'message' => false, - 'errors' => false, - 'status' => false + 'status' => false, + 'sub_category' => false ]; /** @@ -187,14 +188,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', + 'category' => 'category', 'context' => 'context', - 'links' => 'links', + 'errors' => 'errors', 'id' => 'id', - 'category' => 'category', + 'links' => 'links', 'message' => 'message', - 'errors' => 'errors', - 'status' => 'status' + 'status' => 'status', + 'sub_category' => 'subCategory' ]; /** @@ -203,14 +204,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', + 'category' => 'setCategory', 'context' => 'setContext', - 'links' => 'setLinks', + 'errors' => 'setErrors', 'id' => 'setId', - 'category' => 'setCategory', + 'links' => 'setLinks', 'message' => 'setMessage', - 'errors' => 'setErrors', - 'status' => 'setStatus' + 'status' => 'setStatus', + 'sub_category' => 'setSubCategory' ]; /** @@ -219,14 +220,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', + 'category' => 'getCategory', 'context' => 'getContext', - 'links' => 'getLinks', + 'errors' => 'getErrors', 'id' => 'getId', - 'category' => 'getCategory', + 'links' => 'getLinks', 'message' => 'getMessage', - 'errors' => 'getErrors', - 'status' => 'getStatus' + 'status' => 'getStatus', + 'sub_category' => 'getSubCategory' ]; /** @@ -286,14 +287,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('links', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -323,21 +324,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['category'] === null) { + $invalidProperties[] = "'category' can't be null"; + } if ($this->container['context'] === null) { $invalidProperties[] = "'context' can't be null"; } + if ($this->container['errors'] === null) { + $invalidProperties[] = "'errors' can't be null"; + } if ($this->container['links'] === null) { $invalidProperties[] = "'links' can't be null"; } - if ($this->container['category'] === null) { - $invalidProperties[] = "'category' can't be null"; - } if ($this->container['message'] === null) { $invalidProperties[] = "'message' can't be null"; } - if ($this->container['errors'] === null) { - $invalidProperties[] = "'errors' can't be null"; - } if ($this->container['status'] === null) { $invalidProperties[] = "'status' can't be null"; } @@ -357,28 +358,28 @@ public function valid() /** - * Gets sub_category + * Gets category * - * @return object|null + * @return string */ - public function getSubCategory() + public function getCategory() { - return $this->container['sub_category']; + return $this->container['category']; } /** - * Sets sub_category + * Sets category * - * @param object|null $sub_category sub_category + * @param string $category The main category of the error. * * @return self */ - public function setSubCategory($sub_category) + public function setCategory($category) { - if (is_null($sub_category)) { - throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['sub_category'] = $sub_category; + $this->container['category'] = $category; return $this; } @@ -396,7 +397,7 @@ public function getContext() /** * Sets context * - * @param array $context context + * @param array $context Additional context-specific information related to the error. * * @return self */ @@ -411,28 +412,28 @@ public function setContext($context) } /** - * Gets links + * Gets errors * - * @return array + * @return \HubSpot\Client\Crm\Objects\Emails\Model\ErrorDetail[] */ - public function getLinks() + public function getErrors() { - return $this->container['links']; + return $this->container['errors']; } /** - * Sets links + * Sets errors * - * @param array $links links + * @param \HubSpot\Client\Crm\Objects\Emails\Model\ErrorDetail[] $errors The detailed error objects. * * @return self */ - public function setLinks($links) + public function setErrors($errors) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['links'] = $links; + $this->container['errors'] = $errors; return $this; } @@ -450,7 +451,7 @@ public function getId() /** * Sets id * - * @param string|null $id id + * @param string|null $id A unique ID for the error instance. * * @return self */ @@ -465,28 +466,28 @@ public function setId($id) } /** - * Gets category + * Gets links * - * @return string + * @return array */ - public function getCategory() + public function getLinks() { - return $this->container['category']; + return $this->container['links']; } /** - * Sets category + * Sets links * - * @param string $category category + * @param array $links URLs linking to documentation or resources associated with the error. * * @return self */ - public function setCategory($category) + public function setLinks($links) { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['category'] = $category; + $this->container['links'] = $links; return $this; } @@ -504,7 +505,7 @@ public function getMessage() /** * Sets message * - * @param string $message message + * @param string $message A human-readable string describing the error and possible remediation steps. * * @return self */ @@ -519,66 +520,66 @@ public function setMessage($message) } /** - * Gets errors + * Gets status * - * @return \HubSpot\Client\Crm\Objects\Emails\Model\ErrorDetail[] + * @return string */ - public function getErrors() + public function getStatus() { - return $this->container['errors']; + return $this->container['status']; } /** - * Sets errors + * Sets status * - * @param \HubSpot\Client\Crm\Objects\Emails\Model\ErrorDetail[] $errors errors + * @param string $status The HTTP status code associated with the error. * * @return self */ - public function setErrors($errors) + public function setStatus($status) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); } - $this->container['errors'] = $errors; + $this->container['status'] = $status; return $this; } /** - * Gets status + * Gets sub_category * - * @return string + * @return object|null */ - public function getStatus() + public function getSubCategory() { - return $this->container['status']; + return $this->container['sub_category']; } /** - * Sets status + * Sets sub_category * - * @param string $status status + * @param object|null $sub_category A more specific error category within each main category. * * @return self */ - public function setStatus($status) + public function setSubCategory($sub_category) { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['status'] = $status; + $this->container['sub_category'] = $sub_category; return $this; } /** * 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 +587,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 +617,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/Objects/Emails/Model/ValueWithTimestamp.php b/codegen/Crm/Objects/Emails/Model/ValueWithTimestamp.php index e1d8788a..3b30870c 100644 --- a/codegen/Crm/Objects/Emails/Model/ValueWithTimestamp.php +++ b/codegen/Crm/Objects/Emails/Model/ValueWithTimestamp.php @@ -2,7 +2,7 @@ /** * ValueWithTimestamp * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * ValueWithTimestamp Class Doc Comment * * @category Class + * @description Property model that includes timestamp. * @package HubSpot\Client\Crm\Objects\Emails * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,11 +59,11 @@ class ValueWithTimestamp implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPITypes = [ 'source_id' => 'string', - 'source_type' => 'string', 'source_label' => 'string', + 'source_type' => 'string', + 'timestamp' => '\DateTime', 'updated_by_user_id' => 'int', - 'value' => 'string', - 'timestamp' => '\DateTime' + 'value' => 'string' ]; /** @@ -74,11 +75,11 @@ class ValueWithTimestamp implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPIFormats = [ 'source_id' => null, - 'source_type' => null, 'source_label' => null, + 'source_type' => null, + 'timestamp' => 'date-time', 'updated_by_user_id' => 'int32', - 'value' => null, - 'timestamp' => 'date-time' + 'value' => null ]; /** @@ -88,11 +89,11 @@ class ValueWithTimestamp implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static array $openAPINullables = [ 'source_id' => false, - 'source_type' => false, 'source_label' => false, + 'source_type' => false, + 'timestamp' => false, 'updated_by_user_id' => false, - 'value' => false, - 'timestamp' => false + 'value' => false ]; /** @@ -182,11 +183,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'source_id' => 'sourceId', - 'source_type' => 'sourceType', 'source_label' => 'sourceLabel', + 'source_type' => 'sourceType', + 'timestamp' => 'timestamp', 'updated_by_user_id' => 'updatedByUserId', - 'value' => 'value', - 'timestamp' => 'timestamp' + 'value' => 'value' ]; /** @@ -196,11 +197,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'source_id' => 'setSourceId', - 'source_type' => 'setSourceType', 'source_label' => 'setSourceLabel', + 'source_type' => 'setSourceType', + 'timestamp' => 'setTimestamp', 'updated_by_user_id' => 'setUpdatedByUserId', - 'value' => 'setValue', - 'timestamp' => 'setTimestamp' + 'value' => 'setValue' ]; /** @@ -210,11 +211,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'source_id' => 'getSourceId', - 'source_type' => 'getSourceType', 'source_label' => 'getSourceLabel', + 'source_type' => 'getSourceType', + 'timestamp' => 'getTimestamp', 'updated_by_user_id' => 'getUpdatedByUserId', - 'value' => 'getValue', - 'timestamp' => 'getTimestamp' + 'value' => 'getValue' ]; /** @@ -275,11 +276,11 @@ public function getModelName() public function __construct(?array $data = null) { $this->setIfExists('source_id', $data ?? [], null); - $this->setIfExists('source_type', $data ?? [], null); $this->setIfExists('source_label', $data ?? [], null); + $this->setIfExists('source_type', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); $this->setIfExists('updated_by_user_id', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); - $this->setIfExists('timestamp', $data ?? [], null); } /** @@ -312,12 +313,12 @@ public function listInvalidProperties() if ($this->container['source_type'] === null) { $invalidProperties[] = "'source_type' can't be null"; } - if ($this->container['value'] === null) { - $invalidProperties[] = "'value' can't be null"; - } if ($this->container['timestamp'] === null) { $invalidProperties[] = "'timestamp' can't be null"; } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } return $invalidProperties; } @@ -346,7 +347,7 @@ public function getSourceId() /** * Sets source_id * - * @param string|null $source_id source_id + * @param string|null $source_id The unique ID of the property. * * @return self */ @@ -360,6 +361,33 @@ public function setSourceId($source_id) return $this; } + /** + * Gets source_label + * + * @return string|null + */ + public function getSourceLabel() + { + return $this->container['source_label']; + } + + /** + * Sets source_label + * + * @param string|null $source_label A human-readable label. + * + * @return self + */ + public function setSourceLabel($source_label) + { + if (is_null($source_label)) { + throw new \InvalidArgumentException('non-nullable source_label cannot be null'); + } + $this->container['source_label'] = $source_label; + + return $this; + } + /** * Gets source_type * @@ -373,7 +401,7 @@ public function getSourceType() /** * Sets source_type * - * @param string $source_type source_type + * @param string $source_type The property type. * * @return self */ @@ -388,28 +416,28 @@ public function setSourceType($source_type) } /** - * Gets source_label + * Gets timestamp * - * @return string|null + * @return \DateTime */ - public function getSourceLabel() + public function getTimestamp() { - return $this->container['source_label']; + return $this->container['timestamp']; } /** - * Sets source_label + * Sets timestamp * - * @param string|null $source_label source_label + * @param \DateTime $timestamp The timestamp when the property was updated, in ISO 8601 format. * * @return self */ - public function setSourceLabel($source_label) + public function setTimestamp($timestamp) { - if (is_null($source_label)) { - throw new \InvalidArgumentException('non-nullable source_label cannot be null'); + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); } - $this->container['source_label'] = $source_label; + $this->container['timestamp'] = $timestamp; return $this; } @@ -427,7 +455,7 @@ public function getUpdatedByUserId() /** * Sets updated_by_user_id * - * @param int|null $updated_by_user_id updated_by_user_id + * @param int|null $updated_by_user_id The ID of the user who last updated the property. * * @return self */ @@ -454,7 +482,7 @@ public function getValue() /** * Sets value * - * @param string $value value + * @param string $value The property value. * * @return self */ @@ -467,41 +495,14 @@ public function setValue($value) return $this; } - - /** - * Gets timestamp - * - * @return \DateTime - */ - public function getTimestamp() - { - return $this->container['timestamp']; - } - - /** - * Sets timestamp - * - * @param \DateTime $timestamp timestamp - * - * @return self - */ - public function setTimestamp($timestamp) - { - if (is_null($timestamp)) { - throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); - } - $this->container['timestamp'] = $timestamp; - - return $this; - } /** * 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]); } @@ -509,12 +510,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; } @@ -539,11 +540,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/Objects/Emails/ObjectSerializer.php b/codegen/Crm/Objects/Emails/ObjectSerializer.php index 717fe787..d307bf81 100644 --- a/codegen/Crm/Objects/Emails/ObjectSerializer.php +++ b/codegen/Crm/Objects/Emails/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Emails @@ -13,11 +13,11 @@ /** * Emails * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.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) : ''; } } From eb94f9dfe786bf29eac5ff7d9da732c98c729f9d Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Thu, 29 Jan 2026 16:53:03 +0300 Subject: [PATCH 4/4] Codegen: CRM FS --- .../FeedbackSubmissions/Api/BasicApi.php | 289 +++----- .../FeedbackSubmissions/Api/BatchApi.php | 202 ++--- .../FeedbackSubmissions/Api/SearchApi.php | 179 ++--- .../FeedbackSubmissions/ApiException.php | 6 +- .../FeedbackSubmissions/Configuration.php | 65 +- .../FeedbackSubmissions/FormDataProcessor.php | 246 +++++++ .../FeedbackSubmissions/HeaderSelector.php | 6 +- .../Model/AssociatedId.php | 23 +- .../BatchReadInputSimplePublicObjectId.php | 107 +-- .../Model/BatchResponseSimplePublicObject.php | 193 +++-- ...chResponseSimplePublicObjectWithErrors.php | 697 ------------------ .../Model/CollectionResponseAssociatedId.php | 18 +- ...nseSimplePublicObjectWithAssociations.php} | 32 +- ...onResponseWithTotalSimplePublicObject.php} | 119 +-- .../FeedbackSubmissions/Model/Error.php | 160 ++-- .../FeedbackSubmissions/Model/ErrorDetail.php | 136 ++-- .../FeedbackSubmissions/Model/Filter.php | 167 ++--- .../FeedbackSubmissions/Model/FilterGroup.php | 18 +- .../Model/ForwardPaging.php | 409 ---------- .../Model/ModelInterface.php | 6 +- .../FeedbackSubmissions/Model/NextPage.php | 85 +-- .../FeedbackSubmissions/Model/Paging.php | 18 +- .../Model/PreviousPage.php | 23 +- .../Model/PublicObjectSearchRequest.php | 210 +++--- .../Model/SimplePublicObject.php | 138 ++-- .../Model/SimplePublicObjectId.php | 21 +- .../SimplePublicObjectWithAssociations.php | 206 +++--- .../Model/StandardError.php | 205 +++--- .../Model/ValueWithTimestamp.php | 147 ++-- .../FeedbackSubmissions/ObjectSerializer.php | 26 +- 30 files changed, 1666 insertions(+), 2491 deletions(-) create mode 100644 codegen/Crm/Objects/FeedbackSubmissions/FormDataProcessor.php delete mode 100644 codegen/Crm/Objects/FeedbackSubmissions/Model/BatchResponseSimplePublicObjectWithErrors.php rename codegen/Crm/Objects/FeedbackSubmissions/Model/{CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php => CollectionResponseSimplePublicObjectWithAssociations.php} (83%) rename codegen/Crm/Objects/FeedbackSubmissions/Model/{CollectionResponseWithTotalSimplePublicObjectForwardPaging.php => CollectionResponseWithTotalSimplePublicObject.php} (80%) delete mode 100644 codegen/Crm/Objects/FeedbackSubmissions/Model/ForwardPaging.php diff --git a/codegen/Crm/Objects/FeedbackSubmissions/Api/BasicApi.php b/codegen/Crm/Objects/FeedbackSubmissions/Api/BasicApi.php index 098cacd3..7fbd2e20 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Api/BasicApi.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Api/BasicApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\SimplePublicObjectWithAssociations' !== '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\Objects\FeedbackSubmissions\Model\SimplePublicObjectWithAssociations', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\FeedbackSubmissions\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\Objects\FeedbackSubmissions\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -262,34 +225,11 @@ public function getByIdWithHttpInfo($feedback_submission_id, $properties = null, ); } - $returnType = '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\SimplePublicObjectWithAssociations'; - 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\Objects\FeedbackSubmissions\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -299,7 +239,7 @@ public function getByIdWithHttpInfo($feedback_submission_id, $properties = null, $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -307,8 +247,10 @@ public function getByIdWithHttpInfo($feedback_submission_id, $properties = null, $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -419,7 +361,10 @@ public function getByIdRequest($feedback_submission_id, $properties = null, $pro 'Missing the required parameter $feedback_submission_id when calling getById' ); } - + if (!preg_match("/.+/", $feedback_submission_id)) { + throw new \InvalidArgumentException("invalid value for \"feedback_submission_id\" when calling BasicApi.getById, must conform to the pattern /.+/."); + } + @@ -555,14 +500,14 @@ public function getByIdRequest($feedback_submission_id, $properties = null, $pro * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of feedback submissions that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\FeedbackSubmissions\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\Error + * @return \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\Error */ public function getPage($limit = 10, $after = null, $properties = null, $properties_with_history = null, $associations = null, $archived = false, string $contentType = self::contentTypes['getPage'][0]) { @@ -578,14 +523,14 @@ public function getPage($limit = 10, $after = null, $properties = null, $propert * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of feedback submissions that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\FeedbackSubmissions\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = null, $properties_with_history = null, $associations = null, $archived = false, string $contentType = self::contentTypes['getPage'][0]) { @@ -616,61 +561,21 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging' !== '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\Objects\FeedbackSubmissions\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\FeedbackSubmissions\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\Objects\FeedbackSubmissions\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -684,44 +589,21 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu ); } - $returnType = '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; - 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\Objects\FeedbackSubmissions\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', + '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseSimplePublicObjectWithAssociations', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -729,8 +611,10 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -743,7 +627,7 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of feedback submissions that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation @@ -769,7 +653,7 @@ function ($response) { * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of feedback submissions that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation @@ -779,7 +663,7 @@ function ($response) { */ public function getPageAsyncWithHttpInfo($limit = 10, $after = null, $properties = null, $properties_with_history = null, $associations = null, $archived = false, string $contentType = self::contentTypes['getPage'][0]) { - $returnType = '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseSimplePublicObjectWithAssociations'; $request = $this->getPageRequest($limit, $after, $properties, $properties_with_history, $associations, $archived, $contentType); return $this->client @@ -824,7 +708,7 @@ function ($exception) { * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) + * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of feedback submissions that can be read by a single request. (optional) * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation @@ -980,6 +864,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/Objects/FeedbackSubmissions/Api/BatchApi.php b/codegen/Crm/Objects/FeedbackSubmissions/Api/BatchApi.php index 988b11dd..b3eed3d6 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Api/BatchApi.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Api/BatchApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\BatchResponseSimplePublicObject' !== '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\Objects\FeedbackSubmissions\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\BatchResponseSimplePublicObjectWithErrors' !== '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\Objects\FeedbackSubmissions\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\FeedbackSubmissions\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\Objects\FeedbackSubmissions\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -278,34 +214,11 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc ); } - $returnType = '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\BatchResponseSimplePublicObject'; - 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\Objects\FeedbackSubmissions\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -315,15 +228,7 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\BatchResponseSimplePublicObjectWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -331,8 +236,10 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -534,6 +441,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/Objects/FeedbackSubmissions/Api/SearchApi.php b/codegen/Crm/Objects/FeedbackSubmissions/Api/SearchApi.php index 58555c98..4da349bd 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Api/SearchApi.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Api/SearchApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging' !== '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\Objects\FeedbackSubmissions\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\FeedbackSubmissions\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\Objects\FeedbackSubmissions\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -245,44 +212,21 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont ); } - $returnType = '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging'; - 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\Objects\FeedbackSubmissions\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', + '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseWithTotalSimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -290,8 +234,10 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -299,6 +245,8 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont /** * Operation doSearchAsync * + * Search for feedback submissions using specified criteria. + * * @param \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\PublicObjectSearchRequest $public_object_search_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['doSearch'] to see the possible values for this operation * @@ -318,6 +266,8 @@ function ($response) { /** * Operation doSearchAsyncWithHttpInfo * + * Search for feedback submissions using specified criteria. + * * @param \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\PublicObjectSearchRequest $public_object_search_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['doSearch'] to see the possible values for this operation * @@ -326,7 +276,7 @@ function ($response) { */ public function doSearchAsyncWithHttpInfo($public_object_search_request, string $contentType = self::contentTypes['doSearch'][0]) { - $returnType = '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\CollectionResponseWithTotalSimplePublicObject'; $request = $this->doSearchRequest($public_object_search_request, $contentType); return $this->client @@ -476,6 +426,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/Objects/FeedbackSubmissions/ApiException.php b/codegen/Crm/Objects/FeedbackSubmissions/ApiException.php index 671fcc19..e9c8bb27 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/ApiException.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/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/Objects/FeedbackSubmissions/FormDataProcessor.php b/codegen/Crm/Objects/FeedbackSubmissions/FormDataProcessor.php new file mode 100644 index 00000000..26802c72 --- /dev/null +++ b/codegen/Crm/Objects/FeedbackSubmissions/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/Objects/FeedbackSubmissions/HeaderSelector.php b/codegen/Crm/Objects/FeedbackSubmissions/HeaderSelector.php index e8bf6a77..4a7e61a0 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/HeaderSelector.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/HeaderSelector.php @@ -1,7 +1,7 @@ container[$offset]); } @@ -370,12 +371,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 +401,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/Objects/FeedbackSubmissions/Model/BatchReadInputSimplePublicObjectId.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/BatchReadInputSimplePublicObjectId.php index 3dc90c12..6e7fc97c 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/BatchReadInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/BatchReadInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchReadInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions @@ -13,11 +13,11 @@ /** * Feedback Submissions * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * BatchReadInputSimplePublicObjectId Class Doc Comment * * @category Class + * @description Specifies the input for reading a batch of CRM objects, including arrays of object IDs, requested property names (with optional history), and an optional unique identifying property. * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,10 +58,10 @@ class BatchReadInputSimplePublicObjectId implements ModelInterface, ArrayAccess, * @var string[] */ protected static $openAPITypes = [ - 'properties_with_history' => 'string[]', 'id_property' => 'string', 'inputs' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\SimplePublicObjectId[]', - 'properties' => 'string[]' + 'properties' => 'string[]', + 'properties_with_history' => 'string[]' ]; /** @@ -71,10 +72,10 @@ class BatchReadInputSimplePublicObjectId implements ModelInterface, ArrayAccess, * @psalm-var array */ protected static $openAPIFormats = [ - 'properties_with_history' => null, 'id_property' => null, 'inputs' => null, - 'properties' => null + 'properties' => null, + 'properties_with_history' => null ]; /** @@ -83,10 +84,10 @@ class BatchReadInputSimplePublicObjectId implements ModelInterface, ArrayAccess, * @var boolean[] */ protected static array $openAPINullables = [ - 'properties_with_history' => false, 'id_property' => false, 'inputs' => false, - 'properties' => false + 'properties' => false, + 'properties_with_history' => false ]; /** @@ -175,10 +176,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'properties_with_history' => 'propertiesWithHistory', 'id_property' => 'idProperty', 'inputs' => 'inputs', - 'properties' => 'properties' + 'properties' => 'properties', + 'properties_with_history' => 'propertiesWithHistory' ]; /** @@ -187,10 +188,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'properties_with_history' => 'setPropertiesWithHistory', 'id_property' => 'setIdProperty', 'inputs' => 'setInputs', - 'properties' => 'setProperties' + 'properties' => 'setProperties', + 'properties_with_history' => 'setPropertiesWithHistory' ]; /** @@ -199,10 +200,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'properties_with_history' => 'getPropertiesWithHistory', 'id_property' => 'getIdProperty', 'inputs' => 'getInputs', - 'properties' => 'getProperties' + 'properties' => 'getProperties', + 'properties_with_history' => 'getPropertiesWithHistory' ]; /** @@ -262,10 +263,10 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('properties_with_history', $data ?? [], null); $this->setIfExists('id_property', $data ?? [], null); $this->setIfExists('inputs', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('properties_with_history', $data ?? [], null); } /** @@ -295,15 +296,15 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['properties_with_history'] === null) { - $invalidProperties[] = "'properties_with_history' can't be null"; - } if ($this->container['inputs'] === null) { $invalidProperties[] = "'inputs' can't be null"; } if ($this->container['properties'] === null) { $invalidProperties[] = "'properties' can't be null"; } + if ($this->container['properties_with_history'] === null) { + $invalidProperties[] = "'properties_with_history' can't be null"; + } return $invalidProperties; } @@ -319,33 +320,6 @@ public function valid() } - /** - * Gets properties_with_history - * - * @return string[] - */ - public function getPropertiesWithHistory() - { - return $this->container['properties_with_history']; - } - - /** - * Sets properties_with_history - * - * @param string[] $properties_with_history properties_with_history - * - * @return self - */ - public function setPropertiesWithHistory($properties_with_history) - { - if (is_null($properties_with_history)) { - throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); - } - $this->container['properties_with_history'] = $properties_with_history; - - return $this; - } - /** * Gets id_property * @@ -413,7 +387,7 @@ public function getProperties() /** * Sets properties * - * @param string[] $properties properties + * @param string[] $properties Key-value pairs for setting properties for the new object. * * @return self */ @@ -426,14 +400,41 @@ public function setProperties($properties) return $this; } + + /** + * Gets properties_with_history + * + * @return string[] + */ + public function getPropertiesWithHistory() + { + return $this->container['properties_with_history']; + } + + /** + * Sets properties_with_history + * + * @param string[] $properties_with_history Key-value pairs for setting properties for the new object and their histories. + * + * @return self + */ + public function setPropertiesWithHistory($properties_with_history) + { + if (is_null($properties_with_history)) { + throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + } + $this->container['properties_with_history'] = $properties_with_history; + + return $this; + } /** * 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]); } @@ -441,12 +442,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; } @@ -471,11 +472,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/Objects/FeedbackSubmissions/Model/BatchResponseSimplePublicObject.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/BatchResponseSimplePublicObject.php index 44382a1a..42aa4c54 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/BatchResponseSimplePublicObject.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/BatchResponseSimplePublicObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions @@ -13,11 +13,11 @@ /** * Feedback Submissions * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * BatchResponseSimplePublicObject Class Doc Comment * * @category Class + * @description A public object batch response object * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,10 +59,12 @@ class BatchResponseSimplePublicObject implements ModelInterface, ArrayAccess, \J */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', + 'errors' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\SimplePublicObject[]', + 'started_at' => '\DateTime', 'status' => 'string' ]; @@ -74,10 +77,12 @@ class BatchResponseSimplePublicObject implements ModelInterface, ArrayAccess, \J */ protected static $openAPIFormats = [ 'completed_at' => 'date-time', - 'requested_at' => 'date-time', - 'started_at' => 'date-time', + 'errors' => null, 'links' => null, + 'num_errors' => 'int32', + 'requested_at' => 'date-time', 'results' => null, + 'started_at' => 'date-time', 'status' => null ]; @@ -88,10 +93,12 @@ class BatchResponseSimplePublicObject implements ModelInterface, ArrayAccess, \J */ protected static array $openAPINullables = [ 'completed_at' => false, - 'requested_at' => false, - 'started_at' => false, + 'errors' => false, 'links' => false, + 'num_errors' => false, + 'requested_at' => false, 'results' => false, + 'started_at' => false, 'status' => false ]; @@ -182,10 +189,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'completed_at' => 'completedAt', - 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', + 'errors' => 'errors', 'links' => 'links', + 'num_errors' => 'numErrors', + 'requested_at' => 'requestedAt', 'results' => 'results', + 'started_at' => 'startedAt', 'status' => 'status' ]; @@ -196,10 +205,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'completed_at' => 'setCompletedAt', - 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', + 'errors' => 'setErrors', 'links' => 'setLinks', + 'num_errors' => 'setNumErrors', + 'requested_at' => 'setRequestedAt', 'results' => 'setResults', + 'started_at' => 'setStartedAt', 'status' => 'setStatus' ]; @@ -210,10 +221,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'completed_at' => 'getCompletedAt', - 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', + 'errors' => 'getErrors', 'links' => 'getLinks', + 'num_errors' => 'getNumErrors', + 'requested_at' => 'getRequestedAt', 'results' => 'getResults', + 'started_at' => 'getStartedAt', 'status' => 'getStatus' ]; @@ -258,10 +271,10 @@ public function getModelName() return self::$openAPIModelName; } - public const STATUS_PENDING = 'PENDING'; - public const STATUS_PROCESSING = 'PROCESSING'; public const STATUS_CANCELED = 'CANCELED'; public const STATUS_COMPLETE = 'COMPLETE'; + public const STATUS_PENDING = 'PENDING'; + public const STATUS_PROCESSING = 'PROCESSING'; /** * Gets allowable values of the enum @@ -271,10 +284,10 @@ public function getModelName() public function getStatusAllowableValues() { return [ - self::STATUS_PENDING, - self::STATUS_PROCESSING, self::STATUS_CANCELED, self::STATUS_COMPLETE, + self::STATUS_PENDING, + self::STATUS_PROCESSING, ]; } @@ -294,10 +307,12 @@ public function getStatusAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('completed_at', $data ?? [], null); - $this->setIfExists('requested_at', $data ?? [], null); - $this->setIfExists('started_at', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('links', $data ?? [], null); + $this->setIfExists('num_errors', $data ?? [], null); + $this->setIfExists('requested_at', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('started_at', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); } @@ -331,12 +346,12 @@ public function listInvalidProperties() if ($this->container['completed_at'] === null) { $invalidProperties[] = "'completed_at' can't be null"; } - if ($this->container['started_at'] === null) { - $invalidProperties[] = "'started_at' can't be null"; - } if ($this->container['results'] === null) { $invalidProperties[] = "'results' can't be null"; } + if ($this->container['started_at'] === null) { + $invalidProperties[] = "'started_at' can't be null"; + } if ($this->container['status'] === null) { $invalidProperties[] = "'status' can't be null"; } @@ -377,7 +392,7 @@ public function getCompletedAt() /** * Sets completed_at * - * @param \DateTime $completed_at completed_at + * @param \DateTime $completed_at The timestamp when the batch processing was completed, in ISO 8601 format. * * @return self */ @@ -392,82 +407,109 @@ public function setCompletedAt($completed_at) } /** - * Gets requested_at + * Gets errors * - * @return \DateTime|null + * @return \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\StandardError[]|null */ - public function getRequestedAt() + public function getErrors() { - return $this->container['requested_at']; + return $this->container['errors']; } /** - * Sets requested_at + * Sets errors * - * @param \DateTime|null $requested_at requested_at + * @param \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\StandardError[]|null $errors errors * * @return self */ - public function setRequestedAt($requested_at) + public function setErrors($errors) { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['requested_at'] = $requested_at; + $this->container['errors'] = $errors; return $this; } /** - * Gets started_at + * Gets links * - * @return \DateTime + * @return array|null */ - public function getStartedAt() + public function getLinks() { - return $this->container['started_at']; + return $this->container['links']; } /** - * Sets started_at + * Sets links * - * @param \DateTime $started_at started_at + * @param array|null $links An object containing relevant links related to the batch request. * * @return self */ - public function setStartedAt($started_at) + public function setLinks($links) { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['started_at'] = $started_at; + $this->container['links'] = $links; return $this; } /** - * Gets links + * Gets num_errors * - * @return array|null + * @return int|null */ - public function getLinks() + public function getNumErrors() { - return $this->container['links']; + return $this->container['num_errors']; } /** - * Sets links + * Sets num_errors * - * @param array|null $links links + * @param int|null $num_errors The total number of errors that occurred during the batch operation. * * @return self */ - public function setLinks($links) + public function setNumErrors($num_errors) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($num_errors)) { + throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); } - $this->container['links'] = $links; + $this->container['num_errors'] = $num_errors; + + return $this; + } + + /** + * Gets requested_at + * + * @return \DateTime|null + */ + public function getRequestedAt() + { + return $this->container['requested_at']; + } + + /** + * Sets requested_at + * + * @param \DateTime|null $requested_at The timestamp when the batch request was initially made, in ISO 8601 format. + * + * @return self + */ + public function setRequestedAt($requested_at) + { + if (is_null($requested_at)) { + throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + } + $this->container['requested_at'] = $requested_at; return $this; } @@ -499,6 +541,33 @@ public function setResults($results) return $this; } + /** + * Gets started_at + * + * @return \DateTime + */ + public function getStartedAt() + { + return $this->container['started_at']; + } + + /** + * Sets started_at + * + * @param \DateTime $started_at The timestamp when the batch processing began, in ISO 8601 format. + * + * @return self + */ + public function setStartedAt($started_at) + { + if (is_null($started_at)) { + throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + } + $this->container['started_at'] = $started_at; + + return $this; + } + /** * Gets status * @@ -512,7 +581,7 @@ public function getStatus() /** * Sets status * - * @param string $status status + * @param string $status The status of the batch processing request: \"PENDING\", \"PROCESSING\", \"CANCELLED\", or \"COMPLETE\" * * @return self */ @@ -538,11 +607,11 @@ public function setStatus($status) /** * 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]); } @@ -550,12 +619,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; } @@ -580,11 +649,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/Objects/FeedbackSubmissions/Model/BatchResponseSimplePublicObjectWithErrors.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/BatchResponseSimplePublicObjectWithErrors.php deleted file mode 100644 index 165d8d12..00000000 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/BatchResponseSimplePublicObjectWithErrors.php +++ /dev/null @@ -1,697 +0,0 @@ - - */ -class BatchResponseSimplePublicObjectWithErrors implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'BatchResponseSimplePublicObjectWithErrors'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'completed_at' => '\DateTime', - 'num_errors' => 'int', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', - 'links' => 'array', - 'results' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\SimplePublicObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\StandardError[]', - 'status' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'completed_at' => 'date-time', - 'num_errors' => 'int32', - 'requested_at' => 'date-time', - 'started_at' => 'date-time', - 'links' => null, - 'results' => null, - 'errors' => null, - 'status' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'completed_at' => false, - 'num_errors' => false, - 'requested_at' => false, - 'started_at' => false, - 'links' => false, - 'results' => false, - 'errors' => false, - 'status' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'completed_at' => 'completedAt', - 'num_errors' => 'numErrors', - 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', - 'links' => 'links', - 'results' => 'results', - 'errors' => 'errors', - 'status' => 'status' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'completed_at' => 'setCompletedAt', - 'num_errors' => 'setNumErrors', - 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', - 'links' => 'setLinks', - 'results' => 'setResults', - 'errors' => 'setErrors', - 'status' => 'setStatus' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'completed_at' => 'getCompletedAt', - 'num_errors' => 'getNumErrors', - 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', - 'links' => 'getLinks', - 'results' => 'getResults', - 'errors' => 'getErrors', - 'status' => 'getStatus' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - public const STATUS_PENDING = 'PENDING'; - public const STATUS_PROCESSING = 'PROCESSING'; - public const STATUS_CANCELED = 'CANCELED'; - public const STATUS_COMPLETE = 'COMPLETE'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStatusAllowableValues() - { - return [ - self::STATUS_PENDING, - self::STATUS_PROCESSING, - self::STATUS_CANCELED, - self::STATUS_COMPLETE, - ]; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('completed_at', $data ?? [], null); - $this->setIfExists('num_errors', $data ?? [], null); - $this->setIfExists('requested_at', $data ?? [], null); - $this->setIfExists('started_at', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); - $this->setIfExists('results', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['completed_at'] === null) { - $invalidProperties[] = "'completed_at' can't be null"; - } - if ($this->container['started_at'] === null) { - $invalidProperties[] = "'started_at' can't be null"; - } - if ($this->container['results'] === null) { - $invalidProperties[] = "'results' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'status', must be one of '%s'", - $this->container['status'], - implode("', '", $allowedValues) - ); - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets completed_at - * - * @return \DateTime - */ - public function getCompletedAt() - { - return $this->container['completed_at']; - } - - /** - * Sets completed_at - * - * @param \DateTime $completed_at completed_at - * - * @return self - */ - public function setCompletedAt($completed_at) - { - if (is_null($completed_at)) { - throw new \InvalidArgumentException('non-nullable completed_at cannot be null'); - } - $this->container['completed_at'] = $completed_at; - - return $this; - } - - /** - * Gets num_errors - * - * @return int|null - */ - public function getNumErrors() - { - return $this->container['num_errors']; - } - - /** - * Sets num_errors - * - * @param int|null $num_errors num_errors - * - * @return self - */ - public function setNumErrors($num_errors) - { - if (is_null($num_errors)) { - throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); - } - $this->container['num_errors'] = $num_errors; - - return $this; - } - - /** - * Gets requested_at - * - * @return \DateTime|null - */ - public function getRequestedAt() - { - return $this->container['requested_at']; - } - - /** - * Sets requested_at - * - * @param \DateTime|null $requested_at requested_at - * - * @return self - */ - public function setRequestedAt($requested_at) - { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); - } - $this->container['requested_at'] = $requested_at; - - return $this; - } - - /** - * Gets started_at - * - * @return \DateTime - */ - public function getStartedAt() - { - return $this->container['started_at']; - } - - /** - * Sets started_at - * - * @param \DateTime $started_at started_at - * - * @return self - */ - public function setStartedAt($started_at) - { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); - } - $this->container['started_at'] = $started_at; - - return $this; - } - - /** - * Gets links - * - * @return array|null - */ - public function getLinks() - { - return $this->container['links']; - } - - /** - * Sets links - * - * @param array|null $links links - * - * @return self - */ - public function setLinks($links) - { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); - } - $this->container['links'] = $links; - - return $this; - } - - /** - * Gets results - * - * @return \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\SimplePublicObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\SimplePublicObject[] $results results - * - * @return self - */ - public function setResults($results) - { - if (is_null($results)) { - throw new \InvalidArgumentException('non-nullable results cannot be null'); - } - $this->container['results'] = $results; - - return $this; - } - - /** - * Gets errors - * - * @return \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\StandardError[]|null $errors errors - * - * @return self - */ - public function setErrors($errors) - { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); - } - $this->container['errors'] = $errors; - - return $this; - } - - /** - * Gets status - * - * @return string - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", - $status, - implode("', '", $allowedValues) - ) - ); - } - $this->container['status'] = $status; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/codegen/Crm/Objects/FeedbackSubmissions/Model/CollectionResponseAssociatedId.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/CollectionResponseAssociatedId.php index 26cc2086..9c8b170c 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/CollectionResponseAssociatedId.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/CollectionResponseAssociatedId.php @@ -2,7 +2,7 @@ /** * CollectionResponseAssociatedId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions @@ -13,11 +13,11 @@ /** * Feedback Submissions * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -355,11 +355,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]); } @@ -367,12 +367,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; } @@ -397,11 +397,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/Objects/FeedbackSubmissions/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/CollectionResponseSimplePublicObjectWithAssociations.php similarity index 83% rename from codegen/Crm/Objects/FeedbackSubmissions/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php rename to codegen/Crm/Objects/FeedbackSubmissions/Model/CollectionResponseSimplePublicObjectWithAssociations.php index 3e96e6b5..fe6b5b58 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/CollectionResponseSimplePublicObjectWithAssociations.php @@ -1,8 +1,8 @@ */ -class CollectionResponseSimplePublicObjectWithAssociationsForwardPaging implements ModelInterface, ArrayAccess, \JsonSerializable +class CollectionResponseSimplePublicObjectWithAssociations implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +49,7 @@ class CollectionResponseSimplePublicObjectWithAssociationsForwardPaging implemen * * @var string */ - protected static $openAPIModelName = 'CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; + protected static $openAPIModelName = 'CollectionResponseSimplePublicObjectWithAssociations'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,7 +57,7 @@ class CollectionResponseSimplePublicObjectWithAssociationsForwardPaging implemen * @var string[] */ protected static $openAPITypes = [ - 'paging' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\ForwardPaging', + 'paging' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\Paging', 'results' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\SimplePublicObjectWithAssociations[]' ]; @@ -302,7 +302,7 @@ public function valid() /** * Gets paging * - * @return \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\Paging|null */ public function getPaging() { @@ -312,7 +312,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\Paging|null $paging paging * * @return self */ @@ -355,11 +355,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]); } @@ -367,12 +367,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; } @@ -397,11 +397,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/Objects/FeedbackSubmissions/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/CollectionResponseWithTotalSimplePublicObject.php similarity index 80% rename from codegen/Crm/Objects/FeedbackSubmissions/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php rename to codegen/Crm/Objects/FeedbackSubmissions/Model/CollectionResponseWithTotalSimplePublicObject.php index 6191ce3a..c853e4fd 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/CollectionResponseWithTotalSimplePublicObject.php @@ -1,8 +1,8 @@ */ -class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements ModelInterface, ArrayAccess, \JsonSerializable +class CollectionResponseWithTotalSimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +50,7 @@ class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements Mode * * @var string */ - protected static $openAPIModelName = 'CollectionResponseWithTotalSimplePublicObjectForwardPaging'; + protected static $openAPIModelName = 'CollectionResponseWithTotalSimplePublicObject'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,9 +58,9 @@ class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements Mode * @var string[] */ protected static $openAPITypes = [ - 'total' => 'int', - 'paging' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\ForwardPaging', - 'results' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\SimplePublicObject[]' + 'paging' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\Paging', + 'results' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\SimplePublicObject[]', + 'total' => 'int' ]; /** @@ -70,9 +71,9 @@ class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements Mode * @psalm-var array */ protected static $openAPIFormats = [ - 'total' => 'int32', 'paging' => null, - 'results' => null + 'results' => null, + 'total' => 'int32' ]; /** @@ -81,9 +82,9 @@ class CollectionResponseWithTotalSimplePublicObjectForwardPaging implements Mode * @var boolean[] */ protected static array $openAPINullables = [ - 'total' => false, 'paging' => false, - 'results' => false + 'results' => false, + 'total' => false ]; /** @@ -172,9 +173,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'total' => 'total', 'paging' => 'paging', - 'results' => 'results' + 'results' => 'results', + 'total' => 'total' ]; /** @@ -183,9 +184,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'total' => 'setTotal', 'paging' => 'setPaging', - 'results' => 'setResults' + 'results' => 'setResults', + 'total' => 'setTotal' ]; /** @@ -194,9 +195,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'total' => 'getTotal', 'paging' => 'getPaging', - 'results' => 'getResults' + 'results' => 'getResults', + 'total' => 'getTotal' ]; /** @@ -256,9 +257,9 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('total', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); } /** @@ -288,12 +289,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['total'] === null) { - $invalidProperties[] = "'total' can't be null"; - } if ($this->container['results'] === null) { $invalidProperties[] = "'results' can't be null"; } + if ($this->container['total'] === null) { + $invalidProperties[] = "'total' can't be null"; + } return $invalidProperties; } @@ -309,37 +310,10 @@ public function valid() } - /** - * Gets total - * - * @return int - */ - public function getTotal() - { - return $this->container['total']; - } - - /** - * Sets total - * - * @param int $total total - * - * @return self - */ - public function setTotal($total) - { - if (is_null($total)) { - throw new \InvalidArgumentException('non-nullable total cannot be null'); - } - $this->container['total'] = $total; - - return $this; - } - /** * Gets paging * - * @return \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\Paging|null */ public function getPaging() { @@ -349,7 +323,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\Paging|null $paging paging * * @return self */ @@ -389,14 +363,41 @@ public function setResults($results) return $this; } + + /** + * Gets total + * + * @return int + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int $total The number of available results + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } /** * 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]); } @@ -404,12 +405,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; } @@ -434,11 +435,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/Objects/FeedbackSubmissions/Model/Error.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/Error.php index 56b71f72..4f5e2284 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/Error.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions @@ -13,11 +13,11 @@ /** * Feedback Submissions * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,13 +57,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'string', + 'category' => 'string', 'context' => 'array', 'correlation_id' => 'string', + 'errors' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\ErrorDetail[]', 'links' => 'array', 'message' => 'string', - 'category' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\ErrorDetail[]' + 'sub_category' => 'string' ]; /** @@ -74,13 +74,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, + 'category' => null, 'context' => null, 'correlation_id' => 'uuid', + 'errors' => null, 'links' => null, 'message' => null, - 'category' => null, - 'errors' => null + 'sub_category' => null ]; /** @@ -89,13 +89,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, + 'category' => false, 'context' => false, 'correlation_id' => false, + 'errors' => false, 'links' => false, 'message' => false, - 'category' => false, - 'errors' => false + 'sub_category' => false ]; /** @@ -184,13 +184,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', + 'category' => 'category', 'context' => 'context', 'correlation_id' => 'correlationId', + 'errors' => 'errors', 'links' => 'links', 'message' => 'message', - 'category' => 'category', - 'errors' => 'errors' + 'sub_category' => 'subCategory' ]; /** @@ -199,13 +199,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', + 'category' => 'setCategory', 'context' => 'setContext', 'correlation_id' => 'setCorrelationId', + 'errors' => 'setErrors', 'links' => 'setLinks', 'message' => 'setMessage', - 'category' => 'setCategory', - 'errors' => 'setErrors' + 'sub_category' => 'setSubCategory' ]; /** @@ -214,13 +214,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', + 'category' => 'getCategory', 'context' => 'getContext', 'correlation_id' => 'getCorrelationId', + 'errors' => 'getErrors', 'links' => 'getLinks', 'message' => 'getMessage', - 'category' => 'getCategory', - 'errors' => 'getErrors' + 'sub_category' => 'getSubCategory' ]; /** @@ -280,13 +280,13 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); $this->setIfExists('correlation_id', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('links', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); - $this->setIfExists('category', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -316,15 +316,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['category'] === null) { + $invalidProperties[] = "'category' can't be null"; + } if ($this->container['correlation_id'] === null) { $invalidProperties[] = "'correlation_id' can't be null"; } if ($this->container['message'] === null) { $invalidProperties[] = "'message' can't be null"; } - if ($this->container['category'] === null) { - $invalidProperties[] = "'category' can't be null"; - } return $invalidProperties; } @@ -341,28 +341,28 @@ public function valid() /** - * Gets sub_category + * Gets category * - * @return string|null + * @return string */ - public function getSubCategory() + public function getCategory() { - return $this->container['sub_category']; + return $this->container['category']; } /** - * Sets sub_category + * Sets category * - * @param string|null $sub_category A specific category that contains more specific detail about the error + * @param string $category The error category * * @return self */ - public function setSubCategory($sub_category) + public function setCategory($category) { - if (is_null($sub_category)) { - throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['sub_category'] = $sub_category; + $this->container['category'] = $category; return $this; } @@ -421,6 +421,33 @@ public function setCorrelationId($correlation_id) return $this; } + /** + * Gets errors + * + * @return \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\ErrorDetail[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\ErrorDetail[]|null $errors further information about the error + * + * @return self + */ + public function setErrors($errors) + { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; + + return $this; + } + /** * Gets links * @@ -476,66 +503,39 @@ public function setMessage($message) } /** - * Gets category - * - * @return string - */ - public function getCategory() - { - return $this->container['category']; - } - - /** - * Sets category - * - * @param string $category The error category - * - * @return self - */ - public function setCategory($category) - { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); - } - $this->container['category'] = $category; - - return $this; - } - - /** - * Gets errors + * Gets sub_category * - * @return \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\ErrorDetail[]|null + * @return string|null */ - public function getErrors() + public function getSubCategory() { - return $this->container['errors']; + return $this->container['sub_category']; } /** - * Sets errors + * Sets sub_category * - * @param \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\ErrorDetail[]|null $errors further information about the error + * @param string|null $sub_category A specific category that contains more specific detail about the error * * @return self */ - public function setErrors($errors) + public function setSubCategory($sub_category) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['errors'] = $errors; + $this->container['sub_category'] = $sub_category; return $this; } /** * 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/Objects/FeedbackSubmissions/Model/ErrorDetail.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/ErrorDetail.php index d3fd631a..7a80dd18 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/ErrorDetail.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions @@ -13,11 +13,11 @@ /** * Feedback Submissions * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,11 +57,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'string', 'code' => 'string', - 'in' => 'string', 'context' => 'array', - 'message' => 'string' + 'in' => 'string', + 'message' => 'string', + 'sub_category' => 'string' ]; /** @@ -72,11 +72,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, 'code' => null, - 'in' => null, 'context' => null, - 'message' => null + 'in' => null, + 'message' => null, + 'sub_category' => null ]; /** @@ -85,11 +85,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, 'code' => false, - 'in' => false, 'context' => false, - 'message' => false + 'in' => false, + 'message' => false, + 'sub_category' => false ]; /** @@ -178,11 +178,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', 'code' => 'code', - 'in' => 'in', 'context' => 'context', - 'message' => 'message' + 'in' => 'in', + 'message' => 'message', + 'sub_category' => 'subCategory' ]; /** @@ -191,11 +191,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', 'code' => 'setCode', - 'in' => 'setIn', 'context' => 'setContext', - 'message' => 'setMessage' + 'in' => 'setIn', + 'message' => 'setMessage', + 'sub_category' => 'setSubCategory' ]; /** @@ -204,11 +204,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', 'code' => 'getCode', - 'in' => 'getIn', 'context' => 'getContext', - 'message' => 'getMessage' + 'in' => 'getIn', + 'message' => 'getMessage', + 'sub_category' => 'getSubCategory' ]; /** @@ -268,11 +268,11 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('in', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); + $this->setIfExists('in', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -321,55 +321,55 @@ public function valid() /** - * Gets sub_category + * Gets code * * @return string|null */ - public function getSubCategory() + public function getCode() { - return $this->container['sub_category']; + return $this->container['code']; } /** - * Sets sub_category + * Sets code * - * @param string|null $sub_category A specific category that contains more specific detail about the error + * @param string|null $code The status code associated with the error detail * * @return self */ - public function setSubCategory($sub_category) + public function setCode($code) { - if (is_null($sub_category)) { - throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); } - $this->container['sub_category'] = $sub_category; + $this->container['code'] = $code; return $this; } /** - * Gets code + * Gets context * - * @return string|null + * @return array|null */ - public function getCode() + public function getContext() { - return $this->container['code']; + return $this->container['context']; } /** - * Sets code + * Sets context * - * @param string|null $code The status code associated with the error detail + * @param array|null $context Context about the error condition * * @return self */ - public function setCode($code) + public function setContext($context) { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); + if (is_null($context)) { + throw new \InvalidArgumentException('non-nullable context cannot be null'); } - $this->container['code'] = $code; + $this->container['context'] = $context; return $this; } @@ -402,66 +402,66 @@ public function setIn($in) } /** - * Gets context + * Gets message * - * @return array|null + * @return string */ - public function getContext() + public function getMessage() { - return $this->container['context']; + return $this->container['message']; } /** - * Sets context + * Sets message * - * @param array|null $context Context about the error condition + * @param string $message A human readable message describing the error along with remediation steps where appropriate * * @return self */ - public function setContext($context) + public function setMessage($message) { - if (is_null($context)) { - throw new \InvalidArgumentException('non-nullable context cannot be null'); + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - $this->container['context'] = $context; + $this->container['message'] = $message; return $this; } /** - * Gets message + * Gets sub_category * - * @return string + * @return string|null */ - public function getMessage() + public function getSubCategory() { - return $this->container['message']; + return $this->container['sub_category']; } /** - * Sets message + * Sets sub_category * - * @param string $message A human readable message describing the error along with remediation steps where appropriate + * @param string|null $sub_category A specific category that contains more specific detail about the error * * @return self */ - public function setMessage($message) + public function setSubCategory($sub_category) { - if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['message'] = $message; + $this->container['sub_category'] = $sub_category; return $this; } /** * 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/Objects/FeedbackSubmissions/Model/Filter.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/Filter.php index 9a27e700..4bafa942 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/Filter.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/Filter.php @@ -2,7 +2,7 @@ /** * Filter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions @@ -13,11 +13,11 @@ /** * Feedback Submissions * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * Filter Class Doc Comment * * @category Class + * @description Defines a single condition for searching CRM objects, specifying the property to filter on, the operator to use (such as equals, greater than, or contains), and the value(s) to compare against. * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,10 +59,10 @@ class Filter implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'high_value' => 'string', + 'operator' => 'string', 'property_name' => 'string', - 'values' => 'string[]', 'value' => 'string', - 'operator' => 'string' + 'values' => 'string[]' ]; /** @@ -73,10 +74,10 @@ class Filter implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'high_value' => null, + 'operator' => null, 'property_name' => null, - 'values' => null, 'value' => null, - 'operator' => null + 'values' => null ]; /** @@ -86,10 +87,10 @@ class Filter implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'high_value' => false, + 'operator' => false, 'property_name' => false, - 'values' => false, 'value' => false, - 'operator' => false + 'values' => false ]; /** @@ -179,10 +180,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'high_value' => 'highValue', + 'operator' => 'operator', 'property_name' => 'propertyName', - 'values' => 'values', 'value' => 'value', - 'operator' => 'operator' + 'values' => 'values' ]; /** @@ -192,10 +193,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'high_value' => 'setHighValue', + 'operator' => 'setOperator', 'property_name' => 'setPropertyName', - 'values' => 'setValues', 'value' => 'setValue', - 'operator' => 'setOperator' + 'values' => 'setValues' ]; /** @@ -205,10 +206,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'high_value' => 'getHighValue', + 'operator' => 'getOperator', 'property_name' => 'getPropertyName', - 'values' => 'getValues', 'value' => 'getValue', - 'operator' => 'getOperator' + 'values' => 'getValues' ]; /** @@ -252,19 +253,19 @@ public function getModelName() return self::$openAPIModelName; } + public const OPERATOR_BETWEEN = 'BETWEEN'; + public const OPERATOR_CONTAINS_TOKEN = 'CONTAINS_TOKEN'; public const OPERATOR_EQ = 'EQ'; - public const OPERATOR_NEQ = 'NEQ'; - public const OPERATOR_LT = 'LT'; - public const OPERATOR_LTE = 'LTE'; public const OPERATOR_GT = 'GT'; public const OPERATOR_GTE = 'GTE'; - public const OPERATOR_BETWEEN = 'BETWEEN'; - public const OPERATOR_IN = 'IN'; - public const OPERATOR_NOT_IN = 'NOT_IN'; public const OPERATOR_HAS_PROPERTY = 'HAS_PROPERTY'; - public const OPERATOR_NOT_HAS_PROPERTY = 'NOT_HAS_PROPERTY'; - public const OPERATOR_CONTAINS_TOKEN = 'CONTAINS_TOKEN'; + public const OPERATOR_IN = 'IN'; + public const OPERATOR_LT = 'LT'; + public const OPERATOR_LTE = 'LTE'; + public const OPERATOR_NEQ = 'NEQ'; public const OPERATOR_NOT_CONTAINS_TOKEN = 'NOT_CONTAINS_TOKEN'; + public const OPERATOR_NOT_HAS_PROPERTY = 'NOT_HAS_PROPERTY'; + public const OPERATOR_NOT_IN = 'NOT_IN'; /** * Gets allowable values of the enum @@ -274,19 +275,19 @@ public function getModelName() public function getOperatorAllowableValues() { return [ + self::OPERATOR_BETWEEN, + self::OPERATOR_CONTAINS_TOKEN, self::OPERATOR_EQ, - self::OPERATOR_NEQ, - self::OPERATOR_LT, - self::OPERATOR_LTE, self::OPERATOR_GT, self::OPERATOR_GTE, - self::OPERATOR_BETWEEN, - self::OPERATOR_IN, - self::OPERATOR_NOT_IN, self::OPERATOR_HAS_PROPERTY, - self::OPERATOR_NOT_HAS_PROPERTY, - self::OPERATOR_CONTAINS_TOKEN, + self::OPERATOR_IN, + self::OPERATOR_LT, + self::OPERATOR_LTE, + self::OPERATOR_NEQ, self::OPERATOR_NOT_CONTAINS_TOKEN, + self::OPERATOR_NOT_HAS_PROPERTY, + self::OPERATOR_NOT_IN, ]; } @@ -306,10 +307,10 @@ public function getOperatorAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('high_value', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); $this->setIfExists('property_name', $data ?? [], null); - $this->setIfExists('values', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); - $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); } /** @@ -339,9 +340,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['property_name'] === null) { - $invalidProperties[] = "'property_name' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } @@ -354,6 +352,9 @@ public function listInvalidProperties() ); } + if ($this->container['property_name'] === null) { + $invalidProperties[] = "'property_name' can't be null"; + } return $invalidProperties; } @@ -382,7 +383,7 @@ public function getHighValue() /** * Sets high_value * - * @param string|null $high_value high_value + * @param string|null $high_value The upper boundary value when using ranged-based filters. * * @return self */ @@ -397,55 +398,65 @@ public function setHighValue($high_value) } /** - * Gets property_name + * Gets operator * * @return string */ - public function getPropertyName() + public function getOperator() { - return $this->container['property_name']; + return $this->container['operator']; } /** - * Sets property_name + * Sets operator * - * @param string $property_name property_name + * @param string $operator null * * @return self */ - public function setPropertyName($property_name) + public function setOperator($operator) { - if (is_null($property_name)) { - throw new \InvalidArgumentException('non-nullable property_name cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['property_name'] = $property_name; + $allowedValues = $this->getOperatorAllowableValues(); + if (!in_array($operator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'operator', must be one of '%s'", + $operator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['operator'] = $operator; return $this; } /** - * Gets values + * Gets property_name * - * @return string[]|null + * @return string */ - public function getValues() + public function getPropertyName() { - return $this->container['values']; + return $this->container['property_name']; } /** - * Sets values + * Sets property_name * - * @param string[]|null $values values + * @param string $property_name The name of the property to apply the filter to. * * @return self */ - public function setValues($values) + public function setPropertyName($property_name) { - if (is_null($values)) { - throw new \InvalidArgumentException('non-nullable values cannot be null'); + if (is_null($property_name)) { + throw new \InvalidArgumentException('non-nullable property_name cannot be null'); } - $this->container['values'] = $values; + $this->container['property_name'] = $property_name; return $this; } @@ -463,7 +474,7 @@ public function getValue() /** * Sets value * - * @param string|null $value value + * @param string|null $value The value to match against the property. * * @return self */ @@ -478,49 +489,39 @@ public function setValue($value) } /** - * Gets operator + * Gets values * - * @return string + * @return string[]|null */ - public function getOperator() + public function getValues() { - return $this->container['operator']; + return $this->container['values']; } /** - * Sets operator + * Sets values * - * @param string $operator null + * @param string[]|null $values The values to match against the property. * * @return self */ - public function setOperator($operator) + public function setValues($values) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); - } - $allowedValues = $this->getOperatorAllowableValues(); - if (!in_array($operator, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'operator', must be one of '%s'", - $operator, - implode("', '", $allowedValues) - ) - ); + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); } - $this->container['operator'] = $operator; + $this->container['values'] = $values; return $this; } /** * 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]); } @@ -528,12 +529,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; } @@ -558,11 +559,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/Objects/FeedbackSubmissions/Model/FilterGroup.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/FilterGroup.php index 77597f38..68577bec 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/FilterGroup.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/FilterGroup.php @@ -2,7 +2,7 @@ /** * FilterGroup * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions @@ -13,11 +13,11 @@ /** * Feedback Submissions * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -321,11 +321,11 @@ public function setFilters($filters) /** * 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/Objects/FeedbackSubmissions/Model/ForwardPaging.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/ForwardPaging.php deleted file mode 100644 index e76084b8..00000000 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/ForwardPaging.php +++ /dev/null @@ -1,409 +0,0 @@ - - */ -class ForwardPaging implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'ForwardPaging'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'next' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\NextPage' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'next' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'next' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'next' => 'next' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'next' => 'setNext' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'next' => 'getNext' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('next', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets next - * - * @return \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\NextPage|null - */ - public function getNext() - { - return $this->container['next']; - } - - /** - * Sets next - * - * @param \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\NextPage|null $next next - * - * @return self - */ - public function setNext($next) - { - if (is_null($next)) { - throw new \InvalidArgumentException('non-nullable next cannot be null'); - } - $this->container['next'] = $next; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/codegen/Crm/Objects/FeedbackSubmissions/Model/ModelInterface.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/ModelInterface.php index f2fb0aa3..5e23f2f9 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/ModelInterface.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model @@ -13,11 +13,11 @@ /** * Feedback Submissions * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Objects/FeedbackSubmissions/Model/NextPage.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/NextPage.php index d8cdecf1..776615a0 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/NextPage.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/NextPage.php @@ -2,7 +2,7 @@ /** * NextPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions @@ -13,11 +13,11 @@ /** * Feedback Submissions * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * NextPage Class Doc Comment * * @category Class + * @description Specifies the paging information needed to retrieve the next set of results in a paginated API response * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,8 +58,8 @@ class NextPage implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'link' => 'string', - 'after' => 'string' + 'after' => 'string', + 'link' => 'string' ]; /** @@ -69,8 +70,8 @@ class NextPage implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'link' => null, - 'after' => null + 'after' => null, + 'link' => null ]; /** @@ -79,8 +80,8 @@ class NextPage implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'link' => false, - 'after' => false + 'after' => false, + 'link' => false ]; /** @@ -169,8 +170,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'link' => 'link', - 'after' => 'after' + 'after' => 'after', + 'link' => 'link' ]; /** @@ -179,8 +180,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'link' => 'setLink', - 'after' => 'setAfter' + 'after' => 'setAfter', + 'link' => 'setLink' ]; /** @@ -189,8 +190,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'link' => 'getLink', - 'after' => 'getAfter' + 'after' => 'getAfter', + 'link' => 'getLink' ]; /** @@ -250,8 +251,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('link', $data ?? [], null); $this->setIfExists('after', $data ?? [], null); + $this->setIfExists('link', $data ?? [], null); } /** @@ -300,66 +301,66 @@ public function valid() /** - * Gets link + * Gets after * - * @return string|null + * @return string */ - public function getLink() + public function getAfter() { - return $this->container['link']; + return $this->container['after']; } /** - * Sets link + * Sets after * - * @param string|null $link link + * @param string $after A paging cursor token for retrieving subsequent pages. * * @return self */ - public function setLink($link) + public function setAfter($after) { - if (is_null($link)) { - throw new \InvalidArgumentException('non-nullable link cannot be null'); + if (is_null($after)) { + throw new \InvalidArgumentException('non-nullable after cannot be null'); } - $this->container['link'] = $link; + $this->container['after'] = $after; return $this; } /** - * Gets after + * Gets link * - * @return string + * @return string|null */ - public function getAfter() + public function getLink() { - return $this->container['after']; + return $this->container['link']; } /** - * Sets after + * Sets link * - * @param string $after after + * @param string|null $link A URL that can be used to retrieve the next page results. * * @return self */ - public function setAfter($after) + public function setLink($link) { - if (is_null($after)) { - throw new \InvalidArgumentException('non-nullable after cannot be null'); + if (is_null($link)) { + throw new \InvalidArgumentException('non-nullable link cannot be null'); } - $this->container['after'] = $after; + $this->container['link'] = $link; return $this; } /** * 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]); } @@ -367,12 +368,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; } @@ -397,11 +398,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/Objects/FeedbackSubmissions/Model/Paging.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/Paging.php index 0d1b5941..16f700e5 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/Paging.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/Paging.php @@ -2,7 +2,7 @@ /** * Paging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions @@ -13,11 +13,11 @@ /** * Feedback Submissions * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -352,11 +352,11 @@ public function setPrev($prev) /** * 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]); } @@ -364,12 +364,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; } @@ -394,11 +394,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/Objects/FeedbackSubmissions/Model/PreviousPage.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/PreviousPage.php index ebe2a427..5dfe864d 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/PreviousPage.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/PreviousPage.php @@ -2,7 +2,7 @@ /** * PreviousPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions @@ -13,11 +13,11 @@ /** * Feedback Submissions * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * PreviousPage Class Doc Comment * * @category Class + * @description specifies the paging information needed to retrieve the previous set of results in a paginated API response * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -312,7 +313,7 @@ public function getBefore() /** * Sets before * - * @param string $before before + * @param string $before A paging cursor token for retrieving previous pages. * * @return self */ @@ -339,7 +340,7 @@ public function getLink() /** * Sets link * - * @param string|null $link link + * @param string|null $link A URL that can be used to retrieve the previous pages' results. * * @return self */ @@ -355,11 +356,11 @@ public function setLink($link) /** * 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]); } @@ -367,12 +368,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; } @@ -397,11 +398,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/Objects/FeedbackSubmissions/Model/PublicObjectSearchRequest.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/PublicObjectSearchRequest.php index a5a1aaa4..a1746c3d 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/PublicObjectSearchRequest.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/PublicObjectSearchRequest.php @@ -2,7 +2,7 @@ /** * PublicObjectSearchRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions @@ -13,11 +13,11 @@ /** * Feedback Submissions * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * PublicObjectSearchRequest Class Doc Comment * * @category Class + * @description Describes a search request * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,12 +58,12 @@ class PublicObjectSearchRequest implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ - 'query' => 'string', - 'limit' => 'int', 'after' => 'string', - 'sorts' => 'string[]', + 'filter_groups' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\FilterGroup[]', + 'limit' => 'int', 'properties' => 'string[]', - 'filter_groups' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\FilterGroup[]' + 'query' => 'string', + 'sorts' => 'string[]' ]; /** @@ -73,12 +74,12 @@ class PublicObjectSearchRequest implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ - 'query' => null, - 'limit' => 'int32', 'after' => null, - 'sorts' => null, + 'filter_groups' => null, + 'limit' => 'int32', 'properties' => null, - 'filter_groups' => null + 'query' => null, + 'sorts' => null ]; /** @@ -87,12 +88,12 @@ class PublicObjectSearchRequest implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static array $openAPINullables = [ - 'query' => false, - 'limit' => false, 'after' => false, - 'sorts' => false, + 'filter_groups' => false, + 'limit' => false, 'properties' => false, - 'filter_groups' => false + 'query' => false, + 'sorts' => false ]; /** @@ -181,12 +182,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'query' => 'query', - 'limit' => 'limit', 'after' => 'after', - 'sorts' => 'sorts', + 'filter_groups' => 'filterGroups', + 'limit' => 'limit', 'properties' => 'properties', - 'filter_groups' => 'filterGroups' + 'query' => 'query', + 'sorts' => 'sorts' ]; /** @@ -195,12 +196,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'query' => 'setQuery', - 'limit' => 'setLimit', 'after' => 'setAfter', - 'sorts' => 'setSorts', + 'filter_groups' => 'setFilterGroups', + 'limit' => 'setLimit', 'properties' => 'setProperties', - 'filter_groups' => 'setFilterGroups' + 'query' => 'setQuery', + 'sorts' => 'setSorts' ]; /** @@ -209,12 +210,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'query' => 'getQuery', - 'limit' => 'getLimit', 'after' => 'getAfter', - 'sorts' => 'getSorts', + 'filter_groups' => 'getFilterGroups', + 'limit' => 'getLimit', 'properties' => 'getProperties', - 'filter_groups' => 'getFilterGroups' + 'query' => 'getQuery', + 'sorts' => 'getSorts' ]; /** @@ -274,12 +275,12 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('query', $data ?? [], null); - $this->setIfExists('limit', $data ?? [], null); $this->setIfExists('after', $data ?? [], null); - $this->setIfExists('sorts', $data ?? [], null); - $this->setIfExists('properties', $data ?? [], null); $this->setIfExists('filter_groups', $data ?? [], null); + $this->setIfExists('limit', $data ?? [], null); + $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('query', $data ?? [], null); + $this->setIfExists('sorts', $data ?? [], null); } /** @@ -309,6 +310,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['after'] === null) { + $invalidProperties[] = "'after' can't be null"; + } + if ($this->container['filter_groups'] === null) { + $invalidProperties[] = "'filter_groups' can't be null"; + } + if ($this->container['limit'] === null) { + $invalidProperties[] = "'limit' can't be null"; + } + if ($this->container['properties'] === null) { + $invalidProperties[] = "'properties' can't be null"; + } + if ($this->container['sorts'] === null) { + $invalidProperties[] = "'sorts' can't be null"; + } return $invalidProperties; } @@ -325,174 +341,174 @@ public function valid() /** - * Gets query + * Gets after * - * @return string|null + * @return string */ - public function getQuery() + public function getAfter() { - return $this->container['query']; + return $this->container['after']; } /** - * Sets query + * Sets after * - * @param string|null $query query + * @param string $after A paging cursor token for retrieving subsequent pages. * * @return self */ - public function setQuery($query) + public function setAfter($after) { - if (is_null($query)) { - throw new \InvalidArgumentException('non-nullable query cannot be null'); + if (is_null($after)) { + throw new \InvalidArgumentException('non-nullable after cannot be null'); } - $this->container['query'] = $query; + $this->container['after'] = $after; return $this; } /** - * Gets limit + * Gets filter_groups * - * @return int|null + * @return \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\FilterGroup[] */ - public function getLimit() + public function getFilterGroups() { - return $this->container['limit']; + return $this->container['filter_groups']; } /** - * Sets limit + * Sets filter_groups * - * @param int|null $limit limit + * @param \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\FilterGroup[] $filter_groups Up to 6 groups of filters defining additional query criteria. * * @return self */ - public function setLimit($limit) + public function setFilterGroups($filter_groups) { - if (is_null($limit)) { - throw new \InvalidArgumentException('non-nullable limit cannot be null'); + if (is_null($filter_groups)) { + throw new \InvalidArgumentException('non-nullable filter_groups cannot be null'); } - $this->container['limit'] = $limit; + $this->container['filter_groups'] = $filter_groups; return $this; } /** - * Gets after + * Gets limit * - * @return string|null + * @return int */ - public function getAfter() + public function getLimit() { - return $this->container['after']; + return $this->container['limit']; } /** - * Sets after + * Sets limit * - * @param string|null $after after + * @param int $limit The maximum results to return, up to 200 objects. * * @return self */ - public function setAfter($after) + public function setLimit($limit) { - if (is_null($after)) { - throw new \InvalidArgumentException('non-nullable after cannot be null'); + if (is_null($limit)) { + throw new \InvalidArgumentException('non-nullable limit cannot be null'); } - $this->container['after'] = $after; + $this->container['limit'] = $limit; return $this; } /** - * Gets sorts + * Gets properties * - * @return string[]|null + * @return string[] */ - public function getSorts() + public function getProperties() { - return $this->container['sorts']; + return $this->container['properties']; } /** - * Sets sorts + * Sets properties * - * @param string[]|null $sorts sorts + * @param string[] $properties A list of property names to include in the response. * * @return self */ - public function setSorts($sorts) + public function setProperties($properties) { - if (is_null($sorts)) { - throw new \InvalidArgumentException('non-nullable sorts cannot be null'); + if (is_null($properties)) { + throw new \InvalidArgumentException('non-nullable properties cannot be null'); } - $this->container['sorts'] = $sorts; + $this->container['properties'] = $properties; return $this; } /** - * Gets properties + * Gets query * - * @return string[]|null + * @return string|null */ - public function getProperties() + public function getQuery() { - return $this->container['properties']; + return $this->container['query']; } /** - * Sets properties + * Sets query * - * @param string[]|null $properties properties + * @param string|null $query The search query string, up to 3000 characters. * * @return self */ - public function setProperties($properties) + public function setQuery($query) { - if (is_null($properties)) { - throw new \InvalidArgumentException('non-nullable properties cannot be null'); + if (is_null($query)) { + throw new \InvalidArgumentException('non-nullable query cannot be null'); } - $this->container['properties'] = $properties; + $this->container['query'] = $query; return $this; } /** - * Gets filter_groups + * Gets sorts * - * @return \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\FilterGroup[]|null + * @return string[] */ - public function getFilterGroups() + public function getSorts() { - return $this->container['filter_groups']; + return $this->container['sorts']; } /** - * Sets filter_groups + * Sets sorts * - * @param \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\FilterGroup[]|null $filter_groups filter_groups + * @param string[] $sorts Specifies sorting order based on object properties. * * @return self */ - public function setFilterGroups($filter_groups) + public function setSorts($sorts) { - if (is_null($filter_groups)) { - throw new \InvalidArgumentException('non-nullable filter_groups cannot be null'); + if (is_null($sorts)) { + throw new \InvalidArgumentException('non-nullable sorts cannot be null'); } - $this->container['filter_groups'] = $filter_groups; + $this->container['sorts'] = $sorts; return $this; } /** * 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]); } @@ -500,12 +516,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; } @@ -530,11 +546,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/Objects/FeedbackSubmissions/Model/SimplePublicObject.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/SimplePublicObject.php index ce519336..759d2c9b 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/SimplePublicObject.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/SimplePublicObject.php @@ -2,7 +2,7 @@ /** * SimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions @@ -13,11 +13,11 @@ /** * Feedback Submissions * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObject Class Doc Comment * * @category Class + * @description A simple public object. * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,13 +58,13 @@ class SimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'created_at' => '\DateTime', 'archived' => 'bool', 'archived_at' => '\DateTime', - 'properties_with_history' => 'array', + 'created_at' => '\DateTime', 'id' => 'string', 'object_write_trace_id' => 'string', 'properties' => 'array', + 'properties_with_history' => 'array', 'updated_at' => '\DateTime' ]; @@ -75,13 +76,13 @@ class SimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ - 'created_at' => 'date-time', 'archived' => null, 'archived_at' => 'date-time', - 'properties_with_history' => null, + 'created_at' => 'date-time', 'id' => null, 'object_write_trace_id' => null, 'properties' => null, + 'properties_with_history' => null, 'updated_at' => 'date-time' ]; @@ -91,13 +92,13 @@ class SimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializab * @var boolean[] */ protected static array $openAPINullables = [ - 'created_at' => false, 'archived' => false, 'archived_at' => false, - 'properties_with_history' => false, + 'created_at' => false, 'id' => false, 'object_write_trace_id' => false, 'properties' => false, + 'properties_with_history' => false, 'updated_at' => false ]; @@ -187,13 +188,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'created_at' => 'createdAt', 'archived' => 'archived', 'archived_at' => 'archivedAt', - 'properties_with_history' => 'propertiesWithHistory', + 'created_at' => 'createdAt', 'id' => 'id', 'object_write_trace_id' => 'objectWriteTraceId', 'properties' => 'properties', + 'properties_with_history' => 'propertiesWithHistory', 'updated_at' => 'updatedAt' ]; @@ -203,13 +204,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'created_at' => 'setCreatedAt', 'archived' => 'setArchived', 'archived_at' => 'setArchivedAt', - 'properties_with_history' => 'setPropertiesWithHistory', + 'created_at' => 'setCreatedAt', 'id' => 'setId', 'object_write_trace_id' => 'setObjectWriteTraceId', 'properties' => 'setProperties', + 'properties_with_history' => 'setPropertiesWithHistory', 'updated_at' => 'setUpdatedAt' ]; @@ -219,13 +220,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'created_at' => 'getCreatedAt', 'archived' => 'getArchived', 'archived_at' => 'getArchivedAt', - 'properties_with_history' => 'getPropertiesWithHistory', + 'created_at' => 'getCreatedAt', 'id' => 'getId', 'object_write_trace_id' => 'getObjectWriteTraceId', 'properties' => 'getProperties', + 'properties_with_history' => 'getPropertiesWithHistory', 'updated_at' => 'getUpdatedAt' ]; @@ -286,13 +287,13 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('archived', $data ?? [], null); $this->setIfExists('archived_at', $data ?? [], null); - $this->setIfExists('properties_with_history', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('properties_with_history', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); } @@ -323,6 +324,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['archived'] === null) { + $invalidProperties[] = "'archived' can't be null"; + } if ($this->container['created_at'] === null) { $invalidProperties[] = "'created_at' can't be null"; } @@ -350,37 +354,10 @@ public function valid() } - /** - * Gets created_at - * - * @return \DateTime - */ - public function getCreatedAt() - { - return $this->container['created_at']; - } - - /** - * Sets created_at - * - * @param \DateTime $created_at created_at - * - * @return self - */ - public function setCreatedAt($created_at) - { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); - } - $this->container['created_at'] = $created_at; - - return $this; - } - /** * Gets archived * - * @return bool|null + * @return bool */ public function getArchived() { @@ -390,7 +367,7 @@ public function getArchived() /** * Sets archived * - * @param bool|null $archived archived + * @param bool $archived Whether the object is archived. * * @return self */ @@ -417,7 +394,7 @@ public function getArchivedAt() /** * Sets archived_at * - * @param \DateTime|null $archived_at archived_at + * @param \DateTime|null $archived_at The timestamp when the object was archived, in ISO 8601 format. * * @return self */ @@ -432,28 +409,28 @@ public function setArchivedAt($archived_at) } /** - * Gets properties_with_history + * Gets created_at * - * @return array|null + * @return \DateTime */ - public function getPropertiesWithHistory() + public function getCreatedAt() { - return $this->container['properties_with_history']; + return $this->container['created_at']; } /** - * Sets properties_with_history + * Sets created_at * - * @param array|null $properties_with_history properties_with_history + * @param \DateTime $created_at The timestamp when the object was created, in ISO 8601 format. * * @return self */ - public function setPropertiesWithHistory($properties_with_history) + public function setCreatedAt($created_at) { - if (is_null($properties_with_history)) { - throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['properties_with_history'] = $properties_with_history; + $this->container['created_at'] = $created_at; return $this; } @@ -471,7 +448,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -498,7 +475,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id An identifier used for tracing the write request for the object. * * @return self */ @@ -525,7 +502,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key-value pairs representing the properties of the object. * * @return self */ @@ -539,6 +516,33 @@ public function setProperties($properties) return $this; } + /** + * Gets properties_with_history + * + * @return array|null + */ + public function getPropertiesWithHistory() + { + return $this->container['properties_with_history']; + } + + /** + * Sets properties_with_history + * + * @param array|null $properties_with_history Key-value pairs representing the properties of the object along with their history. + * + * @return self + */ + public function setPropertiesWithHistory($properties_with_history) + { + if (is_null($properties_with_history)) { + throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + } + $this->container['properties_with_history'] = $properties_with_history; + + return $this; + } + /** * Gets updated_at * @@ -552,7 +556,7 @@ public function getUpdatedAt() /** * Sets updated_at * - * @param \DateTime $updated_at updated_at + * @param \DateTime $updated_at The timestamp when the object was last updated, in ISO 8601 format. * * @return self */ @@ -568,11 +572,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]); } @@ -580,12 +584,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; } @@ -610,11 +614,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/Objects/FeedbackSubmissions/Model/SimplePublicObjectId.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/SimplePublicObjectId.php index 62a1dd6a..1fa1915e 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/SimplePublicObjectId.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/SimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions @@ -13,11 +13,11 @@ /** * Feedback Submissions * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectId Class Doc Comment * * @category Class + * @description Contains the Id of a Public Object * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -305,7 +306,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -321,11 +322,11 @@ public function setId($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]); } @@ -333,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; } @@ -363,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/Objects/FeedbackSubmissions/Model/SimplePublicObjectWithAssociations.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/SimplePublicObjectWithAssociations.php index c9c187e8..21b204f1 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/SimplePublicObjectWithAssociations.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/SimplePublicObjectWithAssociations.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectWithAssociations * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions @@ -13,11 +13,11 @@ /** * Feedback Submissions * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectWithAssociations Class Doc Comment * * @category Class + * @description Represents a CRM object along with its properties, timestamps, and a set of associated object IDs grouped by association type. * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,14 +58,14 @@ class SimplePublicObjectWithAssociations implements ModelInterface, ArrayAccess, * @var string[] */ protected static $openAPITypes = [ - 'associations' => 'array', - 'created_at' => '\DateTime', 'archived' => 'bool', 'archived_at' => '\DateTime', - 'properties_with_history' => 'array', + 'associations' => 'array', + 'created_at' => '\DateTime', 'id' => 'string', 'object_write_trace_id' => 'string', 'properties' => 'array', + 'properties_with_history' => 'array', 'updated_at' => '\DateTime' ]; @@ -76,14 +77,14 @@ class SimplePublicObjectWithAssociations implements ModelInterface, ArrayAccess, * @psalm-var array */ protected static $openAPIFormats = [ - 'associations' => null, - 'created_at' => 'date-time', 'archived' => null, 'archived_at' => 'date-time', - 'properties_with_history' => null, + 'associations' => null, + 'created_at' => 'date-time', 'id' => null, 'object_write_trace_id' => null, 'properties' => null, + 'properties_with_history' => null, 'updated_at' => 'date-time' ]; @@ -93,14 +94,14 @@ class SimplePublicObjectWithAssociations implements ModelInterface, ArrayAccess, * @var boolean[] */ protected static array $openAPINullables = [ - 'associations' => false, - 'created_at' => false, 'archived' => false, 'archived_at' => false, - 'properties_with_history' => false, + 'associations' => false, + 'created_at' => false, 'id' => false, 'object_write_trace_id' => false, 'properties' => false, + 'properties_with_history' => false, 'updated_at' => false ]; @@ -190,14 +191,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'associations' => 'associations', - 'created_at' => 'createdAt', 'archived' => 'archived', 'archived_at' => 'archivedAt', - 'properties_with_history' => 'propertiesWithHistory', + 'associations' => 'associations', + 'created_at' => 'createdAt', 'id' => 'id', 'object_write_trace_id' => 'objectWriteTraceId', 'properties' => 'properties', + 'properties_with_history' => 'propertiesWithHistory', 'updated_at' => 'updatedAt' ]; @@ -207,14 +208,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'associations' => 'setAssociations', - 'created_at' => 'setCreatedAt', 'archived' => 'setArchived', 'archived_at' => 'setArchivedAt', - 'properties_with_history' => 'setPropertiesWithHistory', + 'associations' => 'setAssociations', + 'created_at' => 'setCreatedAt', 'id' => 'setId', 'object_write_trace_id' => 'setObjectWriteTraceId', 'properties' => 'setProperties', + 'properties_with_history' => 'setPropertiesWithHistory', 'updated_at' => 'setUpdatedAt' ]; @@ -224,14 +225,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'associations' => 'getAssociations', - 'created_at' => 'getCreatedAt', 'archived' => 'getArchived', 'archived_at' => 'getArchivedAt', - 'properties_with_history' => 'getPropertiesWithHistory', + 'associations' => 'getAssociations', + 'created_at' => 'getCreatedAt', 'id' => 'getId', 'object_write_trace_id' => 'getObjectWriteTraceId', 'properties' => 'getProperties', + 'properties_with_history' => 'getPropertiesWithHistory', 'updated_at' => 'getUpdatedAt' ]; @@ -292,14 +293,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('associations', $data ?? [], null); - $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('archived', $data ?? [], null); $this->setIfExists('archived_at', $data ?? [], null); - $this->setIfExists('properties_with_history', $data ?? [], null); + $this->setIfExists('associations', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('object_write_trace_id', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('properties_with_history', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); } @@ -330,6 +331,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['archived'] === null) { + $invalidProperties[] = "'archived' can't be null"; + } if ($this->container['created_at'] === null) { $invalidProperties[] = "'created_at' can't be null"; } @@ -357,64 +361,10 @@ public function valid() } - /** - * Gets associations - * - * @return array|null - */ - public function getAssociations() - { - return $this->container['associations']; - } - - /** - * Sets associations - * - * @param array|null $associations associations - * - * @return self - */ - public function setAssociations($associations) - { - if (is_null($associations)) { - throw new \InvalidArgumentException('non-nullable associations cannot be null'); - } - $this->container['associations'] = $associations; - - return $this; - } - - /** - * Gets created_at - * - * @return \DateTime - */ - public function getCreatedAt() - { - return $this->container['created_at']; - } - - /** - * Sets created_at - * - * @param \DateTime $created_at created_at - * - * @return self - */ - public function setCreatedAt($created_at) - { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); - } - $this->container['created_at'] = $created_at; - - return $this; - } - /** * Gets archived * - * @return bool|null + * @return bool */ public function getArchived() { @@ -424,7 +374,7 @@ public function getArchived() /** * Sets archived * - * @param bool|null $archived archived + * @param bool $archived Whether the object is archived. * * @return self */ @@ -451,7 +401,7 @@ public function getArchivedAt() /** * Sets archived_at * - * @param \DateTime|null $archived_at archived_at + * @param \DateTime|null $archived_at The timestamp when the object was archived, in ISO 8601 format. * * @return self */ @@ -466,28 +416,55 @@ public function setArchivedAt($archived_at) } /** - * Gets properties_with_history + * Gets associations * - * @return array|null + * @return array|null */ - public function getPropertiesWithHistory() + public function getAssociations() { - return $this->container['properties_with_history']; + return $this->container['associations']; } /** - * Sets properties_with_history + * Sets associations * - * @param array|null $properties_with_history properties_with_history + * @param array|null $associations A list defining relationships with other objects. * * @return self */ - public function setPropertiesWithHistory($properties_with_history) + public function setAssociations($associations) { - if (is_null($properties_with_history)) { - throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + if (is_null($associations)) { + throw new \InvalidArgumentException('non-nullable associations cannot be null'); } - $this->container['properties_with_history'] = $properties_with_history; + $this->container['associations'] = $associations; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime $created_at The timestamp when the object was created, in ISO 8601 format. + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; return $this; } @@ -505,7 +482,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -532,7 +509,7 @@ public function getObjectWriteTraceId() /** * Sets object_write_trace_id * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $object_write_trace_id An identifier used for tracing the creation or update request of the object. * * @return self */ @@ -559,7 +536,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key value pairs representing the properties of the object. * * @return self */ @@ -573,6 +550,33 @@ public function setProperties($properties) return $this; } + /** + * Gets properties_with_history + * + * @return array|null + */ + public function getPropertiesWithHistory() + { + return $this->container['properties_with_history']; + } + + /** + * Sets properties_with_history + * + * @param array|null $properties_with_history Key-value pairs representing the properties of the object along with their history. + * + * @return self + */ + public function setPropertiesWithHistory($properties_with_history) + { + if (is_null($properties_with_history)) { + throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + } + $this->container['properties_with_history'] = $properties_with_history; + + return $this; + } + /** * Gets updated_at * @@ -586,7 +590,7 @@ public function getUpdatedAt() /** * Sets updated_at * - * @param \DateTime $updated_at updated_at + * @param \DateTime $updated_at The timestamp when the object was last updated, in ISO 8601 format. * * @return self */ @@ -602,11 +606,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]); } @@ -614,12 +618,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; } @@ -644,11 +648,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/Objects/FeedbackSubmissions/Model/StandardError.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/StandardError.php index 750c38d7..4b4f9e99 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/StandardError.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/StandardError.php @@ -2,7 +2,7 @@ /** * StandardError * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions @@ -13,11 +13,11 @@ /** * Feedback Submissions * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * StandardError Class Doc Comment * * @category Class + * @description Ye olde error * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,14 +58,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'object', + 'category' => 'string', 'context' => 'array', - 'links' => 'array', + 'errors' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\ErrorDetail[]', 'id' => 'string', - 'category' => 'string', + 'links' => 'array', 'message' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\ErrorDetail[]', - 'status' => 'string' + 'status' => 'string', + 'sub_category' => 'object' ]; /** @@ -75,14 +76,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, + 'category' => null, 'context' => null, - 'links' => null, + 'errors' => null, 'id' => null, - 'category' => null, + 'links' => null, 'message' => null, - 'errors' => null, - 'status' => null + 'status' => null, + 'sub_category' => null ]; /** @@ -91,14 +92,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, + 'category' => false, 'context' => false, - 'links' => false, + 'errors' => false, 'id' => false, - 'category' => false, + 'links' => false, 'message' => false, - 'errors' => false, - 'status' => false + 'status' => false, + 'sub_category' => false ]; /** @@ -187,14 +188,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', + 'category' => 'category', 'context' => 'context', - 'links' => 'links', + 'errors' => 'errors', 'id' => 'id', - 'category' => 'category', + 'links' => 'links', 'message' => 'message', - 'errors' => 'errors', - 'status' => 'status' + 'status' => 'status', + 'sub_category' => 'subCategory' ]; /** @@ -203,14 +204,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', + 'category' => 'setCategory', 'context' => 'setContext', - 'links' => 'setLinks', + 'errors' => 'setErrors', 'id' => 'setId', - 'category' => 'setCategory', + 'links' => 'setLinks', 'message' => 'setMessage', - 'errors' => 'setErrors', - 'status' => 'setStatus' + 'status' => 'setStatus', + 'sub_category' => 'setSubCategory' ]; /** @@ -219,14 +220,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', + 'category' => 'getCategory', 'context' => 'getContext', - 'links' => 'getLinks', + 'errors' => 'getErrors', 'id' => 'getId', - 'category' => 'getCategory', + 'links' => 'getLinks', 'message' => 'getMessage', - 'errors' => 'getErrors', - 'status' => 'getStatus' + 'status' => 'getStatus', + 'sub_category' => 'getSubCategory' ]; /** @@ -286,14 +287,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('links', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -323,21 +324,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['category'] === null) { + $invalidProperties[] = "'category' can't be null"; + } if ($this->container['context'] === null) { $invalidProperties[] = "'context' can't be null"; } + if ($this->container['errors'] === null) { + $invalidProperties[] = "'errors' can't be null"; + } if ($this->container['links'] === null) { $invalidProperties[] = "'links' can't be null"; } - if ($this->container['category'] === null) { - $invalidProperties[] = "'category' can't be null"; - } if ($this->container['message'] === null) { $invalidProperties[] = "'message' can't be null"; } - if ($this->container['errors'] === null) { - $invalidProperties[] = "'errors' can't be null"; - } if ($this->container['status'] === null) { $invalidProperties[] = "'status' can't be null"; } @@ -357,28 +358,28 @@ public function valid() /** - * Gets sub_category + * Gets category * - * @return object|null + * @return string */ - public function getSubCategory() + public function getCategory() { - return $this->container['sub_category']; + return $this->container['category']; } /** - * Sets sub_category + * Sets category * - * @param object|null $sub_category sub_category + * @param string $category The main category of the error. * * @return self */ - public function setSubCategory($sub_category) + public function setCategory($category) { - if (is_null($sub_category)) { - throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['sub_category'] = $sub_category; + $this->container['category'] = $category; return $this; } @@ -396,7 +397,7 @@ public function getContext() /** * Sets context * - * @param array $context context + * @param array $context Additional context-specific information related to the error. * * @return self */ @@ -411,28 +412,28 @@ public function setContext($context) } /** - * Gets links + * Gets errors * - * @return array + * @return \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\ErrorDetail[] */ - public function getLinks() + public function getErrors() { - return $this->container['links']; + return $this->container['errors']; } /** - * Sets links + * Sets errors * - * @param array $links links + * @param \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\ErrorDetail[] $errors The detailed error objects. * * @return self */ - public function setLinks($links) + public function setErrors($errors) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['links'] = $links; + $this->container['errors'] = $errors; return $this; } @@ -450,7 +451,7 @@ public function getId() /** * Sets id * - * @param string|null $id id + * @param string|null $id A unique ID for the error instance. * * @return self */ @@ -465,28 +466,28 @@ public function setId($id) } /** - * Gets category + * Gets links * - * @return string + * @return array */ - public function getCategory() + public function getLinks() { - return $this->container['category']; + return $this->container['links']; } /** - * Sets category + * Sets links * - * @param string $category category + * @param array $links URLs linking to documentation or resources associated with the error. * * @return self */ - public function setCategory($category) + public function setLinks($links) { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['category'] = $category; + $this->container['links'] = $links; return $this; } @@ -504,7 +505,7 @@ public function getMessage() /** * Sets message * - * @param string $message message + * @param string $message A human-readable string describing the error and possible remediation steps. * * @return self */ @@ -519,66 +520,66 @@ public function setMessage($message) } /** - * Gets errors + * Gets status * - * @return \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\ErrorDetail[] + * @return string */ - public function getErrors() + public function getStatus() { - return $this->container['errors']; + return $this->container['status']; } /** - * Sets errors + * Sets status * - * @param \HubSpot\Client\Crm\Objects\FeedbackSubmissions\Model\ErrorDetail[] $errors errors + * @param string $status The HTTP status code associated with the error. * * @return self */ - public function setErrors($errors) + public function setStatus($status) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); } - $this->container['errors'] = $errors; + $this->container['status'] = $status; return $this; } /** - * Gets status + * Gets sub_category * - * @return string + * @return object|null */ - public function getStatus() + public function getSubCategory() { - return $this->container['status']; + return $this->container['sub_category']; } /** - * Sets status + * Sets sub_category * - * @param string $status status + * @param object|null $sub_category A more specific error category within each main category. * * @return self */ - public function setStatus($status) + public function setSubCategory($sub_category) { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['status'] = $status; + $this->container['sub_category'] = $sub_category; return $this; } /** * 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 +587,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 +617,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/Objects/FeedbackSubmissions/Model/ValueWithTimestamp.php b/codegen/Crm/Objects/FeedbackSubmissions/Model/ValueWithTimestamp.php index 1f7dde1a..d555983e 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/Model/ValueWithTimestamp.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/Model/ValueWithTimestamp.php @@ -2,7 +2,7 @@ /** * ValueWithTimestamp * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions @@ -13,11 +13,11 @@ /** * Feedback Submissions * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * ValueWithTimestamp Class Doc Comment * * @category Class + * @description Property model that includes timestamp. * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,11 +59,11 @@ class ValueWithTimestamp implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPITypes = [ 'source_id' => 'string', - 'source_type' => 'string', 'source_label' => 'string', + 'source_type' => 'string', + 'timestamp' => '\DateTime', 'updated_by_user_id' => 'int', - 'value' => 'string', - 'timestamp' => '\DateTime' + 'value' => 'string' ]; /** @@ -74,11 +75,11 @@ class ValueWithTimestamp implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPIFormats = [ 'source_id' => null, - 'source_type' => null, 'source_label' => null, + 'source_type' => null, + 'timestamp' => 'date-time', 'updated_by_user_id' => 'int32', - 'value' => null, - 'timestamp' => 'date-time' + 'value' => null ]; /** @@ -88,11 +89,11 @@ class ValueWithTimestamp implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static array $openAPINullables = [ 'source_id' => false, - 'source_type' => false, 'source_label' => false, + 'source_type' => false, + 'timestamp' => false, 'updated_by_user_id' => false, - 'value' => false, - 'timestamp' => false + 'value' => false ]; /** @@ -182,11 +183,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'source_id' => 'sourceId', - 'source_type' => 'sourceType', 'source_label' => 'sourceLabel', + 'source_type' => 'sourceType', + 'timestamp' => 'timestamp', 'updated_by_user_id' => 'updatedByUserId', - 'value' => 'value', - 'timestamp' => 'timestamp' + 'value' => 'value' ]; /** @@ -196,11 +197,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'source_id' => 'setSourceId', - 'source_type' => 'setSourceType', 'source_label' => 'setSourceLabel', + 'source_type' => 'setSourceType', + 'timestamp' => 'setTimestamp', 'updated_by_user_id' => 'setUpdatedByUserId', - 'value' => 'setValue', - 'timestamp' => 'setTimestamp' + 'value' => 'setValue' ]; /** @@ -210,11 +211,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'source_id' => 'getSourceId', - 'source_type' => 'getSourceType', 'source_label' => 'getSourceLabel', + 'source_type' => 'getSourceType', + 'timestamp' => 'getTimestamp', 'updated_by_user_id' => 'getUpdatedByUserId', - 'value' => 'getValue', - 'timestamp' => 'getTimestamp' + 'value' => 'getValue' ]; /** @@ -275,11 +276,11 @@ public function getModelName() public function __construct(?array $data = null) { $this->setIfExists('source_id', $data ?? [], null); - $this->setIfExists('source_type', $data ?? [], null); $this->setIfExists('source_label', $data ?? [], null); + $this->setIfExists('source_type', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); $this->setIfExists('updated_by_user_id', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); - $this->setIfExists('timestamp', $data ?? [], null); } /** @@ -312,12 +313,12 @@ public function listInvalidProperties() if ($this->container['source_type'] === null) { $invalidProperties[] = "'source_type' can't be null"; } - if ($this->container['value'] === null) { - $invalidProperties[] = "'value' can't be null"; - } if ($this->container['timestamp'] === null) { $invalidProperties[] = "'timestamp' can't be null"; } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } return $invalidProperties; } @@ -346,7 +347,7 @@ public function getSourceId() /** * Sets source_id * - * @param string|null $source_id source_id + * @param string|null $source_id The unique ID of the property. * * @return self */ @@ -360,6 +361,33 @@ public function setSourceId($source_id) return $this; } + /** + * Gets source_label + * + * @return string|null + */ + public function getSourceLabel() + { + return $this->container['source_label']; + } + + /** + * Sets source_label + * + * @param string|null $source_label A human-readable label. + * + * @return self + */ + public function setSourceLabel($source_label) + { + if (is_null($source_label)) { + throw new \InvalidArgumentException('non-nullable source_label cannot be null'); + } + $this->container['source_label'] = $source_label; + + return $this; + } + /** * Gets source_type * @@ -373,7 +401,7 @@ public function getSourceType() /** * Sets source_type * - * @param string $source_type source_type + * @param string $source_type The property type. * * @return self */ @@ -388,28 +416,28 @@ public function setSourceType($source_type) } /** - * Gets source_label + * Gets timestamp * - * @return string|null + * @return \DateTime */ - public function getSourceLabel() + public function getTimestamp() { - return $this->container['source_label']; + return $this->container['timestamp']; } /** - * Sets source_label + * Sets timestamp * - * @param string|null $source_label source_label + * @param \DateTime $timestamp The timestamp when the property was updated, in ISO 8601 format. * * @return self */ - public function setSourceLabel($source_label) + public function setTimestamp($timestamp) { - if (is_null($source_label)) { - throw new \InvalidArgumentException('non-nullable source_label cannot be null'); + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); } - $this->container['source_label'] = $source_label; + $this->container['timestamp'] = $timestamp; return $this; } @@ -427,7 +455,7 @@ public function getUpdatedByUserId() /** * Sets updated_by_user_id * - * @param int|null $updated_by_user_id updated_by_user_id + * @param int|null $updated_by_user_id The ID of the user who last updated the property. * * @return self */ @@ -454,7 +482,7 @@ public function getValue() /** * Sets value * - * @param string $value value + * @param string $value The property value. * * @return self */ @@ -467,41 +495,14 @@ public function setValue($value) return $this; } - - /** - * Gets timestamp - * - * @return \DateTime - */ - public function getTimestamp() - { - return $this->container['timestamp']; - } - - /** - * Sets timestamp - * - * @param \DateTime $timestamp timestamp - * - * @return self - */ - public function setTimestamp($timestamp) - { - if (is_null($timestamp)) { - throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); - } - $this->container['timestamp'] = $timestamp; - - return $this; - } /** * 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]); } @@ -509,12 +510,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; } @@ -539,11 +540,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/Objects/FeedbackSubmissions/ObjectSerializer.php b/codegen/Crm/Objects/FeedbackSubmissions/ObjectSerializer.php index 145410e4..960fa47b 100644 --- a/codegen/Crm/Objects/FeedbackSubmissions/ObjectSerializer.php +++ b/codegen/Crm/Objects/FeedbackSubmissions/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\FeedbackSubmissions @@ -13,11 +13,11 @@ /** * Feedback Submissions * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.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) : ''; } }